Files
smart-mirror/raspi/static/css/mirror.css

527 lines
12 KiB
CSS
Raw Normal View History

2026-05-02 20:54:53 +02:00
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');
2026-04-27 06:01:00 +02:00
2026-05-02 20:54:53 +02:00
/* ── Design Tokens ── */
2026-04-27 06:01:00 +02:00
:root {
2026-05-02 20:54:53 +02:00
--bg: #111318;
--bg-card: #1c1f2b;
--bg-card2: #21253a;
--border: rgba(255,255,255,.07);
--border-hover:rgba(255,255,255,.13);
--txt: #e4e9f5;
--txt-dim: rgba(228,233,245,.55);
--txt-ghost: rgba(228,233,245,.28);
--blue: #3b82f6;
--blue-glow: rgba(59,130,246,.25);
--blue-soft: rgba(59,130,246,.12);
--green: #22c55e;
--green-soft: rgba(34,197,94,.12);
--green-glow: rgba(34,197,94,.3);
2026-04-27 06:01:00 +02:00
2026-05-02 20:54:53 +02:00
--yellow: #f59e0b;
--yellow-soft: rgba(245,158,11,.12);
2026-04-27 06:01:00 +02:00
2026-05-02 20:54:53 +02:00
--red: #ef4444;
--red-soft: rgba(239,68,68,.12);
--red-glow: rgba(239,68,68,.3);
2026-04-27 06:01:00 +02:00
2026-05-02 20:54:53 +02:00
--teal: #14b8a6;
--teal-soft: rgba(20,184,166,.12);
2026-04-27 06:01:00 +02:00
2026-05-02 20:54:53 +02:00
--purple: #a78bfa;
--purple-soft: rgba(167,139,250,.12);
2026-04-27 06:01:00 +02:00
2026-05-02 20:54:53 +02:00
--r: 12px;
--r-sm: 8px;
--gap: 14px;
--font: 'Inter', system-ui, sans-serif;
--mono: 'JetBrains Mono', monospace;
2026-04-27 06:01:00 +02:00
}
2026-05-02 20:54:53 +02:00
/* ── Reset ── */
2026-04-27 06:01:00 +02:00
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
width: 100%; min-height: 100vh;
2026-05-02 20:54:53 +02:00
background: var(--bg);
color: var(--txt);
font-family: var(--font);
font-size: 14px;
font-weight: 400;
2026-04-27 06:01:00 +02:00
-webkit-font-smoothing: antialiased;
2026-05-02 20:54:53 +02:00
overflow-x: hidden;
2026-04-27 06:01:00 +02:00
}
2026-05-02 20:54:53 +02:00
/* Subtle grid background */
2026-04-27 06:01:00 +02:00
body::before {
content: '';
2026-05-02 20:54:53 +02:00
position: fixed; inset: 0; z-index: 0; pointer-events: none;
background-image:
linear-gradient(rgba(59,130,246,.025) 1px, transparent 1px),
linear-gradient(90deg, rgba(59,130,246,.025) 1px, transparent 1px);
background-size: 40px 40px;
2026-04-27 06:01:00 +02:00
}
2026-05-02 20:54:53 +02:00
/* ── Layout ── */
2026-04-27 06:01:00 +02:00
.mirror-layout {
2026-05-02 20:54:53 +02:00
position: relative; z-index: 1;
2026-04-27 06:01:00 +02:00
display: grid;
grid-template-rows: auto 1fr auto;
min-height: 100vh;
padding: var(--gap);
gap: var(--gap);
2026-05-02 20:54:53 +02:00
max-width: 1400px;
margin: 0 auto;
2026-04-27 06:01:00 +02:00
}
2026-05-02 20:54:53 +02:00
/* ── Card primitive ── */
.card {
background: var(--bg-card);
border: 1px solid var(--border);
2026-04-27 06:01:00 +02:00
border-radius: var(--r);
2026-05-02 20:54:53 +02:00
transition: border-color .25s, background .25s;
2026-04-27 06:01:00 +02:00
}
2026-05-02 20:54:53 +02:00
.card:hover { border-color: var(--border-hover); }
2026-04-27 06:01:00 +02:00
2026-05-02 20:54:53 +02:00
/* ── Header ── */
2026-04-27 06:01:00 +02:00
.mirror-header {
2026-05-02 20:54:53 +02:00
display: grid;
grid-template-columns: auto 1fr auto;
2026-04-27 06:01:00 +02:00
align-items: center;
2026-05-02 20:54:53 +02:00
gap: 20px;
padding: 16px 20px;
2026-04-27 06:01:00 +02:00
}
2026-05-02 20:54:53 +02:00
.header-brand {
display: flex;
align-items: center;
gap: 10px;
}
.brand-icon {
width: 32px; height: 32px;
border-radius: 8px;
background: var(--blue-soft);
border: 1px solid var(--blue);
display: flex; align-items: center; justify-content: center;
font-size: 16px;
}
.brand-name {
font-size: 13px;
font-weight: 600;
letter-spacing: .04em;
color: var(--txt);
}
.brand-sub {
font-size: 11px;
color: var(--txt-ghost);
margin-top: 1px;
}
/* Clock — centred */
.mirror-clock { text-align: center; }
2026-04-27 06:01:00 +02:00
.clock-time {
2026-05-02 20:54:53 +02:00
font-family: var(--mono);
font-size: clamp(2rem, 5vw, 3.6rem);
font-weight: 500;
letter-spacing: .08em;
color: var(--txt);
2026-04-27 06:01:00 +02:00
line-height: 1;
}
.clock-date {
2026-05-02 20:54:53 +02:00
font-size: 11px;
font-weight: 400;
letter-spacing: .18em;
2026-04-27 06:01:00 +02:00
text-transform: uppercase;
2026-05-02 20:54:53 +02:00
color: var(--txt-ghost);
margin-top: 6px;
2026-04-27 06:01:00 +02:00
}
2026-05-02 20:54:53 +02:00
/* Connection badge */
2026-04-27 06:01:00 +02:00
.conn-badge {
display: flex;
align-items: center;
2026-05-02 20:54:53 +02:00
gap: 8px;
padding: 8px 14px;
border-radius: var(--r-sm);
font-family: var(--mono);
font-size: 11px;
color: var(--txt-ghost);
transition: all .3s;
}
.conn-badge.ok {
background: var(--green-soft);
border-color: rgba(34,197,94,.25);
color: var(--green);
}
.conn-badge.err {
background: var(--red-soft);
border-color: rgba(239,68,68,.25);
color: var(--red);
2026-04-27 06:01:00 +02:00
}
.conn-dot {
width: 7px; height: 7px;
border-radius: 50%;
2026-05-02 20:54:53 +02:00
background: currentColor;
2026-04-27 06:01:00 +02:00
flex-shrink: 0;
2026-05-02 20:54:53 +02:00
transition: box-shadow .3s;
2026-04-27 06:01:00 +02:00
}
2026-05-02 20:54:53 +02:00
.conn-badge.ok .conn-dot { box-shadow: 0 0 6px var(--green); animation: pulse-green 2s infinite; }
.conn-badge.err .conn-dot { box-shadow: 0 0 6px var(--red); }
2026-04-27 06:01:00 +02:00
2026-05-02 20:54:53 +02:00
@keyframes pulse-green {
0%,100% { opacity: 1; }
50% { opacity: .5; }
}
/* ── Body grid ── */
2026-04-27 06:01:00 +02:00
.mirror-body {
display: grid;
2026-05-02 20:54:53 +02:00
grid-template-columns: repeat(4, 1fr);
2026-04-27 06:01:00 +02:00
grid-template-rows: auto auto auto;
gap: var(--gap);
}
2026-05-02 20:54:53 +02:00
/* ── Sensor tiles ── */
2026-04-27 06:01:00 +02:00
.sensor-tile {
2026-05-02 20:54:53 +02:00
padding: 18px 18px 14px;
2026-04-27 06:01:00 +02:00
position: relative;
overflow: hidden;
2026-05-02 20:54:53 +02:00
cursor: default;
transition: transform .2s, box-shadow .2s, border-color .25s;
2026-04-27 06:01:00 +02:00
}
2026-05-02 20:54:53 +02:00
.sensor-tile:hover {
transform: translateY(-1px);
box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
/* Coloured left stripe */
.sensor-tile::after {
2026-04-27 06:01:00 +02:00
content: '';
2026-05-02 20:54:53 +02:00
position: absolute; top: 0; left: 0; bottom: 0;
width: 3px;
border-radius: var(--r) 0 0 var(--r);
background: var(--blue);
transition: background .3s;
}
.sensor-tile.breach-high::after { background: var(--red); }
.sensor-tile.breach-low::after { background: var(--yellow); }
.sensor-tile-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 14px;
}
.sensor-icon {
width: 30px; height: 30px;
border-radius: 7px;
background: var(--blue-soft);
border: 1px solid rgba(59,130,246,.2);
display: flex; align-items: center; justify-content: center;
font-size: 14px;
transition: background .3s, border-color .3s;
}
.sensor-tile.breach-high .sensor-icon {
background: var(--red-soft);
border-color: rgba(239,68,68,.3);
}
.sensor-tile.breach-low .sensor-icon {
background: var(--yellow-soft);
border-color: rgba(245,158,11,.3);
2026-04-27 06:01:00 +02:00
}
2026-05-02 20:54:53 +02:00
.sensor-state-dot {
width: 6px; height: 6px;
border-radius: 50%;
background: var(--blue);
opacity: .5;
transition: background .3s, opacity .3s, box-shadow .3s;
}
.sensor-tile.breach-high .sensor-state-dot {
background: var(--red); opacity: 1;
box-shadow: 0 0 6px var(--red);
animation: blink .8s infinite;
}
.sensor-tile.breach-low .sensor-state-dot {
background: var(--yellow); opacity: 1;
box-shadow: 0 0 6px var(--yellow);
animation: blink .8s infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }
2026-04-27 06:01:00 +02:00
.sensor-label {
2026-05-02 20:54:53 +02:00
font-size: 11px;
font-weight: 500;
letter-spacing: .06em;
2026-04-27 06:01:00 +02:00
text-transform: uppercase;
2026-05-02 20:54:53 +02:00
color: var(--txt-ghost);
2026-04-27 06:01:00 +02:00
}
2026-05-02 20:54:53 +02:00
2026-04-27 06:01:00 +02:00
.sensor-value {
2026-05-02 20:54:53 +02:00
font-family: var(--mono);
font-size: clamp(1.5rem, 2.5vw, 2.1rem);
font-weight: 500;
color: var(--txt);
2026-04-27 06:01:00 +02:00
line-height: 1;
2026-05-02 20:54:53 +02:00
transition: color .3s;
2026-04-27 06:01:00 +02:00
}
2026-05-02 20:54:53 +02:00
.sensor-tile.breach-high .sensor-value { color: var(--red); }
.sensor-tile.breach-low .sensor-value { color: var(--yellow); }
.sensor-meta {
margin-top: 10px;
display: flex;
align-items: center;
justify-content: space-between;
2026-04-27 06:01:00 +02:00
}
.sensor-threshold {
2026-05-02 20:54:53 +02:00
font-family: var(--mono);
font-size: 10px;
color: var(--txt-ghost);
2026-04-27 06:01:00 +02:00
}
.sensor-alert-badge {
2026-05-02 20:54:53 +02:00
display: inline-flex;
align-items: center;
gap: 4px;
font-size: 10px;
font-weight: 500;
letter-spacing: .05em;
2026-04-27 06:01:00 +02:00
text-transform: uppercase;
2026-05-02 20:54:53 +02:00
padding: 2px 7px;
border-radius: 4px;
background: var(--red-soft);
color: var(--red);
border: 1px solid rgba(239,68,68,.25);
2026-04-27 06:01:00 +02:00
}
.sensor-alert-badge.low {
2026-05-02 20:54:53 +02:00
background: var(--yellow-soft);
color: var(--yellow);
border-color: rgba(245,158,11,.25);
2026-04-27 06:01:00 +02:00
}
2026-05-02 20:54:53 +02:00
/* ── Stat row ── */
2026-04-27 06:01:00 +02:00
.stat-row {
grid-column: 1 / -1;
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: var(--gap);
}
2026-05-02 20:54:53 +02:00
2026-04-27 06:01:00 +02:00
.stat-card {
2026-05-02 20:54:53 +02:00
padding: 14px 16px;
display: flex;
align-items: center;
gap: 12px;
}
.stat-card-icon {
width: 36px; height: 36px;
border-radius: 9px;
display: flex; align-items: center; justify-content: center;
font-size: 16px;
flex-shrink: 0;
2026-04-27 06:01:00 +02:00
}
2026-05-02 20:54:53 +02:00
.stat-card-icon.blue { background: var(--blue-soft); }
.stat-card-icon.green { background: var(--green-soft); }
.stat-card-icon.red { background: var(--red-soft); }
.stat-card-icon.teal { background: var(--teal-soft); }
.stat-card-icon.purple { background: var(--purple-soft); }
.stat-info { min-width: 0; }
2026-04-27 06:01:00 +02:00
.stat-label {
2026-05-02 20:54:53 +02:00
font-size: 11px;
font-weight: 500;
letter-spacing: .06em;
2026-04-27 06:01:00 +02:00
text-transform: uppercase;
2026-05-02 20:54:53 +02:00
color: var(--txt-ghost);
margin-bottom: 3px;
2026-04-27 06:01:00 +02:00
}
.stat-value {
2026-05-02 20:54:53 +02:00
font-family: var(--mono);
font-size: 1.15rem;
font-weight: 500;
color: var(--txt);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
2026-04-27 06:01:00 +02:00
}
2026-05-02 20:54:53 +02:00
.stat-value.red { color: var(--red); }
2026-04-27 06:01:00 +02:00
.stat-sub {
2026-05-02 20:54:53 +02:00
font-size: 10px;
color: var(--txt-ghost);
margin-top: 2px;
font-family: var(--mono);
2026-04-27 06:01:00 +02:00
}
2026-05-02 20:54:53 +02:00
/* ── Chart panel ── */
2026-04-27 06:01:00 +02:00
.chart-panel {
grid-column: 1 / 3;
2026-05-02 20:54:53 +02:00
padding: 16px 18px 14px;
}
.panel-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 14px;
2026-04-27 06:01:00 +02:00
}
2026-05-02 20:54:53 +02:00
.panel-title {
font-size: 11px;
font-weight: 600;
letter-spacing: .08em;
2026-04-27 06:01:00 +02:00
text-transform: uppercase;
2026-05-02 20:54:53 +02:00
color: var(--txt-dim);
}
.panel-badge {
font-family: var(--mono);
font-size: 10px;
color: var(--txt-ghost);
background: rgba(255,255,255,.04);
border: 1px solid var(--border);
border-radius: 4px;
padding: 2px 7px;
2026-04-27 06:01:00 +02:00
}
#chart { display: block; width: 100%; }
2026-05-02 20:54:53 +02:00
/* ── Log panel ── */
2026-04-27 06:01:00 +02:00
.log-panel {
2026-05-02 20:54:53 +02:00
grid-column: 3 / -1;
2026-04-27 06:01:00 +02:00
padding: 0;
display: flex;
flex-direction: column;
overflow: hidden;
2026-05-02 20:54:53 +02:00
min-height: 220px;
2026-04-27 06:01:00 +02:00
}
.tab-bar {
display: flex;
2026-05-02 20:54:53 +02:00
border-bottom: 1px solid var(--border);
2026-04-27 06:01:00 +02:00
flex-shrink: 0;
2026-05-02 20:54:53 +02:00
padding: 0 6px;
gap: 2px;
2026-04-27 06:01:00 +02:00
}
.tab {
flex: 1;
2026-05-02 20:54:53 +02:00
padding: 10px 12px;
font-size: 11px;
font-weight: 500;
letter-spacing: .06em;
2026-04-27 06:01:00 +02:00
text-transform: uppercase;
2026-05-02 20:54:53 +02:00
color: var(--txt-ghost);
2026-04-27 06:01:00 +02:00
cursor: pointer;
text-align: center;
2026-05-02 20:54:53 +02:00
transition: color .2s;
2026-04-27 06:01:00 +02:00
border-bottom: 2px solid transparent;
margin-bottom: -1px;
2026-05-02 20:54:53 +02:00
position: relative;
2026-04-27 06:01:00 +02:00
}
2026-05-02 20:54:53 +02:00
.tab:hover { color: var(--txt-dim); }
.tab.active { color: var(--blue); border-bottom-color: var(--blue); }
2026-04-27 06:01:00 +02:00
.tab-body {
flex: 1;
overflow-y: auto;
2026-05-02 20:54:53 +02:00
padding: 8px 12px;
font-family: var(--mono);
font-size: 11px;
2026-04-27 06:01:00 +02:00
}
.tab-body::-webkit-scrollbar { width: 3px; }
2026-05-02 20:54:53 +02:00
.tab-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
2026-04-27 06:01:00 +02:00
.tab-pane { display: none; }
.tab-pane.active { display: block; }
.log-entry {
2026-05-02 20:54:53 +02:00
display: grid;
grid-template-columns: 68px 1fr auto;
2026-04-27 06:01:00 +02:00
gap: 8px;
2026-05-02 20:54:53 +02:00
padding: 5px 0;
2026-04-27 06:01:00 +02:00
border-bottom: 1px solid rgba(255,255,255,.04);
2026-05-02 20:54:53 +02:00
animation: fadeSlide .15s ease;
align-items: center;
2026-04-27 06:01:00 +02:00
}
2026-05-02 20:54:53 +02:00
@keyframes fadeSlide {
from { opacity: 0; transform: translateY(-3px); }
2026-04-27 06:01:00 +02:00
to { opacity: 1; transform: none; }
}
2026-05-02 20:54:53 +02:00
.log-ts { color: var(--txt-ghost); font-size: 10px; }
.log-raw { color: var(--txt-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-num { color: var(--blue); text-align: right; white-space: nowrap; }
2026-04-27 06:01:00 +02:00
.alert-entry {
2026-05-02 20:54:53 +02:00
display: grid;
grid-template-columns: 16px 68px 1fr;
2026-04-27 06:01:00 +02:00
gap: 8px;
2026-05-02 20:54:53 +02:00
padding: 6px 0;
2026-04-27 06:01:00 +02:00
border-bottom: 1px solid rgba(255,255,255,.04);
2026-05-02 20:54:53 +02:00
align-items: center;
animation: fadeSlide .15s ease;
2026-04-27 06:01:00 +02:00
}
2026-05-02 20:54:53 +02:00
.alert-icon { color: var(--red); font-size: 12px; }
.alert-ts { color: var(--txt-ghost); font-size: 10px; }
.alert-msg { color: var(--txt-dim); }
2026-04-27 06:01:00 +02:00
.alert-badge {
display: inline-flex;
align-items: center;
justify-content: center;
2026-05-02 20:54:53 +02:00
min-width: 16px; height: 16px;
border-radius: 8px;
background: var(--red);
color: #fff;
font-size: 9px;
font-weight: 600;
2026-04-27 06:01:00 +02:00
margin-left: 5px;
vertical-align: middle;
2026-05-02 20:54:53 +02:00
padding: 0 3px;
2026-04-27 06:01:00 +02:00
display: none;
}
.alert-badge.visible { display: inline-flex; }
2026-05-02 20:54:53 +02:00
/* ── Rain tile — special ── */
.rain-tile {
display: flex;
flex-direction: column;
gap: 8px;
}
.rain-bar-wrap {
width: 100%;
height: 6px;
background: rgba(255,255,255,.06);
border-radius: 3px;
overflow: hidden;
margin-top: 8px;
}
.rain-bar {
height: 100%;
background: linear-gradient(90deg, var(--blue), var(--teal));
border-radius: 3px;
transition: width .5s ease;
}
/* ── Footer ── */
2026-04-27 06:01:00 +02:00
.mirror-footer {
display: flex;
justify-content: space-between;
align-items: center;
2026-05-02 20:54:53 +02:00
padding: 10px 20px;
font-size: 11px;
font-family: var(--mono);
color: var(--txt-ghost);
2026-04-27 06:01:00 +02:00
}
2026-05-02 20:54:53 +02:00
/* ── Responsive ── */
@media (max-width: 1100px) {
.mirror-body { grid-template-columns: 1fr 1fr; }
.stat-row { grid-template-columns: 1fr 1fr; }
2026-04-27 06:01:00 +02:00
.chart-panel { grid-column: 1 / -1; }
2026-05-02 20:54:53 +02:00
.log-panel { grid-column: 1 / -1; min-height: 200px; }
2026-04-27 06:01:00 +02:00
}
2026-05-02 20:54:53 +02:00
@media (max-width: 640px) {
.mirror-body { grid-template-columns: 1fr 1fr; }
2026-04-27 06:01:00 +02:00
.stat-row { grid-template-columns: 1fr 1fr; }
2026-05-02 20:54:53 +02:00
.mirror-header { grid-template-columns: 1fr; }
.header-brand, .conn-badge { display: none; }
2026-04-27 06:01:00 +02:00
}