diff options
Diffstat (limited to 'static')
| -rw-r--r-- | static/dashboard.js | 1 | ||||
| -rw-r--r-- | static/deck.css | 12 |
2 files changed, 13 insertions, 0 deletions
diff --git a/static/dashboard.js b/static/dashboard.js index 21e1cf3..70fdd6c 100644 --- a/static/dashboard.js +++ b/static/dashboard.js @@ -238,6 +238,7 @@ export default { const charging = b.status === "charging" || b.status === "full"; $(".c-bat .ic").textContent = batteryGlyph(b); chip(".c-bat", b.level != null ? `${b.level}%` : "—", null, b.level, b.level < 20 && !charging); + $(".c-bat").classList.toggle("charging", b.status === "charging"); chip(".c-wifi", w.rssi != null ? `${w.rssi} dBm` : "—", w.band ?? "", w.rssi == null ? 0 : 2 * (w.rssi + 100)); // -100 dBm empty, -50 full }); diff --git a/static/deck.css b/static/deck.css index 81a7428..a25ee46 100644 --- a/static/deck.css +++ b/static/deck.css @@ -665,6 +665,18 @@ select { .dash .chip svg path.hy { fill: url(#hyfill); stroke: url(#hyline); } .dash .chip svg path.up { fill: color-mix(in srgb, var(--udt-text) 8%, transparent); stroke: color-mix(in srgb, var(--udt-text) 30%, transparent); } .dash .chip .fill { right: auto; width: 0; background: color-mix(in srgb, var(--udt-accent) 20%, transparent); transition: width .4s; } +/* Charging: streaks rain right to left into the fill's edge. The strip sits past + the fill and the chip's overflow clips it; each layer moves a whole tile per + loop, so it wraps seamlessly at its own speed. */ +.dash .c-bat.charging .fill::after { content: ""; position: absolute; top: 0; bottom: 0; left: 100%; width: 100vw; + --r: color-mix(in srgb, var(--udt-accent) 55%, transparent); + background: linear-gradient(90deg, var(--r), transparent 14px) 0 22% / 47px 2px repeat-x, + linear-gradient(90deg, var(--r), transparent 9px) 13px 45% / 31px 2px repeat-x, + linear-gradient(90deg, var(--r), transparent 18px) 29px 68% / 59px 2px repeat-x, + linear-gradient(90deg, var(--r), transparent 11px) 7px 88% / 41px 2px repeat-x; + animation: bat-rain .9s linear infinite; } +@keyframes bat-rain { to { background-position: -94px 22%, -49px 45%, -30px 68%, -75px 88%; } } +@media (prefers-reduced-motion: reduce) { .dash .c-bat.charging .fill::after { animation: none; } } .dash .chip .ic { position: relative; flex: none; width: 1.4rem; font-size: 1.25rem; line-height: 1; color: var(--udt-overlay1); } .dash .chip .brand.ic { width: 20px; height: 20px; } .dash .chip .col { position: relative; display: flex; flex-direction: column; min-width: 0; } |
