mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-08 14:13:02 -04:00
also add freedom units to the other one
This commit is contained in:
parent
785b0c306c
commit
f99efdf813
1 changed files with 4 additions and 1 deletions
|
@ -24,7 +24,10 @@ function temperature(value, units){
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderWeatherCard(context, data, units){
|
function renderWeatherCard(context, data, units){
|
||||||
let description = `### ${weatherIcon(data.result.current.icon.id)} ${temperature(data.result.current.temperature.current, units)} • ${data.result.current.condition.label}\n\n${pill("Feels like")} ${smallPill(temperature(data.result.current.temperature.feels_like, units))} ${pill("Wind")} ${smallPill(data.result.current.wind.speed + " km/h")}`
|
let description = `### ${weatherIcon(data.result.current.icon.id)} ${temperature(data.result.current.temperature.current, units)} • ${data.result.current.condition.label}\n\n${pill("Feels like")} ${smallPill(temperature(data.result.current.temperature.feels_like, units))} ${pill("Wind")} `
|
||||||
|
|
||||||
|
if(units == "°F") description += smallPill((data.result.current.wind.speed / 1.609).toFixed(2) + " mph")
|
||||||
|
else description += smallPill((data.result.current.wind.speed).toFixed(2) + " km/h")
|
||||||
|
|
||||||
let secondaryPills = [];
|
let secondaryPills = [];
|
||||||
if(data.result.current.humidity > 0) secondaryPills.push(`${pill("Humidity")} ${smallPill(Math.floor(data.result.current.humidity * 100) + "%")}`)
|
if(data.result.current.humidity > 0) secondaryPills.push(`${pill("Humidity")} ${smallPill(Math.floor(data.result.current.humidity * 100) + "%")}`)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue