From 87754c8e06ea18997eeb572640667d0f9ca11aba Mon Sep 17 00:00:00 2001 From: ThePra Date: Mon, 13 Apr 2020 00:21:36 +0200 Subject: [PATCH] Many updates --- Seenginx/Pages/Counter.razor | 16 - Seenginx/Pages/Dmesg.razor | 7 + Seenginx/Pages/FetchData.razor | 46 --- Seenginx/Pages/Nginx.razor | 7 + Seenginx/Pages/Systemd.razor | 7 + Seenginx/Pages/_Host.cshtml | 14 +- Seenginx/SCSS/base.scss | 26 ++ Seenginx/SCSS/main.scss | 4 + Seenginx/SCSS/mixins.scss | 58 +++ Seenginx/SCSS/side-menu.scss | 182 +++++++++ Seenginx/SCSS/utility.scss | 9 + Seenginx/Seenginx.csproj | 22 +- Seenginx/Shared/MainLayout.razor | 21 +- Seenginx/Shared/NavMenu.razor | 65 ++-- Seenginx/Shared/NavMenu.razor.cs | 47 +++ Seenginx/Startup.cs | 13 +- Seenginx/compilerconfig.json | 6 + Seenginx/compilerconfig.json.defaults | 63 +++ Seenginx/wwwroot/css/main.css | 173 +++++++++ Seenginx/wwwroot/css/main.min.css | 1 + Seenginx/wwwroot/css/site.css | 7 - Seenginx/wwwroot/js/modal.js | 540 ++++++++++++++++++++++++++ Seenginx/wwwroot/js/ui.js | 46 +++ 23 files changed, 1256 insertions(+), 124 deletions(-) delete mode 100644 Seenginx/Pages/Counter.razor create mode 100644 Seenginx/Pages/Dmesg.razor delete mode 100644 Seenginx/Pages/FetchData.razor create mode 100644 Seenginx/Pages/Nginx.razor create mode 100644 Seenginx/Pages/Systemd.razor create mode 100644 Seenginx/SCSS/base.scss create mode 100644 Seenginx/SCSS/main.scss create mode 100644 Seenginx/SCSS/mixins.scss create mode 100644 Seenginx/SCSS/side-menu.scss create mode 100644 Seenginx/SCSS/utility.scss create mode 100644 Seenginx/Shared/NavMenu.razor.cs create mode 100644 Seenginx/compilerconfig.json create mode 100644 Seenginx/compilerconfig.json.defaults create mode 100644 Seenginx/wwwroot/css/main.css create mode 100644 Seenginx/wwwroot/css/main.min.css delete mode 100644 Seenginx/wwwroot/css/site.css create mode 100644 Seenginx/wwwroot/js/modal.js create mode 100644 Seenginx/wwwroot/js/ui.js diff --git a/Seenginx/Pages/Counter.razor b/Seenginx/Pages/Counter.razor deleted file mode 100644 index a4d4af9..0000000 --- a/Seenginx/Pages/Counter.razor +++ /dev/null @@ -1,16 +0,0 @@ -@page "/counter" - -

Counter

- -

Current count: @currentCount

- - - -@code { - private int currentCount = 0; - - private void IncrementCount() - { - currentCount++; - } -} diff --git a/Seenginx/Pages/Dmesg.razor b/Seenginx/Pages/Dmesg.razor new file mode 100644 index 0000000..03a9fd0 --- /dev/null +++ b/Seenginx/Pages/Dmesg.razor @@ -0,0 +1,7 @@ +@page "/dmesg" + +

Dmesg

+ +@code { + +} diff --git a/Seenginx/Pages/FetchData.razor b/Seenginx/Pages/FetchData.razor deleted file mode 100644 index 545ac32..0000000 --- a/Seenginx/Pages/FetchData.razor +++ /dev/null @@ -1,46 +0,0 @@ -@page "/fetchdata" - -@using Seenginx.Data -@inject WeatherForecastService ForecastService - -

Weather forecast

- -

This component demonstrates fetching data from a service.

- -@if (forecasts == null) -{ -

Loading...

-} -else -{ - - - - - - - - - - - @foreach (var forecast in forecasts) - { - - - - - - - } - -
DateTemp. (C)Temp. (F)Summary
@forecast.Date.ToShortDateString()@forecast.TemperatureC@forecast.TemperatureF@forecast.Summary
-} - -@code { - private WeatherForecast[] forecasts; - - protected override async Task OnInitializedAsync() - { - forecasts = await ForecastService.GetForecastAsync(DateTime.Now); - } -} diff --git a/Seenginx/Pages/Nginx.razor b/Seenginx/Pages/Nginx.razor new file mode 100644 index 0000000..f6a5a9c --- /dev/null +++ b/Seenginx/Pages/Nginx.razor @@ -0,0 +1,7 @@ +@page "/nginx" + +

