diff --git a/src/components/Effects.vue b/src/components/Effects.vue index 92c8ab0..f9993b7 100644 --- a/src/components/Effects.vue +++ b/src/components/Effects.vue @@ -102,13 +102,13 @@ const calculateLightStrength = (time: Date): number => { } // Sunrise transition (6 AM - 7 AM) else if (hour === SUNRISE_HOUR) { - strength = NIGHT_STRENGTH + ((DAY_STRENGTH - NIGHT_STRENGTH) * minute / 60) + strength = NIGHT_STRENGTH + ((DAY_STRENGTH - NIGHT_STRENGTH) * minute) / 60 } // Sunset transition (8 PM - 10 PM) else if (hour >= SUNSET_HOUR - 2 && hour < SUNSET_HOUR) { - const totalMinutes = ((hour - (SUNSET_HOUR - 2)) * 60) + minute + const totalMinutes = (hour - (SUNSET_HOUR - 2)) * 60 + minute const transitionProgress = totalMinutes / 120 // 2 hours = 120 minutes - strength = DAY_STRENGTH - ((DAY_STRENGTH - NIGHT_STRENGTH) * transitionProgress) + strength = DAY_STRENGTH - (DAY_STRENGTH - NIGHT_STRENGTH) * transitionProgress } return strength @@ -202,4 +202,4 @@ onBeforeUnmount(() => { if (sceneRef.value) sceneRef.value.scene.remove('effects') gameStore.connection?.off('weather') }) - \ No newline at end of file + diff --git a/src/components/utilities/BackgroundImageLoader.vue b/src/components/utilities/BackgroundImageLoader.vue index 51c8c05..2edbc3d 100644 --- a/src/components/utilities/BackgroundImageLoader.vue +++ b/src/components/utilities/BackgroundImageLoader.vue @@ -1,13 +1,6 @@ @@ -15,11 +8,7 @@ import { ref } from 'vue' // Internal array of images to preload -const imageUrls = ref([ - '/assets/ui-elements/ui-border-4-corners.svg', - '/assets/ui-elements/ui-border-4-corners-light.svg', - '/assets/ui-elements/ui-border-4-corners-small.svg' -]) +const imageUrls = ref(['/assets/ui-elements/ui-border-4-corners.svg', '/assets/ui-elements/ui-border-4-corners-light.svg', '/assets/ui-elements/ui-border-4-corners-small.svg']) const loadedImages = ref>(new Set()) @@ -31,4 +20,4 @@ const handleImageLoad = (index: number) => { const handleImageError = (index: number) => { console.log(`Image ${index} failed to load:`, imageUrls.value[index]) } - \ No newline at end of file + diff --git a/src/types.ts b/src/types.ts index 23b7892..1cfe5a9 100644 --- a/src/types.ts +++ b/src/types.ts @@ -230,4 +230,4 @@ export type WeatherState = { rainPercentage: number isFogEnabled: boolean fogDensity: number -} \ No newline at end of file +}