feat: bg presets in settings, shuffle playlists, remove theme from ExtraTab
- Add 4 live background modes: Орбы, Волны, Частицы, Аврора + Нет - Settings page shows visual preview cards for each bg mode (persisted) - Add shuffle button (⇄) to PlaylistCard and FavoritesCard - Remove accent color picker from ExtraTab (settings page only) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
38
apps/web/src/store/bgStore.ts
Normal file
38
apps/web/src/store/bgStore.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
'use client'
|
||||
|
||||
import { create } from 'zustand'
|
||||
|
||||
export type BgMode = 'orbs' | 'waves' | 'particles' | 'aurora' | 'none'
|
||||
|
||||
export interface BgPreset {
|
||||
id: BgMode
|
||||
name: string
|
||||
desc: string
|
||||
}
|
||||
|
||||
export const BG_PRESETS: BgPreset[] = [
|
||||
{ id: 'orbs', name: 'Орбы', desc: 'Мягкие цветовые пятна' },
|
||||
{ id: 'waves', name: 'Волны', desc: 'Звуковые волны снизу' },
|
||||
{ id: 'particles', name: 'Частицы', desc: 'Плавающая сеть точек' },
|
||||
{ id: 'aurora', name: 'Аврора', desc: 'Северное сияние' },
|
||||
{ id: 'none', name: 'Нет', desc: 'Чистый фон' },
|
||||
]
|
||||
|
||||
const KEY = 'pm_bg'
|
||||
|
||||
interface BgStore {
|
||||
bgMode: BgMode
|
||||
setBg: (mode: BgMode) => void
|
||||
}
|
||||
|
||||
export const useBgStore = create<BgStore>((set) => ({
|
||||
bgMode: (() => {
|
||||
if (typeof window === 'undefined') return 'orbs'
|
||||
const saved = localStorage.getItem(KEY) as BgMode | null
|
||||
return saved && BG_PRESETS.some(p => p.id === saved) ? saved : 'orbs'
|
||||
})(),
|
||||
setBg: (mode) => {
|
||||
if (typeof window !== 'undefined') localStorage.setItem(KEY, mode)
|
||||
set({ bgMode: mode })
|
||||
},
|
||||
}))
|
||||
Reference in New Issue
Block a user