diff --git a/src/app.css b/src/app.css index 9f6892e81..f32b4a183 100644 --- a/src/app.css +++ b/src/app.css @@ -1154,6 +1154,63 @@ --alpha-95: rgba(255, 255, 255, 0.95); } +/* Kurosaki Theme (Light - inspired by Ichigo's inner world) */ +[data-theme="kurosaki"] { + /* Backgrounds */ + --bg-primary: #fbf9f2; + --bg-secondary: #f3f0e8; + --bg-tertiary: #e8e2d4; + --bg-hover: #e1dac8; + + /* Text */ + --text-primary: #262424; + --text-secondary: #544d48; + --text-muted: #827d78; + --text-disabled: #b3ada7; + + /* Accent and buttons */ + --accent-primary: #d5be58; + --accent-hover: #e8ce66; + --accent-active: #b49f45; + --btn-primary-text: #fbf9f2; + + /* Status colours */ + --danger: #c0392b; + --danger-bg: rgba(192, 57, 43, 0.1); + --danger-border: rgba(192, 57, 43, 0.3); + --danger-hover: rgba(192, 57, 43, 0.2); + --warning: #d89b1c; + --warning-bg: rgba(216, 155, 28, 0.1); + --warning-border: rgba(216, 155, 28, 0.3); + --warning-hover: rgba(216, 155, 28, 0.2); + + /* Borders */ + --border-subtle: #e4dcb4; + --border-strong: #d1c7aa; + + /* Alpha tokens (black-based for light theme) */ + --alpha-4: rgba(0, 0, 0, 0.04); + --alpha-5: rgba(0, 0, 0, 0.05); + --alpha-6: rgba(0, 0, 0, 0.06); + --alpha-8: rgba(0, 0, 0, 0.08); + --alpha-10: rgba(0, 0, 0, 0.1); + --alpha-15: rgba(0, 0, 0, 0.15); + --alpha-18: rgba(0, 0, 0, 0.18); + --alpha-20: rgba(0, 0, 0, 0.2); + --alpha-25: rgba(0, 0, 0, 0.25); + --alpha-30: rgba(0, 0, 0, 0.3); + --alpha-35: rgba(0, 0, 0, 0.35); + --alpha-40: rgba(0, 0, 0, 0.4); + --alpha-45: rgba(0, 0, 0, 0.45); + --alpha-50: rgba(0, 0, 0, 0.5); + --alpha-60: rgba(0, 0, 0, 0.6); + --alpha-70: rgba(0, 0, 0, 0.7); + --alpha-80: rgba(0, 0, 0, 0.8); + --alpha-85: rgba(0, 0, 0, 0.85); + --alpha-90: rgba(0, 0, 0, 0.9); + --alpha-95: rgba(0, 0, 0, 0.95); +} + * { margin: 0; padding: 0; diff --git a/src/lib/components/views/SettingsView.svelte b/src/lib/components/views/SettingsView.svelte index 56230e9a9..c27c46185 100644 --- a/src/lib/components/views/SettingsView.svelte +++ b/src/lib/components/views/SettingsView.svelte @@ -4,7 +4,7 @@ import ViewTransition from '../ViewTransition.svelte'; import { getCurrentWebview } from '@tauri-apps/api/webview'; import { writeText as copyToClipboard } from '@tauri-apps/plugin-clipboard-manager'; - import { ArrowLeft, ChevronRight, Loader2 } from 'lucide-svelte'; + import { ArrowLeft, ChevronRight, ChevronDown, ChevronUp, Loader2, Sun, Moon, SunMoon } from 'lucide-svelte'; import Toggle from '../Toggle.svelte'; import Dropdown from '../Dropdown.svelte'; import VolumeSlider from '../VolumeSlider.svelte'; @@ -173,25 +173,29 @@ let flatpakSection: HTMLElement; let activeSection = $state('audio'); - // Base navigation sections (always present) - const baseNavSectionDefs = [ - { id: 'audio', label: 'Audio' }, - { id: 'playback', label: 'Playback' }, - { id: 'offline', label: 'Offline' }, - { id: 'appearance', label: 'Appearance' }, - { id: 'downloads', label: 'Offline Library' }, - { id: 'library', label: 'Library' }, - { id: 'integrations', label: 'Integrations' }, - { id: 'updates', label: 'Updates' }, - { id: 'storage', label: 'Storage' }, + // Collapsible sections state (closed by default) + let offlineLibraryCollapsed = $state(true); + let storageCollapsed = $state(true); + + // Navigation section IDs with translation keys + const navSectionIds = [ + { id: 'audio', labelKey: 'settings.audio.title' }, + { id: 'playback', labelKey: 'settings.playback.title' }, + { id: 'offline', labelKey: 'offline.title' }, + { id: 'appearance', labelKey: 'settings.appearance.title' }, + { id: 'downloads', labelKey: 'settings.offlineLibrary.title' }, + { id: 'library', labelKey: 'settings.library.title' }, + { id: 'integrations', labelKey: 'settings.integrations.title' }, + { id: 'updates', labelKey: 'nav.updates' }, + { id: 'storage', labelKey: 'settings.storage.title' }, ]; // Navigation section definitions (dynamic: includes Flatpak only when running in Flatpak) // NOTE: If adding new sections, add them BEFORE Flatpak. Flatpak must always be last. const navSectionDefs = $derived( isFlatpak - ? [...baseNavSectionDefs, { id: 'flatpak', label: 'Flatpak' }] - : baseNavSectionDefs + ? [...navSectionIds, { id: 'flatpak', labelKey: 'nav.flatpak' }] + : navSectionIds ); // Get section element by id (resolved at call time, not definition time) @@ -288,62 +292,71 @@ // Options for dropdown - use PipeWire descriptions directly (already friendly names) let audioDeviceOptions = $derived(['System Default', ...pipewireSinks.map(s => s.description)]); - // Theme mapping: display name -> data-theme value - const themeMap: Record = { - 'Dark': '', - 'Light': 'light', - 'OLED Black': 'oled', - 'Rumi': 'rumi', - 'Zoey': 'zoey', - 'Mira': 'mira', - 'Warm': 'warm', - 'Nord': 'nord', - 'Dracula': 'dracula', - 'Tokyo Night': 'tokyo-night', - 'Catppuccin Mocha': 'catppuccin-mocha', - 'Rose Pine Dawn': 'rose-pine-dawn', - 'Breeze Dark': 'breeze-dark', - 'Breeze Light': 'breeze-light', - 'Adwaita Dark': 'adwaita-dark', - 'Adwaita Light': 'adwaita-light', - 'Duotone Snow': 'duotone-snow', - 'Alucard': 'alucard', - 'Snow Storm': 'snow-storm', - 'Frost': 'frost', - 'Aurora': 'aurora', - 'Ikari': 'ikari', - 'Langley': 'langley', - 'Ayanami': 'ayanami', - 'Iscariot': 'iscariot' + // Theme metadata with type classification + type ThemeType = 'dark' | 'light'; + interface ThemeInfo { + value: string; // data-theme value + type: ThemeType; // dark or light + } + + const themes: Record = { + // Dark themes + 'Dark': { value: '', type: 'dark' }, + 'OLED Black': { value: 'oled', type: 'dark' }, + 'Warm': { value: 'warm', type: 'dark' }, + 'Nord': { value: 'nord', type: 'dark' }, + 'Dracula': { value: 'dracula', type: 'dark' }, + 'Tokyo Night': { value: 'tokyo-night', type: 'dark' }, + 'Catppuccin Mocha': { value: 'catppuccin-mocha', type: 'dark' }, + 'Breeze Dark': { value: 'breeze-dark', type: 'dark' }, + 'Adwaita Dark': { value: 'adwaita-dark', type: 'dark' }, + 'Alucard': { value: 'alucard', type: 'light' }, + 'Aurora': { value: 'aurora', type: 'dark' }, + 'Ikari': { value: 'ikari', type: 'dark' }, + 'Ayanami': { value: 'ayanami', type: 'dark' }, + 'Iscariot': { value: 'iscariot', type: 'dark' }, + 'Rumi': { value: 'rumi', type: 'dark' }, + 'Zoey': { value: 'zoey', type: 'dark' }, + 'Mira': { value: 'mira', type: 'dark' }, + // Light themes + 'Light': { value: 'light', type: 'light' }, + 'Rose Pine Dawn': { value: 'rose-pine-dawn', type: 'light' }, + 'Breeze Light': { value: 'breeze-light', type: 'light' }, + 'Adwaita Light': { value: 'adwaita-light', type: 'light' }, + 'Duotone Snow': { value: 'duotone-snow', type: 'light' }, + 'Snow Storm': { value: 'snow-storm', type: 'light' }, + 'Frost': { value: 'frost', type: 'light' }, + 'Langley': { value: 'langley', type: 'light' }, + 'Kurosaki': { value: 'kurosaki', type: 'light' }, }; - const themeReverseMap: Record = { - '': 'Dark', - 'light': 'Light', - 'oled': 'OLED Black', - 'rumi': 'Rumi', - 'zoey': 'Zoey', - 'mira': 'Mira', - 'warm': 'Warm', - 'nord': 'Nord', - 'dracula': 'Dracula', - 'tokyo-night': 'Tokyo Night', - 'catppuccin-mocha': 'Catppuccin Mocha', - 'rose-pine-dawn': 'Rose Pine Dawn', - 'breeze-dark': 'Breeze Dark', - 'breeze-light': 'Breeze Light', - 'adwaita-dark': 'Adwaita Dark', - 'adwaita-light': 'Adwaita Light', - 'duotone-snow': 'Duotone Snow', - 'alucard': 'Alucard', - 'snow-storm': 'Snow Storm', - 'frost': 'Frost', - 'aurora': 'Aurora', - 'ikari': 'Ikari', - 'langley': 'Langley', - 'ayanami': 'Ayanami', - 'iscariot': 'Iscariot' - }; + // Generate maps from themes object for compatibility + const themeMap: Record = Object.fromEntries( + Object.entries(themes).map(([name, info]) => [name, info.value]) + ); + + const themeReverseMap: Record = Object.fromEntries( + Object.entries(themes).map(([name, info]) => [info.value, name]) + ); + + // Theme filter state: 'all' | 'dark' | 'light' + type ThemeFilter = 'all' | 'dark' | 'light'; + let themeFilter = $state('all'); + + // Filtered theme options based on current filter + const filteredThemeOptions = $derived( + themeFilter === 'all' + ? Object.keys(themes) + : Object.entries(themes) + .filter(([_, info]) => info.type === themeFilter) + .map(([name]) => name) + ); + + function cycleThemeFilter() { + if (themeFilter === 'all') themeFilter = 'dark'; + else if (themeFilter === 'dark') themeFilter = 'light'; + else themeFilter = 'all'; + } // Language mapping: display name -> locale code const languageToLocale: Record = { @@ -1806,24 +1819,18 @@

{$t('settings.title')}

- -
-

{$t('settings.account.title')}

-