Nginx

+ +@code { + +} diff --git a/Seenginx/Pages/Systemd.razor b/Seenginx/Pages/Systemd.razor new file mode 100644 index 0000000..a857faf --- /dev/null +++ b/Seenginx/Pages/Systemd.razor @@ -0,0 +1,7 @@ +@page "/systemd" + +

SystemD

+ +@code { + +} diff --git a/Seenginx/Pages/_Host.cshtml b/Seenginx/Pages/_Host.cshtml index 6d140eb..3bb279c 100644 --- a/Seenginx/Pages/_Host.cshtml +++ b/Seenginx/Pages/_Host.cshtml @@ -13,15 +13,17 @@ Seenginx + - - + + + - - + + + - @@ -40,5 +42,7 @@ + + diff --git a/Seenginx/SCSS/base.scss b/Seenginx/SCSS/base.scss new file mode 100644 index 0000000..9538436 --- /dev/null +++ b/Seenginx/SCSS/base.scss @@ -0,0 +1,26 @@ +body { + box-sizing: border-box +} + +*, ::before, ::after { + box-sizing: inherit +} + +#blazor-error-ui { + background: lightyellow; + bottom: 0; + box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); + display: none; + left: 0; + padding: 0.6rem 1.25rem 0.7rem 1.25rem; + position: fixed; + width: 100%; + z-index: 1000; + + & .dismiss { + cursor: pointer; + position: absolute; + right: 0.75rem; + top: 0.5rem; + } +} diff --git a/Seenginx/SCSS/main.scss b/Seenginx/SCSS/main.scss new file mode 100644 index 0000000..e1a1c87 --- /dev/null +++ b/Seenginx/SCSS/main.scss @@ -0,0 +1,4 @@ +@import "mixins.scss"; +@import "base.scss"; +@import "utility.scss"; +@import "side-menu.scss"; \ No newline at end of file diff --git a/Seenginx/SCSS/mixins.scss b/Seenginx/SCSS/mixins.scss new file mode 100644 index 0000000..4cde5ea --- /dev/null +++ b/Seenginx/SCSS/mixins.scss @@ -0,0 +1,58 @@ +//MEDIA QUERY MANAGER + +/*$breakpoint argument choices: + - phone + - tab-port + - tab-land + - desk + - big-desktop + */ + +@mixin MediaQuery($breakpoint) { + // max-width:600px; + @if $breakpoint==phone { + @media only screen and (max-width: 37.5em) { + @content + } + } + + @if $breakpoint==tab-p { + // min-width:601px; + // max-width:900px; + @media only screen and (min-width: 601px) and (max-width: 900px) { + @content + } + } + + @if $breakpoint==tab-l { + // min-width:901px; + // max-width:1200px; + @media only screen and (min-width: 901px) and (max-width: 1200px) { + @content + } + } + + @if $breakpoint==laptop { + // min-width:1201px; + // max-width:1366px; + @media only screen and (min-width: 1201px) and (max-width: 1366px) { + @content + } + } + + @if $breakpoint==desk { + // min-width:1201px; + // max-width:1800px; + @media only screen and (min-width: 1201px) and (max-width: 1800px) { + @content + } + } + + @if $breakpoint==big-d { + // min-width:1801px; + // max-width:4000px; + @media only screen and (min-width: 1801px) and (max-width: 4000px) { + @content + } + } +} diff --git a/Seenginx/SCSS/side-menu.scss b/Seenginx/SCSS/side-menu.scss new file mode 100644 index 0000000..5069e22 --- /dev/null +++ b/Seenginx/SCSS/side-menu.scss @@ -0,0 +1,182 @@ +body { + color: #777; +} + +:root { + --leftPanel: 150px; + --negativeLeftPanel: -150px; + --mobileLeftPanel: 150px; + --mobileNegativeLeftPanel: -150px; +} + +.pure-img-responsive { + max-width: 100%; + height: auto; +} + +/* +Add transition to containers so they can push in and out. +*/ +#layout, +#menu, +.menu-link { + -webkit-transition: all 0.2s ease-out; + -moz-transition: all 0.2s ease-out; + -ms-transition: all 0.2s ease-out; + -o-transition: all 0.2s ease-out; + transition: all 0.2s ease-out; +} + +/* +This is the parent `
` that contains the menu and the content area. +*/ +#layout { + position: relative; + left: 0; + padding-left: 0; + + &.active { + + & .menu-link { + left: var(--leftPanel); + } + + & #menu { + left: var(--leftPanel); + width: var(--leftPanel); + } + } +} + +/* +The `#menu` `
` is the parent `
` that contains the `.pure-menu` that +appears on the left side of the page. +*/ + +#menu { + margin-left: var(--negativeLeftPanel); /* "#menu" width */ + width: var(--leftPanel); + position: fixed; + top: 0; + left: 0; + bottom: 0; + z-index: 1000; /* so the menu or its navicon stays above all content */ + background: #191818; + overflow-y: auto; + -webkit-overflow-scrolling: touch; + //All anchors inside the menu should be styled like this. + & a { + color: #999; + border: none; + padding: 0.6em 0 0.6em 0.6em; + } + //Remove all background/borders, since we are applying them to #menu. + & .pure-menu, + & .pure-menu ul { + border: none; + background: transparent; + } + //Add that light border to separate items into groups. + & .pure-menu ul, + & .pure-menu .menu-item-divided { + border-top: 1px solid #333; + } + //Change color of the anchor links on hover/focus. + & .pure-menu li a:hover, + & .pure-menu li a:focus { + background: #333; + } + //This styles the selected menu item `
  • `. + & .pure-menu-selected, + & .pure-menu-heading { + background: #1f8dd6; + } + //This styles a link within a selected menu item `
  • `. + & .pure-menu-selected a { + color: #fff; + } + //This styles the menu heading. + & .pure-menu-heading { + font-size: 110%; + color: #fff; + margin: 0; + } +} + +/* -- Dynamic Button For Responsive Menu -------------------------------------*/ + +/* +The button to open/close the Menu is custom-made and not part of Pure. Here's +how it works: +*/ + +/* +`.menu-link` represents the responsive menu toggle that shows/hides on +small screens. +*/ +.menu-link { + position: fixed; + display: block; /* show this only on small screens */ + top: 0; + left: 0; /* "#menu width" */ + background: #000; + background: rgba(0,0,0,0.7); + font-size: 16px; /* change this value to increase/decrease button size */ + z-index: 10; + width: min-content; + height: auto; + padding: 14px; + + &:hover, + &:focus { + background: #000; + } +} + + + +/* -- Responsive Styles (Media Queries) ------------------------------------- */ + +/* +Hides the menu at `48em`, but modify this based on your app's needs. +*/ +@media (min-width: 48em) { + + .header, + .content { + padding-left: 2em; + padding-right: 2em; + } + + #layout { + padding-left: var(--leftPanel); /* left col width "#menu" */ + left: 0; + } + + #menu { + left: var(--leftPanel); + } + + .menu-link { + position: fixed; + left: var(--leftPanel); + display: none; + } + + #layout.active .menu-link { + left: var(--leftPanel); + } +} + +@media (max-width: 48em) { + /* Only apply this when the window is small. Otherwise, the following + case results in extra padding on the left: + * Make the window small. + * Tap the menu to trigger the active state. + * Make the window large again. + */ + #layout.active { + position: relative; + left: var(--leftPanel); + } +} diff --git a/Seenginx/SCSS/utility.scss b/Seenginx/SCSS/utility.scss new file mode 100644 index 0000000..fb4a60c --- /dev/null +++ b/Seenginx/SCSS/utility.scss @@ -0,0 +1,9 @@ +.isHidden { + display: none; + + &Mobile { + @include MediaQuery(phone) { + display: none + } + } +} diff --git a/Seenginx/Seenginx.csproj b/Seenginx/Seenginx.csproj index 57a0d0a..f3a6de7 100644 --- a/Seenginx/Seenginx.csproj +++ b/Seenginx/Seenginx.csproj @@ -5,8 +5,28 @@ - + + + + + + + + + + + + + + + + + + + + + diff --git a/Seenginx/Shared/MainLayout.razor b/Seenginx/Shared/MainLayout.razor index 5d872fe..260d074 100644 --- a/Seenginx/Shared/MainLayout.razor +++ b/Seenginx/Shared/MainLayout.razor @@ -1,15 +1,14 @@ @inherits LayoutComponentBase -