summaryrefslogtreecommitdiffstats
path: root/themes/danix-xyz-hacker/layouts/partials
diff options
context:
space:
mode:
Diffstat (limited to 'themes/danix-xyz-hacker/layouts/partials')
-rw-r--r--themes/danix-xyz-hacker/layouts/partials/hamburger-menu.html15
1 files changed, 2 insertions, 13 deletions
diff --git a/themes/danix-xyz-hacker/layouts/partials/hamburger-menu.html b/themes/danix-xyz-hacker/layouts/partials/hamburger-menu.html
index 9ce3b75..4537fb0 100644
--- a/themes/danix-xyz-hacker/layouts/partials/hamburger-menu.html
+++ b/themes/danix-xyz-hacker/layouts/partials/hamburger-menu.html
@@ -54,7 +54,8 @@
<!-- Theme toggle -->
<div class="p-6 border-t border-border/30">
<button
- @click="toggleTheme(); closeMenu()"
+ id="theme-toggle"
+ @click="closeMenu()"
class="w-full py-3 px-4 bg-surface hover:bg-surface/80 rounded flex items-center justify-center gap-2 transition-colors"
>
<i data-feather="moon" class="w-4 h-4"></i>
@@ -87,22 +88,10 @@
Alpine.store('menu').close();
}
- function toggleTheme() {
- const html = document.documentElement;
- const isDark = html.classList.contains('theme-dark');
- const newTheme = isDark ? 'light' : 'dark';
- html.classList.remove('theme-light', 'theme-dark');
- html.classList.add('theme-' + newTheme);
- localStorage.setItem('theme', newTheme);
- feather.replace();
- }
-
document.getElementById('menu-toggle').addEventListener('click', () => {
Alpine.store('menu').toggle();
});
- document.getElementById('theme-toggle').addEventListener('click', toggleTheme);
-
// Close menu on Escape key
document.addEventListener('keydown', (e) => {
if (e.key === 'Escape') {