Chore: Port over SeriesDetail (WIP Panels)

This commit is contained in:
Youwes09
2026-05-28 23:05:02 -05:00
parent 584b917f98
commit 8c250021a0
53 changed files with 4570 additions and 885 deletions
+16 -16
View File
@@ -1,38 +1,38 @@
import type { Settings } from '$lib/types/settings'
import { DEFAULT_SETTINGS } from '$lib/types/settings'
import type { Settings } from "$lib/types/settings";
import { DEFAULT_SETTINGS } from "$lib/types/settings";
const KEY = 'moku_settings'
const KEY = "moku_settings";
function load(): Settings {
try {
const raw = localStorage.getItem(KEY)
if (raw) return { ...DEFAULT_SETTINGS, ...JSON.parse(raw) }
const raw = localStorage.getItem(KEY);
if (raw) return { ...DEFAULT_SETTINGS, ...JSON.parse(raw) };
} catch {}
return { ...DEFAULT_SETTINGS }
return { ...DEFAULT_SETTINGS };
}
function save(s: Settings) {
try { localStorage.setItem(KEY, JSON.stringify(s)) } catch {}
try { localStorage.setItem(KEY, JSON.stringify(s)); } catch {}
}
export const settingsState = $state({ settings: load() })
export const settingsState = $state({ settings: load() });
if (typeof document !== 'undefined') {
document.documentElement.style.zoom = String(settingsState.settings.uiZoom ?? 1.0)
if (typeof document !== "undefined") {
document.documentElement.style.zoom = String(settingsState.settings.uiZoom ?? 1.0);
}
export function updateSettings(patch: Partial<Settings>) {
Object.assign(settingsState.settings, patch)
save(settingsState.settings)
Object.assign(settingsState.settings, patch);
save(settingsState.settings);
if (typeof document !== 'undefined') {
if (typeof document !== "undefined") {
if (patch.uiZoom !== undefined) {
document.documentElement.style.zoom = String(patch.uiZoom)
document.documentElement.style.zoom = String(patch.uiZoom);
}
}
}
export function resetSettings() {
settingsState.settings = { ...DEFAULT_SETTINGS }
save(settingsState.settings)
settingsState.settings = { ...DEFAULT_SETTINGS };
save(settingsState.settings);
}