diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro
index 81c216d..38ea84c 100644
--- a/src/layouts/BaseLayout.astro
+++ b/src/layouts/BaseLayout.astro
@@ -6,11 +6,8 @@ const currentPath = Astro.url.pathname;
const navItems = [
{ href: '/', label: 'Home' },
{ href: '/about/', label: 'About' },
- { href: '/demonstrations/', label: 'Demonstrations' },
{ href: '/downloads/', label: 'Downloads' },
{ href: '/docs/', label: 'Docs' },
- { href: '/search/', label: 'Search' },
- { href: '/community/', label: 'Community' },
{ href: '/faq/', label: 'FAQ' },
];
---
@@ -49,11 +46,27 @@ const navItems = [
}
@@ -68,12 +81,25 @@ const navItems = [
@@ -83,7 +109,7 @@ const navItems = [
const html = document.documentElement;
const sunIcon = document.getElementById('sun-icon');
const moonIcon = document.getElementById('moon-icon');
-
+
function updateIcons() {
if (html.classList.contains('dark')) {
sunIcon.style.display = 'block';
@@ -93,21 +119,24 @@ const navItems = [
moonIcon.style.display = 'block';
}
}
-
+
function toggleTheme() {
html.classList.toggle('dark');
localStorage.setItem('theme', html.classList.contains('dark') ? 'dark' : 'light');
updateIcons();
}
-
+
// Initialize theme from localStorage or system preference
- if (localStorage.getItem('theme') === 'dark' ||
- (!localStorage.getItem('theme') && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
+ if (
+ localStorage.getItem('theme') === 'dark' ||
+ (!localStorage.getItem('theme') &&
+ window.matchMedia('(prefers-color-scheme: dark)').matches)
+ ) {
html.classList.add('dark');
}
-
+
updateIcons();
-
+
themeToggle.addEventListener('click', toggleTheme);