AC block: mode-driven accent colour, stronger fade when off
Icon and lit fan bars now share one --ac-accent custom property so they can never drift apart: blue (cool), red (heat), amber (auto/fan), app-primary default for dry (not in the requested colour spec). Off overrides all of them with light grey plus a real opacity fade. Applies to both the Dashboard's ZoneCard and kiosk's KioskZoneBlock via the shared CSS. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
29340beb7a
commit
0f64500813
3 changed files with 18 additions and 8 deletions
|
|
@ -58,7 +58,7 @@ export default function KioskZoneBlock({ zone, liveDevices, selectionMode, selec
|
||||||
<div className="kiosk-block-top">
|
<div className="kiosk-block-top">
|
||||||
<span className="kiosk-block-zone">{zone.name}</span>
|
<span className="kiosk-block-zone">{zone.name}</span>
|
||||||
{ac && (
|
{ac && (
|
||||||
<div className={`ac-block${acOn ? '' : ' off'}`}>
|
<div className={`ac-block ac-mode-${ac.current_mode || 'unknown'}${acOn ? '' : ' off'}`}>
|
||||||
{ac.remote_locked && <Lock size={12} strokeWidth={1.75} className="ac-lock" />}
|
{ac.remote_locked && <Lock size={12} strokeWidth={1.75} className="ac-lock" />}
|
||||||
<div className="ac-mode-row">
|
<div className="ac-mode-row">
|
||||||
<ModeIcon size={18} strokeWidth={1.75} />
|
<ModeIcon size={18} strokeWidth={1.75} />
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ export default function ZoneCard({ zone, onClick }: { zone: ZoneStatus; onClick:
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{ac && (
|
{ac && (
|
||||||
<div className={`ac-block${acOn ? '' : ' off'}`}>
|
<div className={`ac-block ac-mode-${ac.current_mode || 'unknown'}${acOn ? '' : ' off'}`}>
|
||||||
{ac.remote_locked && <Lock size={12} strokeWidth={1.75} className="ac-lock" />}
|
{ac.remote_locked && <Lock size={12} strokeWidth={1.75} className="ac-lock" />}
|
||||||
<div className="ac-mode-row">
|
<div className="ac-mode-row">
|
||||||
<ModeIcon size={20} strokeWidth={1.75} />
|
<ModeIcon size={20} strokeWidth={1.75} />
|
||||||
|
|
|
||||||
|
|
@ -230,11 +230,21 @@ html, body, #root { height: 100%; margin: 0; font-size: 14px; }
|
||||||
.rad-icon.heating { color: var(--danger); }
|
.rad-icon.heating { color: var(--danger); }
|
||||||
.rad-icon.idle { color: var(--text-mid); }
|
.rad-icon.idle { color: var(--text-mid); }
|
||||||
|
|
||||||
.ac-block { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding-top: 4px; color: var(--text-dark); }
|
/* Mode drives one accent colour shared by the mode icon and the lit fan bars
|
||||||
/* Explicit muted colour rather than opacity — opacity alone just faded the
|
(--ac-accent), so the two can never drift apart. Set per ac-mode-* class
|
||||||
'on' fan-bar segments' orange, which read as a washed-out active state
|
below; both ZoneCard (dashboard) and KioskZoneBlock render this markup. */
|
||||||
rather than a clean off one. */
|
.ac-block { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding-top: 4px; --ac-accent: var(--app-primary); color: var(--ac-accent); }
|
||||||
.ac-block.off { color: var(--text-mid); }
|
.ac-block.ac-mode-cool { --ac-accent: var(--st-occupied); } /* blue */
|
||||||
|
.ac-block.ac-mode-heat { --ac-accent: var(--danger); } /* red */
|
||||||
|
.ac-block.ac-mode-auto,
|
||||||
|
.ac-block.ac-mode-fan { --ac-accent: var(--health-degraded); } /* amber */
|
||||||
|
/* 'dry' isn't in the user's colour spec — left on the default app-primary
|
||||||
|
rather than inventing a meaning for it. */
|
||||||
|
|
||||||
|
/* Off: light grey + genuine fade, overriding whatever mode accent applies —
|
||||||
|
explicit colour AND opacity, so it reads clearly inactive rather than like
|
||||||
|
a washed-out active state. */
|
||||||
|
.ac-block.off { --ac-accent: var(--text-mid); color: var(--text-mid); opacity: .45; }
|
||||||
.ac-block.off .fan-bar span.on { background: var(--text-mid); }
|
.ac-block.off .fan-bar span.on { background: var(--text-mid); }
|
||||||
.ac-lock { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); color: var(--health-degraded); }
|
.ac-lock { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); color: var(--health-degraded); }
|
||||||
.ac-mode-row { display: flex; align-items: center; gap: 6px; }
|
.ac-mode-row { display: flex; align-items: center; gap: 6px; }
|
||||||
|
|
@ -246,7 +256,7 @@ html, body, #root { height: 100%; margin: 0; font-size: 14px; }
|
||||||
.fan-bar span:nth-child(2) { height: 50%; }
|
.fan-bar span:nth-child(2) { height: 50%; }
|
||||||
.fan-bar span:nth-child(3) { height: 75%; }
|
.fan-bar span:nth-child(3) { height: 75%; }
|
||||||
.fan-bar span:nth-child(4) { height: 100%; }
|
.fan-bar span:nth-child(4) { height: 100%; }
|
||||||
.fan-bar span.on { background: var(--app-primary); }
|
.fan-bar span.on { background: var(--ac-accent, var(--app-primary)); }
|
||||||
|
|
||||||
/* ── Badges ────────────────────────────────────────────────── */
|
/* ── Badges ────────────────────────────────────────────────── */
|
||||||
.badge {
|
.badge {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue