From b5b4d22fed7ddc19fce430184ff176ab543317db Mon Sep 17 00:00:00 2001 From: "Rich O." Date: Thu, 22 Oct 2026 22:04:37 -0400 Subject: [PATCH] Scene sky follows the daytime hours; bigger backpacks Open-Meteo's daily weather code reflects the worst hour, even after school (tomorrow: clear 7am-5pm, cloudy at 6pm -> daily code 3), so the scene and tomorrow's description said Cloudy. The sky now comes from the average cloudiness of the same 7am-6pm hours the outfit uses, and rain/snow/storm still take priority. Backpacks are drawn about a third of the kid's height, upright by their feet. --- dashboard/index.html | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/dashboard/index.html b/dashboard/index.html index 054a3a8..1e6dfe7 100644 --- a/dashboard/index.html +++ b/dashboard/index.html @@ -237,10 +237,12 @@ body.cold .cheek{opacity:.95} - - - - + + + + + + @@ -497,6 +499,11 @@ function summarize(d, dateStr, fromHour){ s.wet = !s.snowy && (s.rainProb >= 50 || s.precip >= 0.05); s.sunny = codes.filter(c => c <= 2).length >= codes.length / 2; s.foggy = codes.filter(c => c === 45 || c === 48).length >= 2; + // the day's sky = what most of the daytime hours look like (0 clear, 1 partly, 2 cloudy) + const cloudiness = codes.map(c => ({ sun: 0, partly: 1 })[kindOf(c)] ?? 2); + const avg = cloudiness.length ? sum(cloudiness) / cloudiness.length : 1; + s.sky = codes.filter(c => c === 45 || c === 48).length > codes.length / 2 ? "fog" + : avg < 0.5 ? "sun" : avg < 1.4 ? "partly" : "cloud"; return s; } @@ -652,7 +659,7 @@ function render(){ if (plan.o.backpack) plan.chips.push(["Backpack", "#2E7D5B"]); // the "scene" weather kind for the day - const dayKind = s.storm ? "storm" : s.snowy ? "snow" : s.wet ? "rain" : kindOf(D.weather_code[di]) === "rain" ? "cloud" : kindOf(D.weather_code[di]); + const dayKind = s.storm ? "storm" : s.snowy ? "snow" : s.wet ? "rain" : s.sky; dressKid(plan.o, dayKind, QS.get("season") || seasonOf(target), s); document.body.classList.toggle("cold", s.coldFeel < 40); @@ -672,7 +679,7 @@ function render(){ $("pill").textContent = tomorrow ? "High · " + fw : fw; $("pill").style.background = fc; let desc = DESC[bigCode] || ""; if (!isDay && bigCode <= 1) desc = "Clear night"; - if (tomorrow) desc = { storm: "Thunderstorms", snow: "Snowy", rain: "Rainy" }[dayKind] || DESC[D.weather_code[di]] || ""; + if (tomorrow) desc = { storm: "Thunderstorms", snow: "Snowy", rain: "Rainy", sun: "Sunny", partly: "Partly cloudy", cloud: "Cloudy", fog: "Foggy" }[dayKind]; $("desc").textContent = desc; $("hilo").innerHTML = `High ${r(D.temperature_2m_max[di])}°  Low ${r(D.temperature_2m_min[di])}°`;