Animated sunscope with day cycle
This commit is contained in:
fraxle
2026-06-06 14:49:56 +01:00
parent 6da2f34b26
commit f22833ee63
7 changed files with 433 additions and 19 deletions
+82
View File
@@ -191,6 +191,42 @@
display: block;
}
/* Wraps the dial SVG + the precip FX canvas so the canvas can overlay the
lens. Sizes itself to the SVG (220px, or 250px on mobile). */
.scope-wrap {
position: relative;
display: inline-block;
line-height: 0;
}
/* Animated rain/snow/lightning layer, clipped to the lens circle and sitting
on top of the glass. Inset to 95% to match the lens radius (r=95 of 100). */
.scope-fx {
position: absolute;
top: 50%;
left: 50%;
width: 95%;
height: 95%;
transform: translate(-50%, -50%);
border-radius: 50%;
pointer-events: none;
}
/* Cloud sprite strips drift horizontally inside the lens; sprites are
duplicated +200 user-units so the wrap is seamless. */
@keyframes scopeCloudDrift {
from { transform: translateX(0); }
to { transform: translateX(var(--drift, -200px)); }
}
.scope-cloud-layer {
animation: scopeCloudDrift linear infinite;
will-change: transform;
}
@media (prefers-reduced-motion: reduce) {
.scope-cloud-layer { animation: none; }
}
.scope-col {
display: flex;
flex-direction: column;
@@ -198,6 +234,52 @@
gap: 8px;
}
/* Time-lapse toggle beneath the dial. Brass pill matching the scope bezel. */
.scope-play {
display: inline-flex;
align-items: center;
gap: 7px;
padding: 4px 12px;
border: 1px solid rgba(200, 146, 42, 0.5);
border-radius: 999px;
background: rgba(40, 28, 10, 0.55);
color: #e8d8c0;
font-family: 'Manrope', sans-serif;
font-size: 11px;
font-weight: 700;
letter-spacing: 0.5px;
cursor: pointer;
transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.scope-play:hover {
background: rgba(200, 146, 42, 0.18);
border-color: rgba(200, 146, 42, 0.85);
color: #f5edd6;
}
.scope-play.is-playing {
padding: 4px 14px;
background: #241708; /* solid dark so the clock pops */
border-color: rgba(200, 146, 42, 0.9);
color: #ffd98a;
}
.scope-play.is-playing:hover {
background: #2e1d0a;
color: #ffe6b0;
}
.scope-play-icon { font-size: 9px; line-height: 1; }
/* While playing, the simulated clock is the main readout — big, bright and
monospaced so the digits don't jitter as they tick. */
.scope-play.is-playing .scope-play-label {
font-family: 'JetBrains Mono', ui-monospace, monospace;
font-size: 15px;
font-weight: 700;
letter-spacing: 0.5px;
font-variant-numeric: tabular-nums;
min-width: 52px;
text-align: center;
color: #ffd98a;
}
/* The environment selector sits just below the dial, centred under it.
Kept out of .scope-col so the dial alone defines that column's height
and stays vertically centred against the side columns. */