diff --git a/frontend/src/components/WeatherCard.vue b/frontend/src/components/WeatherCard.vue index e83f604..1793a35 100644 --- a/frontend/src/components/WeatherCard.vue +++ b/frontend/src/components/WeatherCard.vue @@ -25,6 +25,23 @@ const props = defineProps<{ tempUnit?: string }>() +function weatherIcon(condition: string): string { + const c = condition.toLowerCase() + if (c.includes('thunderstorm')) return '⛈️' + if (c.includes('hail')) return '🌨️' + if (c.includes('snow showers')) return '🌨️' + if (c.includes('snow')) return '❄️' + if (c.includes('rain showers: violent')) return '⛈️' + if (c.includes('rain showers')) return '🌦️' + if (c.includes('drizzle') || c.includes('rain')) return '🌧️' + if (c.includes('fog')) return '🌫️' + if (c.includes('overcast')) return '☁️' + if (c.includes('partly cloudy')) return '⛅' + if (c.includes('mainly clear')) return '🌤️' + if (c.includes('clear')) return '☀️' + return '🌡️' +} + const unit = computed(() => props.tempUnit ?? 'C') const tempDelta = computed(() => { @@ -56,6 +73,7 @@ const fetchedAtLabel = computed(() => { as of {{ fetchedAtLabel }}