This commit is contained in:
2025-12-17 13:33:31 -05:00
parent e18aa3f42c
commit c49bfe5a3d
38 changed files with 2436 additions and 436 deletions

View File

@@ -5,6 +5,15 @@
window.toggleTheme = () => {
const currentTheme = document.documentElement.getAttribute("data-theme");
const newTheme = currentTheme === "dark" ? "light" : "dark";
// Toggle the dark class for Tailwind
if (newTheme === "dark") {
document.documentElement.classList.add("dark");
} else {
document.documentElement.classList.remove("dark");
}
// Dispatch event for astro-themes and other listeners
document.dispatchEvent(new CustomEvent("set-theme", { detail: newTheme }));
};
@@ -80,5 +89,7 @@
ready();
}
// Support both original and obfuscated event names
document.addEventListener("astro:page-load", initMobileMenu);
document.addEventListener("c:ready", initMobileMenu);
})();