From 6fc97ef3ff673593df9fc3bd6a749fb6357a6f6d Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Tue, 20 Oct 2020 22:06:42 -0600 Subject: [PATCH] Improve readability of forecast --- www/assets/js/toolbox_weather.js | 9 +++++---- www/package-lock.json | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/www/assets/js/toolbox_weather.js b/www/assets/js/toolbox_weather.js index 95de1d7..68702f6 100644 --- a/www/assets/js/toolbox_weather.js +++ b/www/assets/js/toolbox_weather.js @@ -17,7 +17,7 @@ function loadWeather(reload) { } if (userPosition.coords.accuracy > 99999) { - app.dialog.alert("Couldn't find your location. Wait for a GPS signal and try again.", "Error"); + app.dialog.alert("Couldn't find your location. Wait a few seconds and press the reload button.", "Error"); return; } @@ -197,15 +197,16 @@ function loadWeather(reload) { var low = (getStorage("units") == "metric" ? Math.round(ftoc(resp.forecast[i].temp.min)) : Math.round(resp.forecast[i].temp.min)); var high = (getStorage("units") == "metric" ? Math.round(ftoc(resp.forecast[i].temp.max)) + " °C" : Math.round(resp.forecast[i].temp.max) + " °F"); var precipcolor = precipChanceToColor(resp.forecast[i].precipitation.chance); + var uvcolor = uvIndexToColor(resp.forecast[i].uv_index); forecastItems.push({ day: (i == 0 ? "Today" : formatTimestamp('l', resp.forecast[i].date)), temps: low + " to " + high, uv_index: resp.forecast[i].uv_index, - uv_color: uvIndexToColor(resp.forecast[i].uv_index), - uv_foreground: uvIndexToColor(resp.forecast[i].uv_index) == "yellow" ? "black" : "white", + uv_color: uvcolor, + uv_foreground: (uvcolor == "purple" ? "white" : "black"), precip_chance: Math.round(resp.forecast[i].precipitation.chance * 100), precip_color: precipcolor, - precip_foreground: precipcolor == "lightblue" ? "black" : "white" + precip_foreground: precipcolor == "blue" ? "white" : "black" }); } diff --git a/www/package-lock.json b/www/package-lock.json index 3a430dd..f7e51b6 100644 --- a/www/package-lock.json +++ b/www/package-lock.json @@ -1,6 +1,6 @@ { "name": "PackageHelper", - "version": "1.6.0", + "version": "1.6.1", "lockfileVersion": 1, "requires": true, "dependencies": {