UI Overhaul
Profiles now in popup
Current profile always on screen
Hidden columns only when edit neeeded
Add pulldowns in to profile config
Customised the day tabs for vehicle, indoor and pet
This commit is contained in:
fraxle
2026-07-18 15:45:20 +01:00
parent f92e191a44
commit 916efca55e
13 changed files with 1594 additions and 610 deletions
+47 -14
View File
@@ -15,7 +15,7 @@
// VEHICLE_TYPES vehicle presets for cabin heat model
// BUILDING_TYPES building presets for indoor heat model
// FUR_COLORS fur presets for the fur surface temp model
// pawBurnRiskLabel(concreteT) - 'Safe'|'Caution'|'Danger' paw contact risk
// PET_BANDS / petCategory(t) pet skin/surface stress band - {label,bg,fg}
// cloudCategory(total,low,mid,high) - 'clear'|'wispy'|'scattered'|'overcast'
// confidenceBand(i) day-tab gradient colour + label
// moonPhaseFraction(date) 0..1 synodic phase fraction
@@ -56,6 +56,52 @@ export function utciCategory(u) {
}
}
// -------------------------------------------------------------------
// PET_BANDS - same shape as UTCI_BANDS, recalibrated for pet skin/fur
// instead of bare human skin.
// -------------------------------------------------------------------
// Covers the pet-specific columns (Fur Colour, Pet Shade, Pet Home, Paw)
// in the table and simple view. Fur, a thicker dermis, and natural skin
// oils give real extra insulation at both ends of the scale, so every
// threshold is shifted from UTCI_BANDS, not just the warm half:
// - Warm half shifted up - calibrated against the pavement-burn guidance
// this app already used ("7-second hand test": safe below 40 -C,
// caution to 52 -C, danger above) and the furSurfaceT glance-card
// alert (>=45 -C, which now falls inside "Extreme" rather than
// jumping straight to "Danger").
// - Cold half shifted down ~8 -C - a healthy cat or dog's coat copes
// with a frosty night (e.g. -2 -C) that would be "Freezing" on the
// bare-skin human scale; here that same reading lands in "Cold".
//
// Colours are re-interpolated (not copy-pasted from UTCI_BANDS) against
// the same purple->blue->cyan->green->yellow->orange->red family, sampled
// at each band's new threshold so the shade actually reflects its shifted
// position on the pet scale, rather than reusing a human band's colour at
// a different absolute temperature. Danger keeps the human scale's flat
// alarm red unchanged - it's a deliberate stop-everything colour, not
// part of the smooth gradient.
// -------------------------------------------------------------------
export const PET_BANDS = [
{ max: -28, label: 'Extreme cold', bg: '#7f61ab', fg: '#ffffff' },
{ max: -18, label: 'Arctic', bg: '#957abe', fg: '#ffffff' },
{ max: -8, label: 'Freezing', bg: '#84a0d4', fg: '#ffffff' },
{ max: -3, label: 'Very cold', bg: '#7eb6e2', fg: '#1a1200' },
{ max: 2, label: 'Cold', bg: '#7ec0e8', fg: '#1a1200' },
{ max: 7, label: 'Chilly', bg: '#a8d4ee', fg: '#1a1200' },
{ max: 11, label: 'Cool', bg: '#b5dee9', fg: '#1a1200' },
{ max: 25, label: 'Comfortable', bg: '#a5daa3', fg: '#157a15', themedFg: '#157a15', fontWeight: 700 },
{ max: 32, label: 'Warm', bg: '#f7cd54', fg: '#1a1200' },
{ max: 40, label: 'Caution', bg: '#f5974e', fg: '#1a1200' },
{ max: 52, label: 'Extreme', bg: '#df6f41', fg: '#ffffff' },
{ label: 'Danger', bg: '#880000', fg: '#ffffff', fontWeight: 700, darkenAmt: 0.18, textShadow: '-1px -1px 0 #3a0000, 1px -1px 0 #3a0000, -1px 1px 0 #3a0000, 1px 1px 0 #3a0000', solid: true },
];
export function petCategory(t) {
for (const band of PET_BANDS) {
if (band.max === undefined || t < band.max) return band;
}
}
// 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.
@@ -247,19 +293,6 @@ export const FUR_COLORS = {
white: { name: 'White / Pale', albedo: 0.40 },
};
// -------------------------------------------------------------------
// PAW BURN RISK - traffic-light label from ground/pavement surface temp.
// -------------------------------------------------------------------
// Uses concreteT directly - the "7-second hand test" pavement-burn
// guidance already documented on calcConcreteTemp in physics.js.
// -------------------------------------------------------------------
export function pawBurnRiskLabel(concreteT) {
if (concreteT == null) return null;
if (concreteT < 40) return 'Safe';
if (concreteT < 52) return 'Caution';
return 'Danger';
}
// -------------------------------------------------------------------
// CLOUD CATEGORY - pick one of 4 icon styles from low/mid/high split.
// -------------------------------------------------------------------