Showcase · Fiktive Marke Urvo
Shadowbox
Scrollen Sie langsam: Der Bär schlägt Jab, Cross, Hook und Body Shot, die Kamera zieht vom Hüftbild auf die Ganzkörperansicht, jeder gestreckte Schlag wird unten auf dem Punktzettel abgehakt. Nach dem letzten Schlag fährt die Kamera in den Handschuh, die Szene taucht ins Schwarz, dann steigt eine kleine Produktkarte vor der riesigen Gewichtszahl auf, und der Polar 16 landet wie ein Schlag darin, über den Kartenrand hinaus. Die Gewichtswahl tauscht die Zahl und die Größe des Handschuhs. Die Leertaste oder ein Klick auf einen Schlag springt dorthin.
- Scroll-Video
- Schwarzweiß-Grading
- Produkt-Reveal
Anleitung
So ist es entstanden.
01/ 03
HiggsfieldSoul 2 · Kling 3.0Bild, Bewegung, Produkt
Ein Startbild, daraus zehn Sekunden Schattenboxen, dazu ein Produktfoto des Handschuhs fürs Finale.
02/ 03
macOS Vision
ffmpegSwift · Node
Zerlegen, freistellen, vermessen
241 Frames freigestellt und schwarzweiß wie ein Ringfoto, nur das Leder bleibt rot. Beide Handschuhe in jedem Frame vermessen, die neun Treffer von Hand geprüft.
03/ 03
Claude CodeHTML · Canvas · JS
Seite bauen
Frames, Tracking und Produktfoto in den Ordner, den optimierten Prompt an Claude Code, fertig.
Alle Prompts im Wortlaut
# Start frame (Soul 2, 16:9) Hyperreal 3D sports campaign still, 16:9: an anthropomorphic polar bear heavyweight boxer, standing upright like a human fighter, front view, low camera angle, framed from the waist up, centered, the head at about 40 percent of the frame height with wide empty backdrop above it. Dense white fur, broad shoulders, fierce focused stare, glossy crimson red leather boxing gloves held up high in a tight guard just below its eyes, white hand wraps at the wrists, black satin boxing shorts with a broad crimson waistband. Seamless saturated cobalt blue studio backdrop, even soft light with a crisp white rim light, slight haze, film grain, premium sportswear campaign, no logos, no text, plain unbranded gloves # Motion (Kling 3.0 std, image-to-video, 10 s, 720p) The polar bear boxer shadowboxes on the spot for the whole clip with fast, explosive, sharp punches: a jab straight at the camera, a cross, a left hook, a right uppercut, a double jab and a final big cross, snapping each glove back into a tight guard, bouncing lightly on its feet, shoulders rolling, fur rippling with every punch. It stays in the same place in the middle of the frame and never walks away. The camera starts on the low-angle frontal shot from the waist up, then slowly pulls back and arcs about 60 degrees to the bear's left side, ending on a wide low-angle full-body shot of the bear still punching, feet and floor shadow visible. The seamless cobalt blue studio backdrop stays clean, plain and unchanged, soft floor shadow, crisp fast shutter, cinematic, photoreal. The red gloves stay plain with no logos, no text. # Product shot for the finale (Soul 2, 1:1) Studio product shot, 1:1: one plain unbranded boxing glove in glossy crimson red leather with a white wrist cuff and white strap, seen in a dynamic three-quarter angle as if punching slightly towards the camera, floating, perfectly lit with a soft top light and a thin cold blue rim light, deep pure black seamless background, razor sharp, macro detail on the leather grain and stitching, minimal luxury sports advertising, centered, no logos, no text
# Frames out of the clip
ffmpeg -i clip.mp4 -fps_mode passthrough -start_number 0 raw/%03d.png
# One matte per frame (matte.swift)
swiftc -O -o matte matte.swift && ./matte raw/ mattes/
# Cut-out frames (enc-cut.sh, one call per frame)
#!/bin/sh
# $1 = frame: bear only (RGBA). Sharpening grows with the frame number (Kling gets softer and the
# bear smaller as the camera pulls back), a tighter matte against the light studio fringe, then
# lossy colour at q90 with sharp_yuv (crisp red edges) and lossless alpha.
n=$(echo $1 | sed 's/^0*//'); n=${n:-0}
amt=$(echo "scale=2; 0.55 + 0.45 * $n / 240" | bc)
ffmpeg -loglevel error -y -i raw/$1.png -i mattes/$1.png -filter_complex \
"[0]unsharp=5:5:$amt:5:5:0[c];[1]alphaextract,lut=c0=clip((val-100)*2\,0\,255)[a];[c][a]alphamerge" \
-pix_fmt rgba cut/$1.png
cwebp -quiet -q 90 -sharp_yuv -alpha_q 100 -m 5 cut/$1.png -o ../../public/demos/shadowbox/frames/$1.webp
ls raw | sed 's/\.png//' | xargs -P 8 -n 1 ./enc-cut.sh
# Product shot: cut out with cutout.swift, square crop with air, 1400 px
ffmpeg -i glove-cut.png -vf "crop=1700:1700:155:173,scale=1400:1400:flags=lanczos" glove-sq.png
cwebp -q 90 -sharp_yuv -alpha_q 100 glove-sq.png -o glove.webp
# Grade (grade.mjs): every frame and the poster as a black-and-white ringside photo, only the red leather in colour
ls frames | xargs -P 8 -I{} node grade.mjs frames/{} graded/{}
node grade.mjs poster-cut.webp assets/poster-cut.webp
# Product shot: clean edge for black and paper (rim.mjs)
node rim.mjs glove.webp assets/glove.webp// matte.swift — writes a white+alpha matte PNG for every frame in a folder (macOS Vision, macOS 14+)
// swiftc -O -o matte matte.swift && ./matte raw/ mattes/
import Foundation
import Vision
import CoreImage
import ImageIO
import UniformTypeIdentifiers
let args = CommandLine.arguments
let inDir = URL(fileURLWithPath: args[1]), outDir = URL(fileURLWithPath: args[2])
try? FileManager.default.createDirectory(at: outDir, withIntermediateDirectories: true)
let files = try FileManager.default.contentsOfDirectory(atPath: inDir.path).filter { $0.hasSuffix(".png") }.sorted()
let ctx = CIContext()
let white = CIImage(color: .white)
for name in files {
let input = CIImage(contentsOf: inDir.appendingPathComponent(name))!
let handler = VNImageRequestHandler(ciImage: input)
let request = VNGenerateForegroundInstanceMaskRequest()
var out: CIImage
do {
try handler.perform([request])
if let result = request.results?.first {
let mask = CIImage(cvPixelBuffer: try result.generateScaledMaskForImage(forInstances: result.allInstances, from: handler))
out = white.cropped(to: input.extent).applyingFilter("CIBlendWithMask", parameters: [
kCIInputBackgroundImageKey: CIImage.empty(), kCIInputMaskImageKey: mask,
])
} else {
out = CIImage.empty().cropped(to: input.extent)
}
} catch {
out = CIImage.empty().cropped(to: input.extent)
}
let cg = ctx.createCGImage(out, from: input.extent, format: .RGBA8, colorSpace: CGColorSpace(name: CGColorSpace.sRGB)!)!
let dest = CGImageDestinationCreateWithURL(outDir.appendingPathComponent(name) as CFURL, UTType.png.identifier as CFString, 1, nil)!
CGImageDestinationAddImage(dest, cg, nil)
CGImageDestinationFinalize(dest)
}
print("mattes:", files.count)// track.mjs — per-frame glove tracking, bear box, edge colours and punch hits.
// node track.mjs raw/ mattes/ > track.json (sharp from the repo's node_modules)
import sharp from "sharp";
import { readdirSync } from "node:fs";
import { join } from "node:path";
const [rawDir, matteDir] = process.argv.slice(2);
const W = 320, H = 180;
const files = readdirSync(rawDir).filter((f) => f.endsWith(".png")).sort();
const frames = [];
for (const f of files) {
const rgb = await sharp(join(rawDir, f)).resize(W, H, { kernel: "linear" }).removeAlpha().raw().toBuffer();
const a = await sharp(join(matteDir, f)).resize(W, H, { kernel: "linear" }).ensureAlpha().extractChannel(3).raw().toBuffer();
// Red mask (crimson leather: high R, low G, B clearly below R)
const red = new Uint8Array(W * H);
for (let i = 0; i < W * H; i++) {
const r = rgb[i * 3], g = rgb[i * 3 + 1], b = rgb[i * 3 + 2];
red[i] = r > 28 && r > g * 1.8 && r > b * 1.45 && a[i] > 60 ? 1 : 0;
}
// Connected components (4-neighbourhood)
const lab = new Int32Array(W * H).fill(-1), comps = [];
for (let i = 0; i < W * H; i++) {
if (!red[i] || lab[i] >= 0) continue;
const c = { n: 0, sx: 0, sy: 0, x0: W, x1: 0, y0: H, y1: 0 }, stack = [i];
lab[i] = comps.length;
while (stack.length) {
const j = stack.pop(), x = j % W, y = (j / W) | 0;
c.n++; c.sx += x; c.sy += y;
if (x < c.x0) c.x0 = x; if (x > c.x1) c.x1 = x; if (y < c.y0) c.y0 = y; if (y > c.y1) c.y1 = y;
for (const k of [j - 1, j + 1, j - W, j + W]) {
if (k < 0 || k >= W * H || !red[k] || lab[k] >= 0) continue;
if ((k === j - 1 && x === 0) || (k === j + 1 && x === W - 1)) continue;
lab[k] = comps.length; stack.push(k);
}
}
comps.push(c);
}
// Bear box and centre from the matte
let n = 0, sx = 0, sy = 0, x0 = W, x1 = 0, y0 = H, y1 = 0;
for (let i = 0; i < W * H; i++) if (a[i] > 128) {
const x = i % W, y = (i / W) | 0; n++; sx += x; sy += y;
if (x < x0) x0 = x; if (x > x1) x1 = x; if (y < y0) y0 = y; if (y > y1) y1 = y;
}
const bear = n ? { cx: sx / n / W, cy: sy / n / H, x0: x0 / W, x1: (x1 + 1) / W, y0: y0 / H, y1: (y1 + 1) / H } : null;
// Waistband candidate: the largest flat, wide red component
const wide = comps.filter((c) => { const w = c.x1 - c.x0 + 1, h = c.y1 - c.y0 + 1; return w / h > 2.6 && w > 18; }).sort((p, q) => q.n - p.n)[0];
const band = wide ? { x0: wide.x0 / W, x1: (wide.x1 + 1) / W, y0: wide.y0 / H, y1: (wide.y1 + 1) / H } : null;
// Edge colours: left and right 2-px columns
const edge = (x) => { let r = 0, g = 0, b = 0; for (let y = 0; y < H; y++) for (let d = 0; d < 2; d++) { const i = (y * W + x + d) * 3; r += rgb[i]; g += rgb[i + 1]; b += rgb[i + 2]; } const k = H * 2; return [r / k, g / k, b / k].map(Math.round); };
const top = (() => { let r = 0, g = 0, b = 0; for (let x = 0; x < W; x++) for (let d = 0; d < 2; d++) { const i = (d * W + x) * 3; r += rgb[i]; g += rgb[i + 1]; b += rgb[i + 2]; } const k = W * 2; return [r / k, g / k, b / k].map(Math.round); })();
frames.push({ bear, comps, band, edge: [edge(0), edge(W - 2), top] });
}
// Pass 2: fill missing waistbands from neighbours, then drop every red piece that lies on the band
for (let i = 0; i < frames.length; i++) {
if (frames[i].band) continue;
let a = i - 1, b = i + 1;
while (a >= 0 && !frames[a].band) a--;
while (b < frames.length && !frames[b].band) b++;
const A = frames[a]?.band, B = frames[b]?.band;
if (A && B) { const t = (i - a) / (b - a); frames[i].band = Object.fromEntries(Object.keys(A).map((k) => [k, A[k] + (B[k] - A[k]) * t])); }
else frames[i].band = A || B || null;
}
for (const fr of frames) {
const bd = fr.band, padY = bd ? (bd.y1 - bd.y0) * 0.9 + 0.012 : 0;
fr.blobs = fr.comps
.filter((c) => c.n >= 25)
.filter((c) => {
if (!bd) return true;
const cx = c.sx / c.n / W, cy = c.sy / c.n / H, w = c.x1 - c.x0 + 1, h = c.y1 - c.y0 + 1;
if (w / h > 2.6 && w > 18) return false;
const onBand = cy > bd.y0 - padY && cy < bd.y1 + padY && cx > bd.x0 - 0.03 && cx < bd.x1 + 0.03;
return !onBand;
})
.sort((p, q) => q.n - p.n).slice(0, 2)
.map((c) => ({ x: c.sx / c.n / W, y: c.sy / c.n / H, s: c.n / (W * H) }));
}
// Two glove tracks: A starts on screen-left, B on screen-right; match by distance, hold when missing
const T = [[], []];
let prev = null;
for (const fr of frames) {
const b = fr.blobs;
let next;
if (!prev) next = b.length === 2 ? [...b].sort((p, q) => p.x - q.x) : [b[0], b[0]];
else if (b.length === 2) {
const d0 = Math.hypot(b[0].x - prev[0].x, b[0].y - prev[0].y) + Math.hypot(b[1].x - prev[1].x, b[1].y - prev[1].y);
const d1 = Math.hypot(b[1].x - prev[0].x, b[1].y - prev[0].y) + Math.hypot(b[0].x - prev[1].x, b[0].y - prev[1].y);
next = d0 <= d1 ? [b[0], b[1]] : [b[1], b[0]];
} else if (b.length === 1) {
const d0 = Math.hypot(b[0].x - prev[0].x, b[0].y - prev[0].y), d1 = Math.hypot(b[0].x - prev[1].x, b[0].y - prev[1].y);
next = d0 <= d1 ? [b[0], { ...prev[1], held: true }] : [{ ...prev[0], held: true }, b[0]];
} else next = [{ ...prev[0], held: true }, { ...prev[1], held: true }];
T[0].push(next[0]); T[1].push(next[1]);
prev = next;
}
// Occluded stretches: interpolate between the surrounding confident positions instead of holding
for (const t of T) {
for (let i = 0; i < t.length; i++) {
if (!t[i].held) continue;
let a = i - 1, b = i;
while (b < t.length && t[b].held) b++;
if (a >= 0 && b < t.length) for (let k = i; k < b; k++) { const u = (k - a) / (b - a); t[k] = { x: t[a].x + (t[b].x - t[a].x) * u, y: t[a].y + (t[b].y - t[a].y) * u, s: t[a].s + (t[b].s - t[a].s) * u, held: true }; }
i = b;
}
}
// Extension per glove: distance from the bear's centre in bear heights, plus growth in apparent size (jab at the camera)
const ext = [0, 1].map((g) => T[g].map((p, i) => {
const br = frames[i].bear; if (!br) return 0;
const bh = br.y1 - br.y0, rest = 0.0016 * (bh / 0.9) ** 2;
return Math.hypot((p.x - br.cx) * (16 / 9), p.y - br.cy) / bh + 0.6 * Math.max(0, p.s / rest - 1);
}));
const hits = [];
for (let g = 0; g < 2; g++) {
const e = ext[g];
for (let i = 4; i < e.length - 3; i++) {
const win = e.slice(i - 4, i + 4);
if (e[i] !== Math.max(...win)) continue;
const rise = e[i] - Math.min(...e.slice(i - 6 < 0 ? 0 : i - 6, i));
if (rise > 0.12 && !T[g][i].held) hits.push({ f: i, g, e: +e[i].toFixed(3), rise: +rise.toFixed(3) });
}
}
hits.sort((p, q) => p.f - q.f);
const r3 = (v) => +v.toFixed(3);
console.log(JSON.stringify({
frames: frames.length,
gloves: T.map((t) => t.map((p) => [r3(p.x), r3(p.y), +(p.s * 1000).toFixed(2)])),
bear: frames.map((f) => f.bear && [r3(f.bear.cx), r3(f.bear.cy), r3(f.bear.x0), r3(f.bear.x1), r3(f.bear.y0), r3(f.bear.y1)]),
edge: frames.map((f) => f.edge),
hits,
}));
// ── final.mjs: curated hits + smoothed tracks → track.json ──
// final.mjs — curated hits + smoothed tracks → public/demos/shadowbox/track.json
import { readFileSync, writeFileSync } from "node:fs";
const t = JSON.parse(readFileSync("track-raw.json", "utf8"));
const N = t.frames;
// Hits: frame of full extension, checked by eye on contact sheets
const HITS = [[39, "JAB"], [56, "CROSS"], [73, "HOOK"], [101, "JAB"], [110, "BODY SHOT"], [137, "CROSS"], [166, "JAB"], [186, "CROSS"], [219, "FINISHER"]];
// Smooth each glove track: median of 3, then a 5-tap weighted mean (keeps punch peaks, drops jitter)
const med3 = (a, i, k) => [a[Math.max(0, i - 1)][k], a[i][k], a[Math.min(N - 1, i + 1)][k]].sort((x, y) => x - y)[1];
const smooth = (tr) => {
const m = tr.map((_, i) => [med3(tr, i, 0), med3(tr, i, 1), med3(tr, i, 2)]);
const w = [1, 2, 3, 2, 1];
return m.map((_, i) => [0, 1, 2].map((k) => { let s = 0, ws = 0; for (let d = -2; d <= 2; d++) { const j = Math.min(N - 1, Math.max(0, i + d)); s += m[j][k] * w[d + 2]; ws += w[d + 2]; } return +(s / ws).toFixed(3); }));
};
const g = t.gloves.map(smooth);
// Which glove throws each punch: the one farther from the bear's centre at the peak (raw positions)
const hits = HITS.map(([f, name]) => {
const b = t.bear[f];
const d = [0, 1].map((k) => Math.hypot((t.gloves[k][f][0] - b[0]) * 16 / 9, t.gloves[k][f][1] - b[1]) + t.gloves[k][f][2] / 40);
const k = d[0] >= d[1] ? 0 : 1;
return { f, name, g: k, x: t.gloves[k][f][0], y: t.gloves[k][f][1] };
});
const bear = t.bear.map((b) => b.map((v) => +v.toFixed(3)));
const out = { n: N, fps: 24, w: 1280, h: 720, g: g.map((tr) => tr.map((p) => [p[0], p[1]])), bear, edge: t.edge, hits };
writeFileSync("../../public/demos/shadowbox/track.json", JSON.stringify(out));
console.log(JSON.stringify(hits));// grade.mjs — black-and-white ringside grade, the crimson leather keeps its colour.
// node grade.mjs <in.webp> <out.webp> (sharp from the repo's node_modules)
import sharp from "sharp";
const [,, src, dst] = process.argv;
const { data, info } = await sharp(src).ensureAlpha().raw().toBuffer({ resolveWithObject: true });
const { width: W, height: H } = info, n = W * H;
const cl = (x) => (x < 0 ? 0 : x > 1 ? 1 : x);
// Tone curve: lifted blacks cut, a gentle S, highlights held below paper white
const curve = (x) => { x = cl((x - 0.04) / 0.98); x = Math.pow(x, 1.3); return (x * x * (3 - 2 * x) * 0.5 + x * 0.5) * 0.94; };
// 1 px alpha erosion: drops the light rim the matte leaves on the fur
const a0 = new Uint8Array(n); for (let i = 0; i < n; i++) a0[i] = data[i * 4 + 3];
for (let y = 0; y < H; y++) for (let x = 0; x < W; x++) {
let m = 255;
for (let dy = -1; dy <= 1; dy++) for (let dx = -1; dx <= 1; dx++) {
const yy = y + dy, xx = x + dx; if (yy < 0 || yy >= H || xx < 0 || xx >= W) continue;
const v = a0[yy * W + xx]; if (v < m) m = v;
}
data[(y * W + x) * 4 + 3] = m;
}
for (let i = 0; i < n; i++) {
const o = i * 4, r = data[o] / 255, g = data[o + 1] / 255, b = data[o + 2] / 255;
const Lc = curve(0.3 * r + 0.59 * g + 0.11 * b);
// Only clearly red pixels keep their own colour and light, dark red too
const mx = Math.max(r, g, b), red = mx > 0.06 ? cl(((r - Math.max(g, b)) / mx - 0.35) * 2.5) : 0;
const grain = data[o + 3] ? (Math.random() - 0.5) * 0.035 : 0; // fine film grain, only on the subject
data[o] = Math.round(255 * cl(Lc + (r - Lc) * red + grain));
data[o + 1] = Math.round(255 * cl(Lc + (g - Lc) * red + grain));
data[o + 2] = Math.round(255 * cl(Lc + (b - Lc) * red + grain));
}
await sharp(data, { raw: { width: W, height: H, channels: 4 } }).webp({ quality: 90, alphaQuality: 100, smartSubsample: true, effort: 5 }).toFile(dst);
// rim.mjs — cleans the product shot's edge for black and for paper. Same frame as above;
// instead of the grade: erode the alpha by 2 px (R = 2 in the loop above), then
for (let i = 0; i < n; i++) {
const o = i * 4, a = data[o + 3];
if (a === 0 || a === 255) continue;
const k = 255 / a; // the cut-out was shot on black: un-premultiply, so no dark halo shows on paper
data[o] = Math.min(255, data[o] * k); data[o + 1] = Math.min(255, data[o + 1] * k); data[o + 2] = Math.min(255, data[o + 2] * k);
}
// and every pixel within 6 px of the edge that is not clearly red leather (the blue-violet rim light) goes neutral
for (let i = 0; i < n; i++) {
const o = i * 4, r = data[o], g = data[o + 1], b = data[o + 2], L = 0.3 * r + 0.59 * g + 0.11 * b;
let k = Math.min(1, Math.max(0, (b - Math.max(r, g)) / 40));
if (nearEdge[i] && b > g + 6 && (r - Math.max(g, b)) / r < 0.45) k = 1;
data[o] = r + (L - r) * k; data[o + 1] = g + (L - g) * k; data[o + 2] = b + (L - b) * k;
}Build one page with plain HTML, CSS and vanilla JavaScript (no framework, no build step, no libraries): a header plus a full-screen scroll hero called "Shadowbox" for the fictional boxing glove brand "Urvo" and its glove "Polar 16". A polar bear shadowboxes one round as you scroll; at the end the camera dollies into its glove and the product stands in colour out of the dark. Inline <style> is fine; scripts live in boot.js (in <head>) and shadowbox.js (end of body) — the page runs under a CSP without 'unsafe-inline' for scripts. Everything self-hosted.
ASSETS
- frames/000.webp … 240.webp: the Kling clip (24 fps, 10 s), every frame cut out and graded black and white, only the red leather in colour — RGBA 1280 × 720, the bear only.
- track.json: per frame the two glove positions g[0|1][i] = [x, y] (0–1 of the frame), the bear box bear[i] = [cx, cy, x0, x1, y0, y1], and nine hits {f, name, g, x, y} (JAB 39, CROSS 56, HOOK 73, JAB 101, BODY SHOT 110, CROSS 137, JAB 166, CROSS 186, FINISHER 219).
- assets/poster-cut.webp (frame 0, same grade), assets/glove.webp (product shot in full colour, 1400 × 1400, transparent), assets/archivo-latin.woff2 (variable: weight 100–900, width 62–125 %).
LOOK — a fight bill and a ringside photograph, nothing else
--bg #0b0b0b, --step #161616 (the one tone step for quiet surfaces), --ink #efeeeb, --mute 68 % ink, --dim 42 % ink, --red #b4121e (sampled from the glove); for the finale --paper #efeeeb and --paper-2 #e2e0dc. The red is the only colour on the page: the gloves, the buy buttons, the current punch, the chosen weight. No gradients, no glow, no grain overlay, no shadows, no hairlines, no blur, no pills, no icons, no small uppercase labels, no index numbers. Archivo only: display at weight 900, width 62 % (condensed, like wood type on a fight poster), uppercase; running text in sentence case at 14–22px. Buttons are flat, square and speak the bill's type: condensed 900 uppercase at 20–30px, never a small sans label. One outer margin --m = clamp(16px, 3.4vw, 48px) everywhere.
HEADER (fixed): "URVO" left (26px, 850, width 72 %), a square red button "BUY POLAR 16" right. Nothing else. On the finale's paper the wordmark turns black.
STAGE (720svh, a sticky 100svh viewport inside), layers bottom to top
1. h1 "POLAR 16" as real text behind the bear: "POLAR" flush with the left margin, "16" flush with the right, one line at every width; JS sets the font size so both words plus a tenth of gap fill the width between the margins. Every letter its own span (for the springs).
2. #fg canvas: the cut-out bear. Clip rect = 16:9, centred; height eases from min(82 % H, 800px) at frame 0 to min(66 % H, 580px) at frame 240, so the softer full-body frames are shown smaller, never enlarged. The scorecard band (84px, phones 68px) crops the clip's lower edge at the start; the clip rises with the same easing until the feet stand on the band at frame 240. Phones: height from min(105vw, 60svh) to 84 % of that, following the smoothed bear centre sideways. Canvas backing store = CSS size × min(devicePixelRatio, 2).
3. Copy: bottom left above the band, "A 16 oz sparring glove in full-grain leather, stitched by hand." and, in --mute, "Scroll to go one round in it." (fades out over frames 2–12). Mid-round panel (frames 98–136), bottom right: h2 "Sixteen ounces, / stitched by hand" (condensed, 40–56px) and one sentence. Phones: both directly under the product name.
4. Finale (see below).
THE ROUND (fixed band at the bottom, the page's ground colour)
Left "Round one 4 of 9". Then the nine punches as an ordered list of buttons in sentence case (Jab, Cross, Hook, Jab, Body shot, Cross, Jab, Cross, Finisher), each with a 3px top bar: --step before it is thrown, ink once thrown, red for the latest. A click scrolls smoothly to just past that punch. Right a --step button "NEXT PUNCH Space" — the space bar does the same; after the last punch it goes to the product. Phones show only "Body shot 5 of 9" and "Next punch". The band fades out once the finale starts.
LOADING AND DRAWING
- Load order coarse to fine: 0, 240, then every 32nd, 16th, 8th, 4th, 2nd, 1st frame; frames within ±10 of where the user scrubs jump the queue. 6 fetches in flight. Phones load only even frames.
- Decode with createImageBitmap into an LRU window (40 desktop, 30 phone), evicting the frame farthest from the playhead; prefetch 14 ahead in the scroll direction, 3 behind. If a frame is not decoded yet, draw the nearest one within 14.
- One eased playhead in "virtual frames": target = scroll progress × 240 / 0.7 (the fight fills the first 70 % of the stage, the rest is the finale). cur += (target − cur) × (1 − 0.87^(dt / 16.7 ms)).
- While the playhead moves, draw frame floor(cur) and the next one on top at the fractional alpha; at rest (|target − cur| < 0.35) draw one single rounded frame — never a permanent blend.
- Redraw only when the frame pair, the blend (2 decimals), the rect or the viewport changes. The loop runs only while something is moving. The product name skews a little with the scroll speed (max 4°).
HITS
When the playhead crosses a hit frame going forward (at most one every 330 ms): a 4u shake of the scene (9u for the finisher), and the letters of the product name near the punch get a spring impulse (k 190, damping 13). The scorecard marks the punch. No rings, no labels on the picture.
FINALE — a match cut through black (R = progress over virtual frames 248–322)
1. Push-in (R 0–.46): the bear canvas scales up to 2.9× around the tracked lead glove of frame 240 (transform-origin = its screen position, smoothstep², ease-in) and fades out over R .04–.32. The product name fades out and drifts up 28px.
2. The weight as a figure (R .4–.7): the chosen weight ("16") huge on the black, centred, condensed 900, min(96svh, 62vw), in #1e1e1e — one tone step above the ground, a backdrop, not a headline.
3. The card (R .3–.56): a small --paper product card, 380px wide (phones up to 400px between the margins), centred in front of the figure. It rises 70px and unfolds upwards (clip-path inset from the bottom). Its height follows the content; width and position come from JS so the glove can be placed against it.
4. The glove lands (R .5–.86), outside the card in the DOM so nothing clips it: the product shot in full colour, 94 % of the card width (phones 86 %), comes in from above right like a punch — scale 1.25 → 1, rotation −28° → −9° — and lands in the card's top area (padding-top = 60 % of its size), the leather poking about a quarter of its height over the card's upper edge. The card sits low enough that the glove never reaches under the header. It stays still afterwards.
5. Copy (R .62–.96) inside the card, staggered by .04, black on paper: "POLAR 16" (condensed, 48px), one muted line ("Full-grain leather, three-layer foam core, crimson only."), the weight picker, the buy button, "Free returns for 30 days."
Weight picker: three radio figures 12 / 14 / 16 set like the bill (44px condensed 900) on the scorecard's 3px bar, then "OZ". Unchosen grey, chosen black with a red bar. Choosing one swaps the big figure (it slides up into place), scales the glove (12 oz .86, 14 oz .93, 16 oz 1, CSS transition) and relabels the button.
Buy button: full width of the card, 56px, red, "ADD 16 OZ TO BAG" left and "€149" right in the same condensed type.
OPENING AND ACCESSIBILITY
boot.js adds .js always and .intro .motion unless prefers-reduced-motion; [data-in] elements are hidden only under .intro (CSS failsafe reveals them after 3.5 s). After fonts are ready (max 900 ms): letters rise from translateY(50%) staggered 45 ms, copy lines from 100 %, header items and the band slide in — Web Animations with fill backwards, cancelled when finished.
Reduced motion: no stage scroll (100svh), no frames loaded, the graded poster with the product name behind it, no panel, no band, no finale. No horizontal scroll at any width.Was die Demo zeigt
- Das Video ist beim Bauen in 241 Einzelbilder zerlegt und je Frame freigestellt (macOS Vision); der Studiohintergrund wird nie gezeichnet, der Bär steht auf dem Schwarz der Seite
- Jeder Frame ist schwarzweiß bearbeitet wie ein Foto am Ring, mit feinem Korn; nur rotes Leder behält seine Farbe. Rot ist die einzige Farbe der Seite: Handschuhe, Kauf-Button, der aktuelle Schlag
- Gezeigt wird nahe der echten Auflösung und zum Ende hin kleiner — die weicheren Ganzkörper-Frames werden verkleinert, nie vergrößert; das Canvas rendert in voller Geräteauflösung
- Geladen wird grob zu fein (jeder 32., dann 16. Frame …), Nachbar-Frames werden nur während der Bewegung überblendet — in Ruhe steht immer ein einzelner, scharfer Frame
- Der Produktname steht als echter Text hinter dem Bären, schmal und schwer wie Holzlettern auf einem Kampfplakat, und füllt bei jeder Breite genau die Seite
- Neun Treffer sind die Frames der vollen Streckung: Das Bild ruckt kurz, die Buchstaben in der Nähe federn nach, und der Punktzettel unten hakt den Schlag ab. Jeder Schlag ist anklickbar
- Finale als Match-Cut: Zoom in den getrackten Handschuh, Abblende ins Schwarz, dann faltet sich eine kleine Produktkarte von unten auf, dahinter steht das Gewicht riesig in Plakatschrift. Der Handschuh landet in der Karte und ragt oben heraus; 12, 14 oder 16 oz tauschen die Zahl, die Handschuhgröße und den Kauf-Button
- Natürliches Scrollen ohne Kapern; bei „Bewegung reduzieren“ steht das Standbild vor dem Produktnamen
Woher Bilder und Bewegung kommen
- Marke, Produkt und Angaben sind erfunden.
- Startbild und Produktfoto KI-generiert (Higgsfield, Soul 2), Bewegung KI-generiert (Kling 3.0, 10 s). Freisteller je Frame mit macOS Vision, Schwarzweiß-Bearbeitung per Script, Handschuh-Tracking per Farbanalyse; die Treffer-Frames sind von Hand geprüft.


