chore(site): rename website to site

This commit is contained in:
Darius Cepulis
2025-10-28 13:44:03 -05:00
parent 5dbaddc513
commit d1583dd47d
168 changed files with 22 additions and 22 deletions
+33
View File
@@ -0,0 +1,33 @@
---
import { THEME_KEY } from '@/consts';
---
{/* Dark mode initialization script - runs before paint to prevent FOUC */}
<script is:inline define:vars={{ localStorageKey: THEME_KEY }}>
if (
typeof localStorage !== 'undefined' &&
typeof document !== 'undefined' &&
typeof document.documentElement !== 'undefined'
) {
let localStorageValue = localStorage[localStorageKey];
const isValidKey = localStorageValue === 'light' || localStorageValue === 'dark' || localStorageValue === 'system';
if (!localStorageValue || !isValidKey) {
localStorage[localStorageKey] = 'system';
localStorageValue = 'system';
}
let isDark = false;
if (localStorageValue === 'dark') {
document.documentElement.classList.add('dark');
isDark = true;
} else if (localStorageValue === 'system') {
if (typeof window.matchMedia !== 'undefined' && window.matchMedia('(prefers-color-scheme: dark)').matches) {
document.documentElement.classList.add('dark');
isDark = true;
}
}
const themeColorMeta = document.querySelector('meta[name="theme-color"]');
if (themeColorMeta) {
themeColorMeta.setAttribute('content', isDark ? '#393836' : '#ebe4c1');
}
}
</script>