diff --git a/index.html b/index.html index 2be2e94..17a7233 100644 --- a/index.html +++ b/index.html @@ -5,6 +5,26 @@ GIT GUD GET ROFLBOX + +
diff --git a/src/App.tsx b/src/App.tsx index 7bc36d8..5650053 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -3,6 +3,7 @@ import { Button } from '@/components/ui/button' import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card' import { BackgroundSwitcher } from '@/components/BackgroundSwitcher' import { BG_THEMES, DEFAULT_THEME_ID, type BgTheme } from '@/lib/themes' +import { useColorMode } from '@/lib/colorMode' import { TutorialProvider } from '@/components/TutorialProvider' import { TutorialOverlay } from '@/components/TutorialOverlay' import { useTutorial } from '@/lib/tutorial' @@ -29,6 +30,9 @@ function App() { const [matrixText, setMatrixText] = useState('INITIALIZING...') const [chaosMode, setChaosMode] = useState(false) + // Color mode state – persisted in localStorage under 'roflbox.colorMode' + const { preference: colorModePreference, resolvedMode: resolvedColorMode, setColorMode } = useColorMode() + // Background theme state – persisted in localStorage const [currentTheme, setCurrentTheme] = useState(() => { const saved = localStorage.getItem(STORAGE_KEY) @@ -102,8 +106,14 @@ function App() { className={`min-h-screen flex flex-col items-center justify-start p-4 relative ${chaosClass('perspective-crazy')}`} style={{ overflow: 'visible', background: currentTheme.value }} > - {/* Background theme switcher */} - + {/* Background theme + dark mode switcher */} + {/* FLOATING CHAOS - ABSOLUTE POSITIONED MADNESS - Only in chaos mode */} {chaosMode && ( diff --git a/src/components/BackgroundSwitcher.tsx b/src/components/BackgroundSwitcher.tsx index b1b08e3..48fe226 100644 --- a/src/components/BackgroundSwitcher.tsx +++ b/src/components/BackgroundSwitcher.tsx @@ -2,13 +2,23 @@ import { useState } from 'react' import { Button } from '@/components/ui/button' import { BG_THEMES, type BgTheme } from '@/lib/themes' import { useTutorial } from '@/lib/tutorial' +import { type ColorModePreference, type ColorMode } from '@/lib/colorMode' interface BackgroundSwitcherProps { currentThemeId: string onThemeChange: (theme: BgTheme) => void + colorModePreference: ColorModePreference + resolvedColorMode: ColorMode + onColorModeChange: (pref: ColorModePreference) => void } -export function BackgroundSwitcher({ currentThemeId, onThemeChange }: BackgroundSwitcherProps) { +export function BackgroundSwitcher({ + currentThemeId, + onThemeChange, + colorModePreference, + resolvedColorMode, + onColorModeChange, +}: BackgroundSwitcherProps) { const [open, setOpen] = useState(false) const { start: startTutorial, completed: tutorialCompleted } = useTutorial() @@ -62,6 +72,43 @@ export function BackgroundSwitcher({ currentThemeId, onThemeChange }: Background ))} + + {/* Color mode selector */} +
+
COLOR MODE:
+
+ {(['system', 'light', 'dark'] as const).map((pref) => { + const labels = { system: 'System', light: 'Light', dark: 'Dark' } + const isSelected = colorModePreference === pref + return ( + + ) + })} +
+ {colorModePreference === 'system' && ( +
+ effective: {resolvedColorMode} +
+ )} +
+