npm run format

This commit is contained in:
2024-11-05 23:16:47 +01:00
parent d71f4e7b59
commit 1384f50406
3 changed files with 8 additions and 19 deletions

View File

@ -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')
})
</script>
</script>