fix swap
This commit is contained in:
parent
84dde04352
commit
8ed037123c
@ -64,6 +64,7 @@ import { Menu } from "lucide-astro";
|
|||||||
const navMobile = document.getElementById("nav-mobile")!;
|
const navMobile = document.getElementById("nav-mobile")!;
|
||||||
const navButtons = navMobile.children;
|
const navButtons = navMobile.children;
|
||||||
|
|
||||||
|
const init = () => {
|
||||||
button.addEventListener("click", () => {
|
button.addEventListener("click", () => {
|
||||||
if (navMobile.classList.contains("hidden")) {
|
if (navMobile.classList.contains("hidden")) {
|
||||||
animate(
|
animate(
|
||||||
@ -86,4 +87,11 @@ import { Menu } from "lucide-astro";
|
|||||||
|
|
||||||
navMobile.classList.toggle("hidden");
|
navMobile.classList.toggle("hidden");
|
||||||
});
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
init();
|
||||||
|
|
||||||
|
document.addEventListener("astro:after-swap", () => {
|
||||||
|
init();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user