diff --git a/assets/css/header.css b/assets/css/header.css index ab28d57..846ecf1 100644 --- a/assets/css/header.css +++ b/assets/css/header.css @@ -83,6 +83,92 @@ display: block; } +.scope-col { + display: flex; + flex-direction: column; + align-items: center; + gap: 8px; +} + +.scope-env-row { + display: flex; + flex-direction: column; + align-items: center; + gap: 2px; + border-top: 1px solid #c9b08a; + width: 220px; /* match desktop/tablet dial width */ +} + +.scope-env-label { + font-family: Manrope, sans-serif; + font-size: 10px; + font-weight: 700; + text-transform: uppercase; + letter-spacing: 0.1em; + color: #b09870; +} + +.scope-env-row .cs-wrap, +.scope-env-row .cs-btn { + width: 100%; +} + +.scope-env-row .cs-btn { + justify-content: center; + position: relative; + isolation: isolate; + border-radius: 999px; + box-shadow: inset 0 1px 3px rgba(255,255,255,0.30), 0 2px 8px rgba(0,0,0,0.18); + transition: color 0.35s ease; +} + +.scope-env-row .cs-btn .cs-btn-overlay { + display: block; + position: absolute; + inset: 0; + border-radius: inherit; + background: #c8922a; + opacity: 0; + transition: opacity 0.35s ease; + pointer-events: none; + z-index: 0; +} + +.scope-env-row .cs-btn.on:hover .cs-btn-overlay { + opacity: 1; +} + +/* Label stays above the overlay */ +.scope-env-row .cs-btn .cs-btn-label { + position: relative; + z-index: 1; +} + +/* Arrow pinned right, above the overlay */ +.scope-env-row .cs-arrow { + position: absolute; + right: 12px; + z-index: 1; +} + +.scope-env-row .cs-panel, +.scope-env-row .cs-option { + text-align: center; +} + +/* Per-environment gradient themes — !important keeps the gradient fixed + under the brass hover overlay (ui.css :hover rules load later). */ +.scope-env-row[data-env="open"] .cs-btn.on { background: linear-gradient(135deg, #7ec8e3 0%, #c8922a 100%) !important; border-color: #a07020 !important; color: #fff; } +.scope-env-row[data-env="forest"] .cs-btn.on { background: linear-gradient(135deg, #1b5e3b 0%, #57bf8a 100%) !important; border-color: #1b5e3b !important; color: #fff; } +.scope-env-row[data-env="alpine"] .cs-btn.on { background: linear-gradient(135deg, #a8cfe8 0%, #dff0fa 100%) !important; border-color: #6aaedd !important; color: #1a3a58; } +.scope-env-row[data-env="beach"] .cs-btn.on { background: linear-gradient(135deg, #2a8fc8 0%, #e8d87a 100%) !important; border-color: #1e78b0 !important; color: #fff; } +.scope-env-row[data-env="river"] .cs-btn.on { background: linear-gradient(135deg, #2e6e5e 0%, #78c4a8 100%) !important; border-color: #2e6e5e !important; color: #fff; } +.scope-env-row[data-env="desert"] .cs-btn.on { background: linear-gradient(135deg, #b86820 0%, #e8c458 100%) !important; border-color: #a05818 !important; color: #fff; } +.scope-env-row[data-env="openwater"] .cs-btn.on { background: linear-gradient(135deg, #0c4878 0%, #2898d8 100%) !important; border-color: #0c4878 !important; color: #fff; } + +/* On hover the brass overlay covers the interior — force white text for contrast */ +.scope-env-row .cs-btn.on:hover { color: #fff; } + /* The search box on the right of the header */ .utci-search-wrap { position: relative; @@ -192,6 +278,10 @@ margin: 0 auto; /* centre the dial */ } + .scope-env-row { + width: 160px; /* match dial width on mobile */ + } + .utci-current-loc { margin-top: 4px; /* tighten gap above location on mobile */ } diff --git a/assets/css/ui.css b/assets/css/ui.css index d2e4e41..a2699bb 100644 --- a/assets/css/ui.css +++ b/assets/css/ui.css @@ -285,8 +285,8 @@ /* ── EVENT BANNER — mobile fixes ────────────────────────────────────── */ @media (max-width: 640px) { .event-banner-wrap { - margin-top: 8px; /* push banner clear of the fixed nav bar */ - margin-bottom: 0; /* no gap between banner and header on mobile */ + margin-top: 0; /* JS pins the banner's top to the nav's bottom edge */ + margin-bottom: 0; } .event-banner { @@ -442,6 +442,11 @@ .cs-vent.grp-felt.on:hover { background: rgba(213,233,226,0.80); color: #0c7d4e; border-color: #0c7d4e; } .cs-vent.grp-surface.on:hover { background: rgba(211,224,238,0.80); color: #1e5aa0; border-color: #1e5aa0; } +/* Hover overlay — invisible by default, only activated in specific contexts */ +.cs-btn-overlay { + display: none; +} + /* The chevron arrow inside the button */ .cs-arrow { display: inline-block; @@ -832,6 +837,20 @@ } +/* At ≤640px the top nav becomes position:fixed (72px tall, see base.css), + so the app needs 96px of top padding to clear it. This must come AFTER the + max-width:800px rule above — which sets padding-top:52px for the tablet + range where the nav is NOT fixed — so it wins the cascade on true mobile. */ +@media (max-width: 640px) { + .utci-app { + padding-top: 96px; + } + + .utci-fetch-time { + text-align: center; /* override the default left-align on mobile */ + } +} + /* -- CUSTOM SELECT BUTTON - mobile label clipping ---------------------- diff --git a/assets/js/app.js b/assets/js/app.js index bd663e4..03ef04c 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -287,7 +287,7 @@ export function UTCIForecast() {