From 8c242b4aa52772234c37ae8e69bc8ae3355ab7e5 Mon Sep 17 00:00:00 2001 From: Vrifox Date: Tue, 2 Mar 2021 11:02:13 +0100 Subject: [PATCH] simplified main menu, (maybe?) fixed preloading of css --- assets/import/nav.scss | 135 ++++++--------------------------- assets/index.scss | 10 --- layouts/_default/list.html | 2 +- layouts/_default/single.html | 2 +- layouts/errorpages/list.html | 2 +- layouts/errorpages/single.html | 2 +- layouts/index.html | 2 +- layouts/partials/nav.html | 57 +++----------- 8 files changed, 39 insertions(+), 173 deletions(-) diff --git a/assets/import/nav.scss b/assets/import/nav.scss index 02b912d..c6005c3 100644 --- a/assets/import/nav.scss +++ b/assets/import/nav.scss @@ -1,117 +1,28 @@ -nav { - background: $bg60; - overflow-x: auto; - overflow-y: hidden; - position: sticky; - top: 0; - white-space: nowrap; - z-index: 20; - .container { - align-items: center; +header.main { + align-items: center; + display: flex; + flex-wrap: wrap; + margin: 0 auto; + max-width: 1140px; + min-height: 64px; + width: 100%; + a { + color: $white; + padding: 17.6px 15px; + text-decoration: none; + text-underline-offset: 6px; + margin: 0 15px; + &:hover { + text-decoration: underline; + } + } + h1 { display: flex; - height: 64px; - .website-name { - a { - color: $white; - display: block; - padding: 20px 30px; - text-decoration: none; - transition: background .2s; - &:hover { - background: $bg50; - } - &.active { - border-bottom: 2px solid $white-dark; - border-top: 2px solid transparent; - padding: 16px 30px; - } - } - } - .seperator { - cursor: default; - display: block; - padding: 20px; - } - .website-mainmenu { - ul { - display: flex; - margin: 0; - padding: 0; - li { - list-style-type: none; - &.active a { - border-bottom: 2px solid $white-dark; - border-top: 4px solid transparent; - padding: 16px 30px; - } - a { - color: $white; - display: block; - text-decoration: none; - transition: background .2s; - padding: 20px 30px; - &:hover { - background: $bg50; - } - } - } - } - } - .website-externallinks { - margin-left: auto; - ul { - display: flex; - margin: 0; - padding: 0; - li { - list-style-type: none; - a { - color: $white; - display: block; - text-decoration: none; - transition: background .2s; - padding: 20px 30px; - &:hover { - background: $bg50; - } - } - .seperator { - display: block; - padding: 20px 10px; - } - } - } - } + font-size: 16px; + margin: 0; } -} -@media (max-width: 1140px) { nav { - .container { - margin: 0; - width: 100%; - } - } -} -@media (max-width: 800px) { - nav { - .container { - .website-externallinks { - ul { - li { - a { - background: $bg50; - color: $white-dark; - &:hover { - background: $bg40; - } - } - .seperator { - display: block; - padding: 20px 10px; - } - } - } - } - } + display: flex; + flex-wrap: wrap; } } diff --git a/assets/index.scss b/assets/index.scss index 18d7c17..8a54fdc 100644 --- a/assets/index.scss +++ b/assets/index.scss @@ -7,16 +7,6 @@ .section.header { background: $bg60; @include a-underlined; - &::before { - background: linear-gradient(0deg, transparent, #3c3c5a); - content: ""; - display: block; - height: 32px; - margin-top: -32px; - position: sticky; - top: 64px; - width: 100%; - } header { margin: 60px auto; max-width: 600px; diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 2c116f7..b688552 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,7 +1,7 @@ {{- define "stylesheet" -}} {{- $scss := resources.Get "/_default/list.scss" -}} {{- $style := $scss | resources.ToCSS -}} - + {{- end -}} {{- define "main" }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 83573d7..118152e 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,7 +1,7 @@ {{- define "stylesheet" -}} {{- $scss := resources.Get "/_default/single.scss" -}} {{- $style := $scss | resources.ToCSS -}} - + {{- end -}} {{- define "main" -}} diff --git a/layouts/errorpages/list.html b/layouts/errorpages/list.html index df65941..696de8d 100644 --- a/layouts/errorpages/list.html +++ b/layouts/errorpages/list.html @@ -1,5 +1,5 @@ {{ define "stylesheet" }}{{ $sass := resources.Get "/errorpages.scss" }}{{ $style := $sass | resources.ToCSS }} - + {{ end }} {{ define "main" }} diff --git a/layouts/errorpages/single.html b/layouts/errorpages/single.html index 6f356ea..9ec7578 100644 --- a/layouts/errorpages/single.html +++ b/layouts/errorpages/single.html @@ -1,5 +1,5 @@ {{ define "stylesheet" }}{{ $sass := resources.Get "/errorpages.scss" }}{{ $style := $sass | resources.ToCSS }} - + {{ end }} {{ define "main" }} diff --git a/layouts/index.html b/layouts/index.html index fc9f048..692137d 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,7 +1,7 @@ {{- define "stylesheet" -}} {{- $scss := resources.Get "/index.scss" -}} {{- $style := $scss | resources.ToCSS -}} - + {{- end -}} {{- define "main" -}} diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html index 860a053..8caa8ad 100644 --- a/layouts/partials/nav.html +++ b/layouts/partials/nav.html @@ -1,46 +1,11 @@ - {{ $currentPage := . }} - + {{- $currentPage := . -}} +
+ {{- range .Site.Menus.name }} +

{{ .Name }}

+ {{- end }} + +