diff --git a/static/js/mobile-navbar.js b/static/js/mobile-navbar.js index c23faf3..f80b09e 100644 --- a/static/js/mobile-navbar.js +++ b/static/js/mobile-navbar.js @@ -1,19 +1,23 @@ const burger = document.querySelector(".hamburger") const links = document.querySelector(".links") const body = document.querySelector("body") +const main = document.querySelector("main") let shown = false burger.addEventListener("click", (e) => { e.preventDefault() + if (!shown) { links.style.display = "flex" body.classList.add("disable-scroll") burger.textContent = "x" + main.style.visibility = "hidden" } else { links.style.display = "none" body.classList.remove("disable-scroll") burger.textContent = "☰" + main.style.visibility = "visible" } shown = !shown