diff --git a/src/lib/components/app/bg-dropdown.svelte b/src/lib/components/app/bg-dropdown.svelte index 86d4e3f..618840d 100644 --- a/src/lib/components/app/bg-dropdown.svelte +++ b/src/lib/components/app/bg-dropdown.svelte @@ -8,7 +8,7 @@ $effect(() => { appState.currentBackgroundId = selectedBackgroundId; window.localStorage.setItem('backgroundId', selectedBackgroundId); - console.log('Background changed to:', selectedBackgroundId); + console.log('background changed to:', selectedBackgroundId); }) diff --git a/src/lib/components/app/bg-image.svelte b/src/lib/components/app/bg-image.svelte index da5519c..5d45818 100644 --- a/src/lib/components/app/bg-image.svelte +++ b/src/lib/components/app/bg-image.svelte @@ -5,7 +5,7 @@ $effect(() => { if (video) { - (appState as any).backgroundElement = video; + appState.backgroundElement = video; } }); diff --git a/src/lib/components/app/daemon.svelte b/src/lib/components/app/daemon.svelte index d9d734f..3d194cb 100644 --- a/src/lib/components/app/daemon.svelte +++ b/src/lib/components/app/daemon.svelte @@ -14,9 +14,9 @@ if (appState.backgroundElement) { if (play) { - (appState.backgroundElement as HTMLVideoElement).play().catch(e => console.error('Error playing background video:', e)); + appState.backgroundElement.play().catch(e => console.error('Error playing background video:', e)); } else { - (appState.backgroundElement as HTMLVideoElement).pause(); + appState.backgroundElement.pause(); } } @@ -107,22 +107,22 @@ } if (data.stations.length > 0) { - const storedStationId = window.localStorage.getItem('StationId'); + const storedStationId = window.localStorage.getItem('stationId'); if (storedStationId && data.stations.some(station => station.id.toString() === storedStationId)) { - appState.currentStation = parseInt(storedStationId, 10); + appState.currentStation = parseInt(storedStationId, 10); } else { - appState.currentStation = data.stations[0].id; + appState.currentStation = data.stations[0].id; } - console.log('Current station ID:', appState.currentStation); + console.log('current station ID:', appState.currentStation); } if (appState.backgrounds.length > 0) { const storedBackgroundId = window.localStorage.getItem('backgroundId'); if (storedBackgroundId && appState.backgrounds.some(bg => bg.id === storedBackgroundId)) { - appState.currentBackgroundId = storedBackgroundId; + appState.currentBackgroundId = storedBackgroundId; } else { - appState.currentBackgroundId = appState.backgrounds[0].id; + appState.currentBackgroundId = appState.backgrounds[0].id; } - console.log('Current background ID:', appState.currentBackgroundId); + console.log('current background ID:', appState.currentBackgroundId); } else { appState.error = 'Failed to load initial data (empty response).'; } diff --git a/src/lib/components/app/station-dropdown.svelte b/src/lib/components/app/station-dropdown.svelte index af4c116..ce7ef8c 100644 --- a/src/lib/components/app/station-dropdown.svelte +++ b/src/lib/components/app/station-dropdown.svelte @@ -8,7 +8,7 @@ $effect(() => { if (selectedStationId) { appState.currentStation = parseInt(selectedStationId); - window.localStorage.setItem('StationId', selectedStationId); + window.localStorage.setItem('stationId', selectedStationId); console.log('Station changed to:', selectedStationId); } }); diff --git a/src/lib/state.svelte.ts b/src/lib/state.svelte.ts index 8b1920d..e64a9ac 100644 --- a/src/lib/state.svelte.ts +++ b/src/lib/state.svelte.ts @@ -9,7 +9,7 @@ export const state = $state({ volume: 0.5, isMuted: false, currentBackgroundId: null as string | null, - backgroundElement: null, + backgroundElement: null as HTMLVideoElement | null, activeAtmospheres: {} as Record, // { atmosphereId: volume (0-100) } isLoading: true, error: null as string | null,