Restructure
New Journal entries
Colour tabs update with wind
This commit is contained in:
fraxle
2026-08-31 15:12:45 +01:00
parent 47818fba33
commit 71860b9dd9
40 changed files with 3430 additions and 443 deletions
+55 -4
View File
@@ -113,10 +113,11 @@ export function bandRampRgb(t, bands) {
// this weather", shared by the day tabs (components/DayTabs.js) and the
// warning event banner (events/weather-checks.js + app.js).
// -------------------------------------------------------------------
// The day tabs pick ONE dimension by priority (heat -> snow -> rain ->
// cloud -> sun) and only vary its shade; these helpers are the shade
// ramps for the non-temperature dimensions. Temperature-driven tints
// come from utciCategory().bg / petCategory().bg instead.
// The day tabs start from a temperature colour (utciCategory().bg /
// petCategory().bg, ramped by bandRampRgb) and then shade it toward the
// sky by influence - rain/snow first, then cloud on days that will stay
// dry. These helpers are the shade ramps for those non-temperature
// dimensions; see the WEIGHTED model block in components/DayTabs.js.
// -------------------------------------------------------------------
export const hexToRgb = (hx) => {
const n = parseInt(hx.replace('#', ''), 16);
@@ -179,6 +180,56 @@ export function petCategory(t) {
}
}
// -------------------------------------------------------------------
// DAY-TAB BAND VARIANTS - the same bands, one colour swapped.
// -------------------------------------------------------------------
// In the table a cell answers "which stress band is this reading in", and
// green is the right answer for Comfortable: it is the safe band in a
// column of warnings. A day tab answers a different question - "what will
// this day feel like" - and there green reads as damp and mild rather
// than as the best day of the week. So on the tabs (and ONLY on the tabs)
// Comfortable becomes a deep gold: sitting just under Warm's brighter
// yellow, it puts the settled 19-24 -C days on the same warm run as the
// rest of the pleasant half of the scale instead of interrupting it with
// a green step.
//
// Everything else - labels, thresholds, fg colours, the solid Danger
// alarm - is shared with the table palettes above, so the two can never
// drift apart on anything but this one deliberate colour.
// -------------------------------------------------------------------
const DAY_TAB_COMFORTABLE = '#edd449'; // deep gold, one step under Warm's #f8e554
// The same reasoning, carried down the rest of the HUMAN scale.
//
// UTCI_BANDS runs cyan -> mint -> green -> gold across Cold, Chilly and Cool,
// so a tab crossing from the cold half of the scale to the warm half has to
// travel through green. That hurts twice over: the strip reads as a green
// interruption between the blues and the golds, and because cloud dulls a tab
// toward its own hue, every overcast mid-scale day desaturates into a sickly
// green-grey rather than into something neutral.
//
// On the tabs the scale therefore goes blue -> GREY -> gold, with the neutral
// point sitting exactly where a day has stopped being cold but has not yet
// become pleasant - which is what Chilly means. Nothing passes through green
// in either direction.
//
// Human only. The pet scale is already blue through the equivalent bands
// (pet Cool is #b5dee9, not a green), and its thresholds sit at completely
// different temperatures, so it keeps the Comfortable override alone.
const DAY_TAB_HUMAN = {
Comfortable: DAY_TAB_COMFORTABLE,
Cool: '#ded9c3', // warm oatmeal, one step under Comfortable's gold
Chilly: '#d3d5d2', // the neutral pivot between the warm and cold halves
Cold: '#c2d3dd', // first step back into blue
};
const withTabComfort = (bands) =>
bands.map(b => (b.label === 'Comfortable' ? { ...b, bg: DAY_TAB_COMFORTABLE } : b));
export const DAY_TAB_UTCI_BANDS =
UTCI_BANDS.map(b => (DAY_TAB_HUMAN[b.label] ? { ...b, bg: DAY_TAB_HUMAN[b.label] } : b));
export const DAY_TAB_PET_BANDS = withTabComfort(PET_BANDS);
// Diagonal sweep gradient for a band background hex colour.
// Pre-blends with 50% white to sit harmoniously alongside lighter table cells,
// then applies a light→mid→dark sweep for depth.