first commit

This commit is contained in:
Zakaria
2026-09-22 16:13:21 -04:00
commit 7e49be27f1
297 changed files with 63162 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
import {useEffect, useState} from 'react'
type Theme = 'dark' | 'light'
function getStored(): Theme {
const v = localStorage.getItem('floci-theme')
return v === 'light' ? 'light' : 'dark'
}
export function useTheme() {
const [theme, setTheme] = useState<Theme>(getStored)
useEffect(() => {
document.documentElement.setAttribute('data-theme', theme)
localStorage.setItem('floci-theme', theme)
}, [theme])
const toggle = () => setTheme(t => t === 'dark' ? 'light' : 'dark')
return {theme, toggle}
}