weather: make the °C not look ass, move "feels like" to popup

This commit is contained in:
end-4
2025-08-22 20:54:15 +07:00
parent f56308b6e3
commit 4065142830
2 changed files with 34 additions and 19 deletions
+9 -5
View File
@@ -34,7 +34,8 @@ Singleton {
precip: 0,
visib: 0,
press: 0,
temp: 0
temp: 0,
tempFeelsLike: 0
})
function refineData(data) {
@@ -47,22 +48,25 @@ Singleton {
temp.wCode = data?.current?.weatherCode || "113";
temp.city = data?.location?.areaName[0]?.value || "City";
temp.temp = "";
temp.tempFeelsLike = "";
if (root.useUSCS) {
temp.wind = (data?.current?.windspeedMiles || 0) + " mph";
temp.precip = (data?.current?.precipInches || 0) + " in";
temp.visib = (data?.current?.visibilityMiles || 0) + " m";
temp.press = (data?.current?.pressureInches || 0) + " psi";
temp.temp += (data?.current?.temp_F || 0);
temp.temp += " (" + (data?.current?.FeelsLikeF || 0) + ") ";
temp.temp += "\u{02109}";
temp.tempFeelsLike += (data?.current?.FeelsLikeF || 0);
temp.temp += "°F";
temp.tempFeelsLike += "°F";
} else {
temp.wind = (data?.current?.windspeedKmph || 0) + " km/h";
temp.precip = (data?.current?.precipMM || 0) + " mm";
temp.visib = (data?.current?.visibility || 0) + " km";
temp.press = (data?.current?.pressure || 0) + " hPa";
temp.temp += (data?.current?.temp_C || 0);
temp.temp += " (" + (data?.current?.FeelsLikeC || 0) + ") ";
temp.temp += "\u{02103}";
temp.tempFeelsLike += (data?.current?.FeelsLikeC || 0);
temp.temp += "°C";
temp.tempFeelsLike += "°C";
}
root.data = temp;
}