diff --git a/src/components/common/BasicScripts.astro b/src/components/common/BasicScripts.astro index 8b77eb4..d86d9a8 100644 --- a/src/components/common/BasicScripts.astro +++ b/src/components/common/BasicScripts.astro @@ -35,7 +35,17 @@ import { UI_CONFIG } from '~/utils/config'; let lastKnownScrollPosition = window.scrollY; let ticking = true; - attachEvent('[data-aw-toggle-menu], #header nav', 'click', function () { + attachEvent('#header nav', 'click', function () { + document.querySelector("[data-aw-toggle-menu]")?.classList.remove("expanded"); + document.body.classList.remove("overflow-hidden"); + document.getElementById("header")?.classList.remove("h-screen"); + document.getElementById("header")?.classList.remove("expanded"); + document.getElementById("header")?.classList.remove("bg-page"); + document.querySelector("#header nav")?.classList.add("hidden"); + document.querySelector("#header > div > div:last-child")?.classList.add("hidden"); + }); + + attachEvent('[data-aw-toggle-menu]', 'click', function () { document.body.classList.toggle("overflow-hidden"); document.getElementById("header")?.classList.toggle("h-screen"); document.getElementById("header")?.classList.toggle("expanded");