diff options
| -rw-r--r-- | src/partials/Header.astro | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/partials/Header.astro b/src/partials/Header.astro index e4e55d7..5f3c0e6 100644 --- a/src/partials/Header.astro +++ b/src/partials/Header.astro @@ -269,3 +269,12 @@ import Favicon from "../assets/Favicon.astro"; } } </style> + +<script> + const mobileMenuButton = document.getElementById("mobile-menu") as HTMLButtonElement; + const headerElement = document.querySelector("header") as HTMLElement; + + mobileMenuButton.addEventListener("click", () => { + headerElement.classList.toggle("collapsed"); + }); +</script>
\ No newline at end of file |
