Skip to content

Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.

fix(website): seat the clips on the floor, and close the join

Etienne Lescotc85c0c88826a
diff --git a/website/src/components/Recreation/scene.ts b/website/src/components/Recreation/scene.ts
index f4e292387..d3e0fc599 100644
--- a/website/src/components/Recreation/scene.ts
+++ b/website/src/components/Recreation/scene.ts
@@ -140,16 +140,19 @@ export const LANES = {
zoom: 118,
laneH: 22,
hint: 142,
- track: 154,
- trackH: 54,
+ track: 150,
+ trackH: 50,
} as const;
export const FLOOR_H = 210;
/** The two clips on the track. */
+/* The join is 0.13s — about twelve pixels at 90px/s. The design leaves 0.4s,
+ which is 36px of floor showing between two takes that are meant to read as
+ consecutive on one track. */
export const CLIPS = [
{ from: -9, to: 13.1, selected: true },
- { from: 13.5, to: 42, selected: false },
+ { from: 13.23, to: 42, selected: false },
] as const;
/** Three zooms, each with the scene time the wizard places it. */
@@ -299,6 +302,13 @@ function kf(t: number, points: readonly number[][]): number[] {
const clamp01 = (v: number) => (v < 0 ? 0 : v > 1 ? 1 : v);
+/** Smoothstep. Used only where a value is held at both ends — a ramp that
+ * starts and stops is the one place linear reads as mechanical. */
+const ease = (v: number) => {
+ const k = clamp01(v);
+ return k * k * (3 - 2 * k);
+};
+
/* ── sub-beat moments ─────────────────────────────────────────────────────── */
/** The three background picks, and the two cursor picks. */
@@ -362,7 +372,16 @@ export function frameAt(p: number): Frame {
const tf = footageTime(t);
const beat = BEATS.find((b) => t >= b.from && t < b.to)?.id ?? null;
- const tl = t >= TL_IN ? 1 : 0;
+ // A ramp, not a switch.
+ //
+ // This used to be 0/1 with a 0.75s CSS transition doing the easing, and that
+ // is a scroll-driven value being animated by a clock that is not the scroll:
+ // the floor chased a target it only reached long after `--tl` had settled, so
+ // it sat ~16px below its own `bottom: 0` and cut the bottom off the clips.
+ // Easing the value here instead means every rule that reads `--tl` — the
+ // floor, the panel's top and height, the composite's box — moves together and
+ // lands exactly.
+ const tl = ease(clamp01((t - TL_IN) / 0.55));
const bg = BG_PICKS.reduce((n, at) => (t >= at ? n + 1 : n), 0);
diff --git a/website/src/components/Recreation/styles.module.css b/website/src/components/Recreation/styles.module.css
index d650789d0..beace558c 100644
--- a/website/src/components/Recreation/styles.module.css
+++ b/website/src/components/Recreation/styles.module.css
@@ -177,7 +177,6 @@
width: calc(var(--pnl-w) - 8px);
z-index: 11;
pointer-events: none;
- transition: top 0.75s var(--ease);
}
.cap {
@@ -250,9 +249,7 @@
transform: translateY(calc((1 - var(--panel)) * 12px));
transition:
opacity 0.45s var(--ease),
- transform 0.45s var(--ease),
- top 0.75s var(--ease),
- height 0.75s var(--ease);
+ transform 0.45s var(--ease);
}
.panelHead {
@@ -665,10 +662,6 @@
0 0 44px -8px rgba(16, 185, 129, 0.3),
0 34px 70px -30px rgba(0, 0, 0, 0.65);
z-index: 5;
- transition:
- top 0.75s var(--ease),
- left 0.75s var(--ease),
- width 0.75s var(--ease);
}
.cardClip {
@@ -1101,8 +1094,10 @@
background: color-mix(in srgb, var(--ost-surface) 97%, transparent);
border-top: 1px solid var(--ost-border);
contain: layout paint;
+ /* No transition: `--tl` is eased in the score, and easing a scroll-driven
+ value twice makes the floor chase a target it reaches late — which is how
+ it came to sit 16px below its own `bottom: 0`. */
transform: translateY(calc((1 - var(--tl)) * (var(--tl-h) + 20px)));
- transition: transform 0.75s var(--ease);
}
.floorClip {
@@ -1146,10 +1141,13 @@
white-space: nowrap;
}
+/* 150 + 50 leaves 10px under the clips inside a 210px floor. At the design's
+ 154 + 54 they finish 2px from the bottom edge, which does not read as a
+ track sitting on a floor — it reads as a track the floor has cut off. */
.clip {
position: absolute;
- top: 154px;
- height: 54px;
+ top: 150px;
+ height: 50px;
border-radius: 10px;
background: color-mix(in srgb, var(--ost-surface-2) 72%, transparent);
border: 1px solid var(--ost-border-hi);
@@ -1161,7 +1159,7 @@
position: absolute;
left: 13px;
right: 13px;
- top: 30px;
+ top: 28px;
height: 9px;
background: repeating-linear-gradient(90deg, var(--ost-accent) 0 2px, transparent 2px 7px);
opacity: 0.75;