Added: burger menu for mobile views
All checks were successful
Build and Deploy Zola Website / build_and_deploy (push) Successful in 14s
Build Zola Website / build (pull_request) Successful in 21s

This commit is contained in:
2024-12-15 08:09:10 +01:00
parent 01c994aa13
commit c827757fb8
4 changed files with 62 additions and 0 deletions

View File

@ -0,0 +1,22 @@
const burger = document.querySelector(".hamburger")
const links = document.querySelector(".links")
const body = document.querySelector("body")
let shown = false
burger.addEventListener("click", (e) => {
e.preventDefault()
if (!shown) {
links.style.display = "flex"
body.classList.add("disable-scroll")
burger.textContent = "x"
} else {
links.style.display = "none"
body.classList.remove("disable-scroll")
burger.textContent = "☰"
}
shown = !shown
})