From 55a872356734a4a7de2b1089fb3034b365f87a06 Mon Sep 17 00:00:00 2001 From: dolphinau Date: Sat, 6 Sep 2025 15:06:22 +0200 Subject: [PATCH] Add burger menu --- assets/css/main.css | 132 ++++++++++++++++++++++++++++++++++++- layouts/partials/menu.html | 17 ++++- 2 files changed, 145 insertions(+), 4 deletions(-) diff --git a/assets/css/main.css b/assets/css/main.css index f1be332..64f0faf 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -12,6 +12,8 @@ header { height: 520px; background-image: url(/chapelle.png); background-position: center; + background-color: rgba(244, 244, 244, 0.286); + background-blend-mode: overlay; } header > div { @@ -27,6 +29,10 @@ header > div { max-width: 760px; } +.burger-menu { + display: none; +} + .menu ul { list-style-type: none; display: flex; @@ -35,6 +41,10 @@ header > div { padding: 1em 0; } +a { + color: #da1e2c; +} + .menu a { margin: 0.6em; padding: 0 1.5em; @@ -75,14 +85,131 @@ header > div { header { height: 200px; } + .menu { display: none; } + .navbar { + width: 100%; + box-shadow: 0 1px 4px rgb(146 161 176 / 15%); + } + + .nav-container { + max-width: 1050px; + width: 100%; + margin: auto; + display: flex; + justify-content: space-between; + align-items: center; + height: 62px; + } + + .navbar .menu-items { + display: flex; + } + + .navbar .nav-container li { + list-style: none; + } + + .menu-entry { + padding-bottom: 1.5em; + } + + .menu-entry a { + text-decoration: none; + color: #0e2431; + font-weight: 700; + font-size: 1.5rem; + padding: 0.7rem; + } + + .nav-container { + display: block; + position: relative; + height: 60px; + } + + .nav-container .checkbox { + position: absolute; + display: block; + height: 32px; + width: 32px; + top: 20px; + left: 20px; + z-index: 5; + opacity: 0; + cursor: pointer; + } + + .nav-container .hamburger-lines { + display: block; + height: 26px; + width: 32px; + position: absolute; + top: 17px; + left: 20px; + z-index: 2; + display: flex; + flex-direction: column; + justify-content: space-between; + } + + .nav-container .hamburger-lines .line { + display: block; + height: 4px; + width: 100%; + border-radius: 10px; + background: #fff; + } + + .nav-container .hamburger-lines .line1 { + transform-origin: 0% 0%; + transition: transform 0.4s ease-in-out; + } + + .nav-container .hamburger-lines .line2 { + transition: transform 0.2s ease-in-out; + } + + .nav-container .hamburger-lines .line3 { + transform-origin: 0% 100%; + transition: transform 0.4s ease-in-out; + } + + .navbar .menu-items { + padding-top: 120px; + background-color: rgba(255, 255, 255, 0.9); + height: 100vh; + width: 100%; + transform: translate(-150%); + display: flex; + flex-direction: column; + transition: transform 0.5s ease-in-out; + text-align: center; + } + + .nav-container input[type="checkbox"]:checked ~ .menu-items { + transform: translateX(0); + } + + .nav-container input[type="checkbox"]:checked ~ .hamburger-lines .line1 { + transform: rotate(45deg); + } + + .nav-container input[type="checkbox"]:checked ~ .hamburger-lines .line2 { + transform: scaleY(0); + } + + .nav-container input[type="checkbox"]:checked ~ .hamburger-lines .line3 { + transform: rotate(-45deg); + } + #header-title { - font-size: 0.9em; + font-size: 0.8em; max-width: 310px; - margin-top: 0.7em; + margin-top: 0em; } } @@ -95,7 +222,6 @@ main { .concerts { display: grid; - /*overflow: hidden;*/ } .concert-entry-small { diff --git a/layouts/partials/menu.html b/layouts/partials/menu.html index 329c97b..8f0711c 100644 --- a/layouts/partials/menu.html +++ b/layouts/partials/menu.html @@ -16,6 +16,21 @@ {{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }} + {{- end }} {{- define "partials/inline/menu/walk.html" }} @@ -33,7 +48,7 @@ {{- $name = . }} {{- end }} {{- end }} -
  • +