diff options
| author | Ariel Costas Guerrero <94913521+arielcostas@users.noreply.github.com> | 2024-05-04 13:38:29 +0200 |
|---|---|---|
| committer | Ariel Costas Guerrero <94913521+arielcostas@users.noreply.github.com> | 2024-05-04 13:38:29 +0200 |
| commit | 652db76a43e7882365f2aa3086e7007aa8d65f7e (patch) | |
| tree | 86dc080ce486417f2948af54f7f65c900ff4a115 | |
| parent | fe7c149811f2e20c055ad0375aff05d29491efb4 (diff) | |
Reimplement header toggle script
Closes #3
| -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 |
