feat: model comparison picto timeline

This commit is contained in:
terraputix
2026-02-16 11:46:53 +01:00
parent 84eefd538b
commit bed6e3aa53
5 changed files with 190 additions and 19 deletions
@@ -2,7 +2,7 @@
import { formatUtcOffset, formatZoned, getZonedHour, isSameDayInZone } from '$lib/utils/date';
import { getTempStyle } from '../../utils/colors';
import weatherCodes from '../../utils/weather-codes';
import { getWeatherIconName } from '../../utils/weather-codes';
import {
type FetchedDaily,
type FetchedHourly,
@@ -159,12 +159,6 @@
let sunsetPercent = $derived(
sunTimes && cellData.length > 0 ? timeToFraction(sunTimes.sunset) * 100 : null
);
function getWeatherIconName(code: number, daytime: boolean): string {
const prefix = daytime ? 'day' : 'night';
const name = weatherCodes[code as keyof typeof weatherCodes] ?? 'clear';
return `wi-${prefix}-${name}`;
}
</script>
{#snippet weatherIcon(name: string, size: number = 16)}