Outsource weather icons
This commit is contained in:
@ -6,7 +6,27 @@ import * as styles from "../styles/containers/WeatherAndTime.module.css";
|
||||
const WEATHER_REFRESH_INTERVAL = 15 * 60 * 1000;
|
||||
|
||||
function getWeatherIcon(icon: string) {
|
||||
const ImportedIcon = require(`../images/weather/${icon}.svg`);
|
||||
//const isNight = document.querySelector(':root[data-theme="night"]') !== null
|
||||
let weatherIcon: string;
|
||||
switch (icon) {
|
||||
case "clear-day":
|
||||
weatherIcon = "day-sunny"
|
||||
break
|
||||
case "clear-night":
|
||||
weatherIcon = "night-clear"
|
||||
break
|
||||
case "wind":
|
||||
weatherIcon = "windy"
|
||||
break
|
||||
case "partly-cloudy-day":
|
||||
weatherIcon = "day-cloudy"
|
||||
break
|
||||
case "partly-cloudy-night":
|
||||
weatherIcon = "night-cloudy"
|
||||
break;
|
||||
default: weatherIcon = icon
|
||||
}
|
||||
const ImportedIcon = require(`../images/weather-icons/svg/wi-${weatherIcon}.svg`);
|
||||
return <ImportedIcon />
|
||||
}
|
||||
|
||||
|
1
src/images/weather-icons
Submodule
1
src/images/weather-icons
Submodule
Submodule src/images/weather-icons added at bb80982bf1
@ -55,6 +55,7 @@
|
||||
}
|
||||
|
||||
#futureWeatherInfos th {
|
||||
width: 25%;
|
||||
text-align: center;
|
||||
font-size: 3vh;
|
||||
font-weight: bold;
|
||||
|
Reference in New Issue
Block a user