made mobile actually work :)
This commit is contained in:
moonmoon97 2024-02-08 12:59:09 +01:00 committed by GitHub
parent 8e3e083c63
commit b355b404ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 541 additions and 38 deletions

14
navigation.js Normal file
View file

@ -0,0 +1,14 @@
const nav = document.querySelector(".primary-navigation");
const navToggle = document.querySelector(".mobile-nav-toggle");
navToggle.addEventListener("click", () => {
const visiblity = nav.getAttribute("data-visible");
if (visiblity === "false") {
nav.setAttribute("data-visible", true);
navToggle.setAttribute("aria-expanded", true);
} else {
nav.setAttribute("data-visible", false);
navToggle.setAttribute("aria-expanded", false);
}
})