@@ -32,6 +32,13 @@ const MotionA = motion.a as React.FC<React.AnchorHTMLAttributes<HTMLAnchorElemen
3232 children ?: React . ReactNode ;
3333} > ;
3434
35+ const PALETTES = [
36+ { a1 : '#f472b6' , a2 : '#818cf8' , a3 : '#2dd4bf' } , // Cyberpunk
37+ { a1 : '#34d399' , a2 : '#60a5fa' , a3 : '#fbbf24' } , // Forest
38+ { a1 : '#a78bfa' , a2 : '#fb7185' , a3 : '#38bdf8' } , // Royal
39+ { a1 : '#fcd34d' , a2 : '#f87171' , a3 : '#c084fc' } , // Candy
40+ ] ;
41+
3542// Theme Toggle Component
3643const ThemeToggle = ( ) => {
3744 const [ isDark , setIsDark ] = useState ( ( ) => {
@@ -43,8 +50,21 @@ const ThemeToggle = () => {
4350 } ) ;
4451
4552 useEffect ( ( ) => {
46- document . documentElement . setAttribute ( 'data-theme' , isDark ? 'dark' : 'light' ) ;
53+ const root = document . documentElement ;
54+ root . setAttribute ( 'data-theme' , isDark ? 'dark' : 'light' ) ;
4755 localStorage . setItem ( 'theme' , isDark ? 'dark' : 'light' ) ;
56+
57+ if ( isDark ) {
58+ const palette = PALETTES [ Math . floor ( Math . random ( ) * PALETTES . length ) ] ;
59+ root . style . setProperty ( '--accent-1' , palette . a1 ) ;
60+ root . style . setProperty ( '--accent-2' , palette . a2 ) ;
61+ root . style . setProperty ( '--accent-3' , palette . a3 ) ;
62+ } else {
63+ // Reset to default neobrutalist bright colors in light mode
64+ root . style . removeProperty ( '--accent-1' ) ;
65+ root . style . removeProperty ( '--accent-2' ) ;
66+ root . style . removeProperty ( '--accent-3' ) ;
67+ }
4868 } , [ isDark ] ) ;
4969
5070 return (
0 commit comments