feat(frontend): add a terminal theme and three-way theme switcher

Adds the cyber theme to the console and login page, replaces the dark/light toggle with a theme switcher, and moves the login page script to /login.js so it is served under the existing CSP.
This commit is contained in:
Zakaria
2026-10-23 10:12:41 -04:00
parent 502d0b3986
commit ba90eff5db
8 changed files with 200 additions and 21 deletions
+3 -5
View File
@@ -1,10 +1,10 @@
import {useEffect, useState} from 'react'
type Theme = 'dark' | 'light'
export type Theme = 'dark' | 'light' | 'cyber'
function getStored(): Theme {
const v = localStorage.getItem('floci-theme')
return v === 'light' ? 'light' : 'dark'
return v === 'light' || v === 'cyber' ? v : 'dark'
}
export function useTheme() {
@@ -15,7 +15,5 @@ export function useTheme() {
localStorage.setItem('floci-theme', theme)
}, [theme])
const toggle = () => setTheme(t => t === 'dark' ? 'light' : 'dark')
return {theme, toggle}
return {theme, setTheme}
}