diff --git a/assets/css/table.css b/assets/css/table.css index 2871146..d03bdfb 100644 --- a/assets/css/table.css +++ b/assets/css/table.css @@ -701,6 +701,10 @@ letter-spacing: 0.06em; } +/* Faint vertical divider before each new column group in the forecast table. */ +.utci-table .col-group-start { + border-left: 2px solid rgba(74, 50, 24, 0.18); +} /* ── FILTER PROFILES + COLUMN TOGGLES — mobile fixes ───────────────── */ @media (max-width: 640px) { diff --git a/assets/js/app.js b/assets/js/app.js index fbcfcbc..42be618 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -80,6 +80,35 @@ export function UTCIForecast() { bannerVisible, bannerStageRef, bannerSlideTo, dismissBanner, } = useAppState(); + + // Columns that mark the start of a logical group - used to draw a faint + // vertical border separating groups in the forecast table. + const GROUP_ORDER = { + solar: ['sun', 'direct', 'diffuse', 'uvA', 'uvB', 'burn'], + sky: ['cloud', 'vis', 'aqi', 'pollen'], + wind: ['wind', 'dir'], + ambient: ['air', 'rh', 'dew'], + felt: ['tmrt', 'utci', 'delta', 'utciP'], + surface: ['concreteT', 'vehicleT', 'indoorT', 'managedT', 'soilT', 'soilT6', 'soilM'], + precip: ['precip'], + }; + const GROUP_OF = Object.fromEntries( + Object.entries(GROUP_ORDER).flatMap(([g, keys]) => keys.map(k => [k, g])) + ); + // Returns col-group-start when this column is the leftmost VISIBLE member + // of its group. If the canonical first member is hidden the border migrates + // to the next visible column in the same group. + const isColVisible = (k) => { + if (k === 'indoorT') return indoorMode === 'on' && !indoorManaged; + if (k === 'managedT') return indoorMode === 'on' && indoorManaged; + return !!visibleCols[k]; + }; + const groupStart = (key) => { + const group = GROUP_OF[key]; + if (!group) return ''; + const first = GROUP_ORDER[group].find(isColVisible); + return first === key ? 'col-group-start' : ''; + }; // ─── 4. JSX RETURN ─────────────────────────────────────────────────── // Everything below is the actual page markup, written as one big HTM @@ -422,34 +451,34 @@ ${isPro && (activeProfile === 'custom' || activeCols['air']) && html`