1
0
forked from noxious/client

npm run format

This commit is contained in:
Dennis Postma 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

View File

@ -1,13 +1,6 @@
<template>
<div style="display: none">
<img
v-for="(url, index) in imageUrls"
:key="index"
:src="url"
alt=""
@load="handleImageLoad(index)"
@error="handleImageError(index)"
/>
<img v-for="(url, index) in imageUrls" :key="index" :src="url" alt="" @load="handleImageLoad(index)" @error="handleImageError(index)" />
</div>
</template>
@ -15,11 +8,7 @@
import { ref } from 'vue'
// Internal array of images to preload
const imageUrls = ref<string[]>([
'/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<string[]>(['/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<Set<number>>(new Set())