Find code by asking what it does. A CLI for coding agents that uses Jev to discover relevant files and source context.
TypeScript ai-sdkclaude-codeclicode-searchcodexcoding-agentscontext-retrievaldeveloper-toolsjevsemantic-searchtypescriptvercel-ai-gateway
Rebuild the 0.5 launch film from scratch as a paper-mountain showreel
David Zhang71902f7f98ea
diff --git a/video/README.md b/video/README.mdindex 4c78062..5fe0aef 100644--- a/video/README.md+++ b/video/README.md@@ -1,4 +1,3 @@# Release film-[`release/`](release/) is the current standalone production. The previous video-projects and generated assets were removed before this rebuild.+[`release/`](release/) is the Jevgrep 0.5 launch film, a standalone Remotion project.diff --git a/video/release/DIRECTION.md b/video/release/DIRECTION.mddeleted file mode 100644index 66da261..0000000--- a/video/release/DIRECTION.md+++ /dev/null@@ -1,18 +0,0 @@-# Short release cut--Keep the statistic brief, use the middle to explain the savings, and end on-installation. Maintain a dark, stable background with upright type. Beat accents-move objects; they never turn the whole screen red.--| Main time | Purpose and action |-| --- | --- |-| 0–2.5s | Introduce Jevgrep 0.5 with the title reframe. |-| 2.5–5s | The cost bar breaks apart; show 59% less Jev API cost and same performance. |-| 5–9s | Scan compact previews; expand a selected source rather than opening every file. |-| 9–13.5s | Merge repeated relevance criteria into one shared brief containing a larger code batch. |-| 13.5–18s | End directly on npm installation, authentication, and skill installation. |--The 59% shot is half its previous duration. The two mechanism shots follow the-accepted release architecture: preview-based admission, larger declaration-batches, and shared question criteria. The batch count is an upper bound.-Supporting benchmark details remain in the README, not in the frames.diff --git a/video/release/README.md b/video/release/README.mdindex fb98a6b..119e35c 100644--- a/video/release/README.md+++ b/video/release/README.md@@ -1,52 +1,51 @@-# Jevgrep 0.5 — magnetic search field+# Jevgrep 0.5 release film-An 18-second release film: a brief cost result, two concrete savings mechanisms,-and the installation commands. Previews avoid unnecessary full reads; larger-code batches share one relevance brief. Local object motion follows the beat,-with no full-screen red wash, edge pulse or red wipe.+A 22-second, beat-driven launch film. The repo is a mountain of paper files;+`jg` core-drills previews instead of opening everything, judges a whole batch+under one shared brief, hands back verbatim source, and the Jev API cost tower+loses 59% of its coins. Ends on the install commands and the 0.5 lockup.-This standalone package is outside the CLI workspace. Node.js 24 and ffmpeg are-required. From this directory:+Standalone package (outside the CLI workspace). Node.js 24 and ffmpeg required.```shnpm ci-npm run music+npm run music # synthesize public/score.wav from src/timeline.tsnpm run studio-npm run draft-npm run stills-npm run render+npm run draft # half-res preview+npm run stills # review frames, impact frames, key art, thumbnail into out/+npm run render # master: 1080p60, H.264 CRF 14, 320k AAC -> out/jevgrep-0.5-short.mp4npm run check-types```-The master is `out/jevgrep-0.5-short.mp4`, rendered at 1080p60 with H.264 CRF 14 and-320k AAC. Generated media and dependencies are ignored. Font licenses accompany-the vendored Anton and IBM Plex Mono files.--## Sound and motion are one schedule--`src/timeline.ts` defines beats, accents and scene cues. Both the synthesized-score and picture consume its events. Kick and snare envelopes drive visible-scene effects continuously; accents drive the larger transformations. The-0.3-second thumbnail pre-roll shifts picture and sound together.--Review every shot and the before/on/after-impact sequences. A pretty still is-not evidence of dynamic motion. `npm run stills` captures both sets plus key art.-Check audio loudness and its spectrogram; audio is measured, not auditioned.--## Claim sources--The [retained benchmark report](../../evals/results/combined-cost-research-2026-09-28.md)-compares the saved 0.4.3 cohort with the accepted 0.5 strategy. Estimated native-Jev API cost is 59.24% lower, rounded to 59%; coding-agent costs are outside that-headline. Both versions solved 8/10 of the same ten tuned Python SWE-bench tasks.-“Same performance” refers to those task results, not speed or statistical-equivalence. Native prices are estimates, including a conservative allowance-for 19 missing responses. Methodology stays in these supporting docs, not in-the marketing frames.--The opening thumbnail reproduces an installed-CLI search run on this repository:-`jg "How are previews used to decide which files to open?" packages/core`.-It returned 17 files; the displayed first three paths are followed by an-ellipsis. Source-strip artwork illustrates retrieval rather than a literal-inventory of every request. The install sequence includes authentication and-the official skill because agents need that setup to use the CLI.+## Sound and picture share one schedule++`src/timeline.ts` owns every event time (beats, stabs, tag pops, verdicts, coin+drops, keystrokes, impacts, risers, whips). Scenes read it for motion and+`scripts/score.mjs` reads it to synthesize the music and effects, so hits land+on hits. Times are "main time"; a 0.3 s pre-roll holds the opening frame (the+social preview: wordmark, 0.5, and a finished `jg` run) and shifts picture and+sound together.++Generated audio, renders and stills are ignored. Fraunces and IBM Plex Mono are+vendored with their OFL licenses. Audio was verified by measurement (−13.7 LUFS+integrated, −0.8 dBFS peak, spectrogram impacts at cue times), not by ear.++## Claim sources (kept out of the film)++- **59% less Jev API cost** — [combined-cost research](../../evals/results/combined-cost-research-2026-09-28.md):+ estimated native Jev API cost, 0.5.0 candidate vs. the saved 0.4.3 cohort+ (59.24%, rounded). Native prices are list-price estimates with a conservative+ allowance for 19 responses with missing usage.+- **Same tasks solved (8/10 and 8/10)** — same report; the same ten tuned Python+ SWE-bench tasks. Not a speed claim and not a statistical equivalence claim.+- **Not claimed:** total coding-agent cost. The report records combined+ Sol-plus-Jev cost 2–3% higher, accepted for this release, so the film says+ "Jev API cost" only.+- **Mechanisms shown** — previews decide which files open, larger declaration+ batches, one shared question brief ([architecture](../../docs/architecture.md)).+ Drill and stamp counts are illustration, not statistics.+- **Opening terminal** — a real run, `jg "How are previews used to decide which+ files to open?" packages/core` with jg 0.5.0 on this repo: 17 relevant files;+ first three paths shown.+- **Install commands** — `npm install -g @dzhng/jevgrep`, `jg auth`, `jg skill`+ as documented in the root README.diff --git a/video/release/REVIEW.md b/video/release/REVIEW.mddeleted file mode 100644index 1bfc8ae..0000000--- a/video/release/REVIEW.md+++ /dev/null@@ -1,26 +0,0 @@-# Short cut review--The 18-second revision removes full-screen red washes, pulsing edge light,-expanding red rings and red wipes. Only local source, scanner and cost-fragment-motion follows the beat. The cost shot lasts 2.5 seconds, followed by concrete-preview-admission and shared-brief batching illustrations. The final 4.5 seconds-are reserved for installation, authentication and skill setup.--A fresh reviewer inspected all 17 chronological frames and the impact sheets.-No blocking layout or legibility issue was found. The before/after mechanisms-were clear and no full-screen red wash appeared in the captures.--The preview and batch claims were checked against the retained benchmark report-and the production shared-criteria request builder and 128-unit batch limit.-Methodology remains outside the marketing frames. Type checking passes.--Audio is verified by measurement and spectrogram, not by ear. Final encoded-media metadata and loudness readings live in ignored out/.--Independent code review found duplicate accents when the installation and final-scene share a timestamp. Accent times are now deduplicated; all 13 are unique.--Final encoded-frame review accepted the batch layout, thumbnail and installation-ending with no blockers. The master is 1,098 frames at 1080p60 (18.3 seconds-including thumbnail hold). AAC measures −13.2 LUFS and −1.2 dBFS true peak;-audio was checked by measurement, not by ear.diff --git a/video/release/package.json b/video/release/package.jsonindex c830302..6687a33 100644--- a/video/release/package.json+++ b/video/release/package.json@@ -1 +1,25 @@-{"name":"jevgrep-release-film","private":true,"type":"module","scripts":{"studio":"remotion studio src/index.tsx","music":"node scripts/score.mjs","render":"npm run music && remotion render src/index.tsx Release out/jevgrep-0.5-short.mp4 --crf=14 --x264-preset=slow --audio-bitrate=320k --concurrency=4","draft":"npm run music && remotion render src/index.tsx Release out/draft.mp4 --scale=.5 --crf=20 --concurrency=4","stills":"node scripts/stills.mjs","check-types":"tsc --noEmit"},"dependencies":{"@remotion/cli":"4.0.529","remotion":"4.0.529","react":"^19.3.0","react-dom":"^19.3.0"},"devDependencies":{"@types/react":"^19.3.0","typescript":"^5.9.3"}}+{+ "name": "jevgrep-release-film",+ "private": true,+ "type": "module",+ "scripts": {+ "studio": "remotion studio src/index.tsx",+ "music": "node scripts/score.mjs",+ "render": "npm run music && remotion render src/index.tsx Release out/jevgrep-0.5-short.mp4 --crf=14 --x264-preset=slow --audio-bitrate=320k --concurrency=4",+ "draft": "npm run music && remotion render src/index.tsx Release out/draft.mp4 --scale=.5 --crf=20 --concurrency=4",+ "stills": "node scripts/stills.mjs",+ "check-types": "tsc --noEmit"+ },+ "dependencies": {+ "@remotion/cli": "4.0.529",+ "remotion": "4.0.529",+ "react": "^19.3.0",+ "react-dom": "^19.3.0",+ "@remotion/bundler": "4.0.529",+ "@remotion/renderer": "4.0.529"+ },+ "devDependencies": {+ "@types/react": "^19.3.0",+ "typescript": "^5.9.3"+ }+}\ No newline at end of filediff --git a/video/release/public/fonts/Anton.ttf b/video/release/public/fonts/Anton.ttfdeleted file mode 100644index 4d65707..0000000Binary files a/video/release/public/fonts/Anton.ttf and /dev/null differdiff --git a/video/release/public/fonts/Fraunces.ttf b/video/release/public/fonts/Fraunces.ttfnew file mode 100644index 0000000..8210f94Binary files /dev/null and b/video/release/public/fonts/Fraunces.ttf differdiff --git a/video/release/public/fonts/LICENSE-Anton.txt b/video/release/public/fonts/LICENSE-Fraunces.txtsimilarity index 97%rename from video/release/public/fonts/LICENSE-Anton.txtrename to video/release/public/fonts/LICENSE-Fraunces.txtindex 9675f14..22fa7ce 100644--- a/video/release/public/fonts/LICENSE-Anton.txt+++ b/video/release/public/fonts/LICENSE-Fraunces.txt@@ -1,4 +1,4 @@-Copyright 2020 The Anton Project Authors (https://github.com/googlefonts/AntonFont.git)+Copyright 2018 The Fraunces Project Authors (https://github.com/undercasetype/Fraunces)This Font Software is licensed under the SIL Open Font License, Version 1.1.This license is copied below, and is also available with a FAQ at:@@ -18,7 +18,7 @@ with others.The OFL allows the licensed fonts to be used, studied, modified andredistributed freely as long as they are not sold by themselves. The-fonts, including any derivative works, can be bundled, embedded,+fonts, including any derivative works, can be bundled, embedded,redistributed and/or sold with any software provided that any reservednames are not used by derivative works. The fonts and derivatives,however, cannot be released under any other type of license. Thediff --git a/video/release/public/grain.png b/video/release/public/grain.pngnew file mode 100644index 0000000..764b0baBinary files /dev/null and b/video/release/public/grain.png differdiff --git a/video/release/scripts/captures.mjs b/video/release/scripts/captures.mjsdeleted file mode 100644index 455254e..0000000--- a/video/release/scripts/captures.mjs+++ /dev/null@@ -1,38 +0,0 @@-import { spawnSync } from 'node:child_process';-import { mkdirSync } from 'node:fs';-import { REVIEW, IMPACT_REVIEW, PRE } from '../src/timeline.ts';-const input = process.argv[2] ?? 'out/draft.mp4';-function ff(args) {- const r = spawnSync('ffmpeg', ['-y', '-loglevel', 'error', ...args], { stdio: 'inherit' });- if (r.error) throw r.error;- if (r.status !== 0) process.exit(r.status ?? 1);-}-for (const [name, times] of [- ['review', REVIEW],- ['impacts', IMPACT_REVIEW.map(t => t + PRE)],-]) {- mkdirSync(`out/${name}`, { recursive: true });- for (const [i, t] of times.entries())- ff([- '-ss',- String(t),- '-i',- input,- '-frames:v',- '1',- `out/${name}/${String(i).padStart(2, '0')}.png`,- ]);- for (let offset = 0; offset < times.length; offset += 6)- ff([- '-start_number',- String(offset),- '-i',- `out/${name}/%02d.png`,- '-vf',- 'scale=640:360,tile=3x2',- '-frames:v',- '1',- `out/${name}-${offset}.png`,- ]);-}-ff(['-i', input, '-frames:v', '1', 'out/thumbnail.png']);diff --git a/video/release/scripts/score.mjs b/video/release/scripts/score.mjsindex 31db5d4..00b1b9d 100644--- a/video/release/scripts/score.mjs+++ b/video/release/scripts/score.mjs@@ -1,143 +1,256 @@-import { EVENTS, SHOTS, PRE, DURATION, CUE } from '../src/timeline.ts';-import { mkdirSync, writeFileSync } from 'node:fs';-import { spawnSync } from 'node:child_process';-const rate = 48000,- total = Math.ceil((DURATION + PRE) * rate),- left = new Float32Array(total),- right = new Float32Array(total),- tau = Math.PI * 2;-let seed = 501;-const noise = () => ((seed = (Math.imul(seed, 1664525) + 1013904223) >>> 0) / 4294967296) * 2 - 1;-function add(time, duration, sound, pan = 0) {- const start = Math.round((time + PRE) * rate);- for (let j = 0; j < duration * rate && start + j < total; j++) {- if (start + j < 0) continue;- const value = sound(j / rate, j / (duration * rate));- left[start + j] += value * Math.sqrt((1 - pan) / 2);- right[start + j] += value * Math.sqrt((1 + pan) / 2);+// Synthesizes the score from src/timeline.ts — the same events the picture reads.+import { writeFileSync, mkdirSync } from 'node:fs';+import {+ PRE, DUR, KICKS, SNARES, HATS, IMPACTS, RISERS, WHIPS, CHORDS, STABS, TAG_POPS, VERDICTS, ASSAY, COST,+ COIN_DROPS, KEYS, INSTALL, mulberry32,+} from '../src/timeline.ts';++const SR = 48000;+const LEN = Math.ceil((PRE + DUR + 0.05) * SR);+const L = new Float32Array(LEN);+const R = new Float32Array(LEN);+const RevL = new Float32Array(LEN);+const RevR = new Float32Array(LEN);+const rng = mulberry32(2024);+const at = t => Math.round((t + PRE) * SR);+const TAU = Math.PI * 2;++function add(t, len, fn, gain = 1, pan = 0, rev = 0) {+ const s0 = at(t);+ const n = Math.floor(len * SR);+ const gl = gain * Math.cos(((pan + 1) * Math.PI) / 4);+ const gr = gain * Math.sin(((pan + 1) * Math.PI) / 4);+ for (let i = 0; i < n; i++) {+ const idx = s0 + i;+ if (idx < 0 || idx >= LEN) continue;+ const v = fn(i / SR, i);+ L[idx] += v * gl;+ R[idx] += v * gr;+ RevL[idx] += v * gl * rev;+ RevR[idx] += v * gr * rev;}}-for (const e of EVENTS) {- const gain = e.a * (e.t >= DURATION - 2 ? 0.45 : 1);- if (e.kind === 'kick') {- add(- e.t,- 0.45,- s =>- gain * 0.8 * Math.sin(tau * (43 * s + 1.9 * (1 - Math.exp(-35 * s)))) * Math.exp(-10 * s),- );- add(e.t, 0.025, s => noise() * 0.18 * Math.exp(-180 * s));- const note = [43.65, 43.65, 51.91, 38.89][Math.floor(e.t / 2) % 4];- if (e.t >= 1.5)- add(- e.t,- 0.42,- s =>- gain *- 0.25 *- Math.tanh(2 * (Math.sin(tau * note * s) + 0.35 * Math.sin(tau * note * 2 * s))) *- Math.min(1, s * 160) *- Math.exp(-7 * s),- );+const noise = () => rng() * 2 - 1;+const sine = (f, t) => Math.sin(TAU * f * t);+const saw = (f, t) => 2 * ((f * t) % 1) - 1;+const env = (t, a, d) => (t < a ? t / a : Math.exp(-(t - a) / d));++// one-pole filters -------------------------------------------------------------+const lp = c => { let y = 0; return x => (y += c * (x - y)); };+const hp = c => { let y = 0; return x => { y += c * (x - y); return x - y; }; };+const coef = f => 1 - Math.exp((-TAU * f) / SR);++// ---- sidechain duck from kicks ------------------------------------------------+const duck = new Float32Array(LEN).fill(1);+for (const k of KICKS) {+ const s0 = at(k);+ for (let i = 0; i < 0.3 * SR; i++) {+ const idx = s0 + i;+ if (idx >= LEN) break;+ duck[idx] = Math.min(duck[idx], 1 - 0.7 * Math.exp(-i / (0.09 * SR)));}- if (e.kind === 'snare')- add(- e.t,- 0.23,- s => gain * (0.3 * noise() + 0.22 * Math.sin(tau * 185 * s)) * Math.exp(-19 * s),- );- if (e.kind === 'hat') {- let previous = 0;- add(- e.t,- 0.07,- s => {- const n = noise(),- v = n - previous;- previous = n;- return gain * 0.055 * v * Math.exp(-60 * s);- },- e.t % 1 < 0.5 ? -0.6 : 0.6,- );+}+const duckBus = { L: new Float32Array(LEN), R: new Float32Array(LEN) };+function addDucked(t, len, fn, gain = 1, pan = 0) {+ const s0 = at(t);+ const n = Math.floor(len * SR);+ const gl = gain * Math.cos(((pan + 1) * Math.PI) / 4);+ const gr = gain * Math.sin(((pan + 1) * Math.PI) / 4);+ for (let i = 0; i < n; i++) {+ const idx = s0 + i;+ if (idx < 0 || idx >= LEN) continue;+ const v = fn(i / SR, i);+ duckBus.L[idx] += v * gl;+ duckBus.R[idx] += v * gr;+ }+}++// ---- instruments -----------------------------------------------------------------+const kick = (t, g = 1) =>+ add(t, 0.5, (x) =>+ Math.sin(TAU * (46 * x + 130 * 0.035 * (1 - Math.exp(-x / 0.035)))) * env(x, 0.001, 0.16) * 1.1 ++ noise() * Math.exp(-x / 0.004) * 0.25, 0.9 * g);+const snare = (t, g = 1) => {+ const f = hp(coef(1800));+ add(t, 0.4, (x) => f(noise()) * env(x, 0.001, 0.09) * 0.8 + sine(190, x) * env(x, 0.001, 0.06) * 0.5, 0.55 * g, 0, 0.35);+};+const hat = (t, g = 1, open = false) => {+ const f = hp(coef(7500));+ add(t, open ? 0.25 : 0.06, (x) => f(noise()) * env(x, 0.0005, open ? 0.07 : 0.012), 0.22 * g, (rng() - 0.5) * 0.4);+};+const bass = (t, len, freq, g = 1) => {+ const f = lp(coef(420));+ addDucked(t, len, (x) => f(saw(freq, x) * 0.7 + sine(freq / 2, x) * 0.9) * env(x, 0.006, len * 0.8) * (x > len - 0.03 ? 0 : 1), 0.5 * g);+};+const pad = (t, len, freqs, g = 1) => {+ const fl = lp(coef(1400));+ addDucked(t, len + 0.6, (x) => {+ let v = 0;+ for (const f of freqs) v += saw(f * 0.997, x) + saw(f * 1.004, x + 0.13) * 0.9;+ const a = Math.min(x / 0.5, 1) * Math.min(1, Math.max(0, (len + 0.6 - x) / 0.6));+ return fl(v / freqs.length) * a;+ }, 0.16 * g);+};+const pluck = (t, freq, g = 1, pan = 0) => {+ const f = lp(coef(3800));+ add(t, 0.5, (x) => f(saw(freq, x) * 0.5 + sine(freq * 2, x) * 0.5) * env(x, 0.002, 0.11), 0.2 * g, pan, 0.5);+};+const impact = (t, size) => {+ add(t - 0.005, 2.4, (x) => sine(38 + 30 * Math.exp(-x / 0.25), x) * env(x, 0.003, 0.7) * 1.3, 0.85 * size);+ const f = lp(coef(2500));+ add(t, 1.6, (x) => f(noise()) * env(x, 0.001, 0.35), 0.5 * size, 0, 0.7);+ add(t, 0.5, (x) => hp(coef(500))(noise()) * env(x, 0.0005, 0.03), 0.4 * size);+};+const riser = (t0, t1) => {+ const len = t1 - t0;+ let phase = 0;+ const f = (() => { let y = 0; return (x, c) => (y += c * (x - y)); })();+ add(t0, len, (x) => {+ const p = x / len;+ phase += (300 * Math.pow(6, p)) / SR;+ const n = f(noise(), coef(400 + 9000 * p * p));+ return (n * 0.9 + Math.sin(TAU * phase) * 0.15) * p * p;+ }, 0.5, 0, 0.35);+};+const whip = t => {+ const f = (() => { let y = 0; return (x, c) => (y += c * (x - y)); })();+ add(t - 0.12, 0.42, (x) => f(noise(), coef(300 + 6000 * Math.sin((Math.PI * x) / 0.42))) * Math.sin((Math.PI * x) / 0.42), 0.7, 0.3, 0.3);+};+const tick = (t, freq = 2400, g = 1) => add(t, 0.05, (x) => (hp(coef(1500))(noise()) * 0.6 + sine(freq, x) * 0.4) * env(x, 0.0004, 0.008), 0.3 * g, (rng() - 0.5) * 0.3);+const thunk = (t, g = 1) => {+ add(t, 0.3, (x) => sine(90 * Math.exp(-x * 6) + 55, x) * env(x, 0.001, 0.07) + lp(coef(2000))(noise()) * env(x, 0.0005, 0.02) * 0.6, 0.6 * g);+};+const clink = (t, g = 1) => {+ const base = 2600 + rng() * 900;+ add(t, 0.4, (x) => (sine(base, x) + sine(base * 1.51, x) * 0.6 + sine(base * 2.3, x) * 0.3) * env(x, 0.0004, 0.09), 0.15 * g, (rng() - 0.5) * 0.8, 0.4);+};+const ping = (t, freq, g = 1) => add(t, 0.8, (x) => (sine(freq, x) + sine(freq * 2.01, x) * 0.3) * env(x, 0.002, 0.25), 0.22 * g, 0, 0.6);+const stab = (t, freq, g = 1) => add(t, 0.15, (x) => saw(freq * (1 - x * 0.6), x) * env(x, 0.001, 0.03) * 0.5, 0.25 * g);++// ---- arrange ---------------------------------------------------------------------+for (const k of KICKS) kick(k, k >= 16 ? 0.9 : 1);+for (const s of SNARES) snare(s, s > 12 ? 1.1 : 0.9);+for (const h of HATS) hat(h, (Math.round(h * 4) % 2 === 1 ? 0.7 : 1) * (h >= 12 ? 0.6 : 1), Math.abs((h % 0.5) - 0.25) < 1e-6 && h < 12);+for (const i of IMPACTS) impact(i.t, i.size);+for (const [a, b] of RISERS) riser(a, b);+for (const w of WHIPS) whip(w);++// pads + bass per bar+CHORDS.forEach((c, bar) => {+ const t = bar * 2;+ if (t >= DUR) return;+ const root = c[0];+ const freqs = [root, root * c[1], root * c[2], root * 2].map(f => f * (bar < 1 ? 0.5 : 1));+ pad(t, bar >= 9 ? 3 : 2, freqs, bar < 1 ? 0.8 : 1);+ if (t >= 2 && t < 16) {+ // bass pattern: driving 8ths with a syncopated pickup, root in the low octave+ const low = root / 4;+ for (let i = 0; i < 8; i++) {+ const on = [1, 0, 1, 1, 1, 0, 1, 1][i];+ if (on) bass(t + i * 0.25 + 0.02, 0.2, i === 7 ? low * 1.5 : low, 1);+ }}- if (e.kind === 'accent') {- add(- e.t,- 0.7,- s =>- 0.26 * Math.sin(tau * (34 * s + 0.6 * (1 - Math.exp(-20 * s)))) * Math.exp(-7 * s) +- 0.12 * noise() * Math.exp(-30 * s),- );- add(- e.t,- 0.3,- s => 0.1 * (Math.sin(tau * 740 * s) + 0.5 * Math.sin(tau * 1110 * s)) * Math.exp(-17 * s),- );+ if (t >= 6 && t < 16) {+ // arpeggio: 16ths climbing the triad+ const notes = [1, c[1], c[2], 2, c[1] * 2, c[2] * 2, 2, c[2]].map(m => root * m * 2);+ for (let i = 0; i < 16; i++) if (t + i * 0.125 < 16) pluck(t + i * 0.125, notes[i % 8], 0.6 + 0.4 * (i % 4 === 0), Math.sin(i) * 0.6);}+});+// opening: clock ticks + low heart+for (let t = 0.25; t < 2.0; t += 0.25) tick(t, 1800, 0.6);+// drill stabs land on the previews: pitch climbs; ore gets a pentatonic ping+const PENT = [0, 3, 5, 7, 10, 12, 15];+let oreN = 0;+const bySt = new Map();+for (const s of STABS) (bySt.get(s.t) ?? bySt.set(s.t, []).get(s.t)).push(s);+for (const [t, list] of bySt) {+ thunk(t, 0.4);+ stab(t, 220, 0.6);+ for (const s of list) if (s.ore) { ping(t + 0.3, 440 * Math.pow(2, PENT[oreN % PENT.length] / 12), 0.8); oreN++; }}-for (let i = 0; i < DURATION * 4; i++) {- const time = i * 0.25;- if (time < CUE.claim || time > DURATION - 1.5) continue;- const notes = [220, 261.63, 329.63, 392, 329.63, 293.66, 261.63, 196];- const f = notes[i % 8];- add(- time,- 0.36,- s =>- 0.07 *- Math.sin(tau * f * s + 2 * Math.sin(tau * f * 2 * s) * Math.exp(-10 * s)) *- Math.exp(-9 * s),- Math.sin(i * 2) * 0.7,- );+// assay+TAG_POPS.forEach((t, i) => tick(t, 1500 + i * 90, 1.4));+add(ASSAY.fuse, 0.6, (x) => sine(220 * Math.pow(2, x * 0.4), x) * env(x, 0.005, 0.2), 0.3, 0, 0.5);+thunk(ASSAY.slam, 1.8);+VERDICTS.forEach((v, i) => (v.pass ? ping(v.t, 523 * Math.pow(2, PENT[i % PENT.length] / 12), 0.9) : thunk(v.t, 0.5)));+// cost: coins rain, then the cut+COIN_DROPS.forEach((t, k) => { for (let j = 0; j < 4; j++) clink(t + 0.34 + j * 0.02, 0.5 + 0.1 * k / 12); });+for (let i = 0; i < 14; i++) clink(COST.cut + 0.04 + i * 0.05, 0.9 - i * 0.04);+// install typing+KEYS.forEach((t, i) => tick(t + 0.001, 1900 + (i % 5) * 140, 0.8));+INSTALL.lines.forEach((l, i) => { if (i < 3) ping(l.t + l.text.length / l.cps + 0.02, 880 * (1 + i * 0.25), 0.7); });+// finale: sustained chord + shimmer, dot bounce+[440, 554.4, 659.3, 880, 1108].forEach((f, i) => pluck(INSTALL.dotLand - 0.5 + 0.02 * i, f, 1.4, (i - 2) * 0.3));+ping(INSTALL.dotLand, 1318, 1.2);+ping(INSTALL.dotLand + 0.22, 1760, 0.7);+pad(20, 2.4, [220, 264, 330, 440], 1.4);+thunk(INSTALL.dotLand, 0.6);+thunk(20.75, 0.6);++// ---- reverb (Schroeder) ----------------------------------------------------------+function reverb(inp) {+ const out = new Float32Array(LEN);+ const combs = [1557, 1617, 1491, 1422, 1277, 1356].map(d => ({ d, buf: new Float32Array(d), i: 0, s: 0 }));+ const aps = [225, 556, 441].map(d => ({ d, buf: new Float32Array(d), i: 0 }));+ for (let n = 0; n < LEN; n++) {+ const x = inp[n];+ let y = 0;+ for (const c of combs) {+ const r = c.buf[c.i];+ c.s = r * 0.75 + c.s * 0.25;+ c.buf[c.i] = x + c.s * 0.86;+ c.i = (c.i + 1) % c.d;+ y += r;+ }+ y /= combs.length;+ for (const a of aps) {+ const r = a.buf[a.i];+ const v = y + r * 0.5;+ a.buf[a.i] = v;+ y = r - v * 0.5;+ a.i = (a.i + 1) % a.d;+ }+ out[n] = y;+ }+ return out;}-for (const shot of SHOTS.slice(1)) {- add(- shot.at - 0.75,- 0.75,- (s, p) => 0.12 * noise() * p * p * (0.5 + 0.5 * Math.sin(tau * (300 * s + 1900 * s * s))),- );+const rl = reverb(RevL);+const rr = reverb(RevR);++// ---- mix -------------------------------------------------------------------------+const outL = new Float32Array(LEN);+const outR = new Float32Array(LEN);+for (let n = 0; n < LEN; n++) {+ outL[n] = L[n] + rl[n] * 0.9 + duckBus.L[n] * duck[n];+ outR[n] = R[n] + rr[n] * 0.9 + duckBus.R[n] * duck[n];}-const echo = Math.round(0.375 * rate);-for (let i = echo; i < total; i++) {- left[i] += 0.12 * right[i - echo];- right[i] += 0.12 * left[i - echo];+// master: soft clip, high-pass 25Hz, fades+const fadeIn = 0.01 * SR;+const fadeOut = 0.5 * SR;+const hL = hp(coef(25));+const hR = hp(coef(25));+let peak = 0;+for (let n = 0; n < LEN; n++) {+ let a = hL(outL[n]);+ let b = hR(outR[n]);+ a = Math.tanh(a * 0.95);+ b = Math.tanh(b * 0.95);+ const f = Math.min(1, n / fadeIn) * Math.min(1, (LEN - n) / fadeOut);+ outL[n] = a * f;+ outR[n] = b * f;+ peak = Math.max(peak, Math.abs(outL[n]), Math.abs(outR[n]));}-const buffer = Buffer.alloc(44 + total * 4);-buffer.write('RIFF');-buffer.writeUInt32LE(36 + total * 4, 4);-buffer.write('WAVEfmt ', 8);-buffer.writeUInt32LE(16, 16);-buffer.writeUInt16LE(1, 20);-buffer.writeUInt16LE(2, 22);-buffer.writeUInt32LE(rate, 24);-buffer.writeUInt32LE(rate * 4, 28);-buffer.writeUInt16LE(4, 32);-buffer.writeUInt16LE(16, 34);-buffer.write('data', 36);-buffer.writeUInt32LE(total * 4, 40);-for (let i = 0; i < total; i++) {- const fade = Math.min(1, (total - i) / rate);- buffer.writeInt16LE(Math.round(Math.tanh(left[i]) * fade * 32700), 44 + i * 4);- buffer.writeInt16LE(Math.round(Math.tanh(right[i]) * fade * 32700), 46 + i * 4);+const norm = 0.9 / (peak || 1);+const pcm = Buffer.alloc(LEN * 4);+for (let n = 0; n < LEN; n++) {+ pcm.writeInt16LE(Math.max(-32768, Math.min(32767, Math.round(outL[n] * norm * 32767))), n * 4);+ pcm.writeInt16LE(Math.max(-32768, Math.min(32767, Math.round(outR[n] * norm * 32767))), n * 4 + 2);}-mkdirSync('out', { recursive: true });-writeFileSync('out/raw.wav', buffer);-const result = spawnSync(- 'ffmpeg',- [- '-y',- '-loglevel',- 'error',- '-i',- 'out/raw.wav',- '-af',- 'acompressor=threshold=0.08:ratio=6:attack=1:release=80,loudnorm=I=-12:TP=-2:LRA=6',- '-ar',- '48000',- 'public/score.wav',- ],- { stdio: 'inherit' },-);-if (result.error) throw result.error;-if (result.status !== 0) process.exit(result.status ?? 1);-console.log(`Generated ${DURATION + PRE}s score from ${EVENTS.length} shared events.`);+const head = Buffer.alloc(44);+head.write('RIFF', 0); head.writeUInt32LE(36 + pcm.length, 4); head.write('WAVEfmt ', 8);+head.writeUInt32LE(16, 16); head.writeUInt16LE(1, 20); head.writeUInt16LE(2, 22);+head.writeUInt32LE(SR, 24); head.writeUInt32LE(SR * 4, 28); head.writeUInt16LE(4, 32); head.writeUInt16LE(16, 34);+head.write('data', 36); head.writeUInt32LE(pcm.length, 40);+mkdirSync('public', { recursive: true });+writeFileSync('public/score.wav', Buffer.concat([head, pcm]));+console.log(`score.wav ${(LEN / SR).toFixed(2)}s peak ${peak.toFixed(2)}`);diff --git a/video/release/scripts/sheet.sh b/video/release/scripts/sheet.shnew file mode 100755index 0000000..444d14a--- /dev/null+++ b/video/release/scripts/sheet.sh@@ -0,0 +1,6 @@+#!/bin/sh+# usage: sheet.sh dir cols out.png -> contact sheet of every png in dir+d=$1; c=${2:-3}; o=${3:-$1/sheet.png}+n=$(ls $d/*.png | grep -v sheet | wc -l | tr -d ' ')+r=$(( (n + c - 1) / c ))+ffmpeg -loglevel error -y -pattern_type glob -i "$d/[0-9]*.png" -vf "scale=640:-1,tile=${c}x${r}:padding=6:color=black" -frames:v 1 $odiff --git a/video/release/scripts/stills.mjs b/video/release/scripts/stills.mjsindex bba596d..c343307 100644--- a/video/release/scripts/stills.mjs+++ b/video/release/scripts/stills.mjs@@ -2,38 +2,33 @@ import { bundle } from '@remotion/bundler';import { openBrowser, selectComposition, renderStill } from '@remotion/renderer';import { mkdirSync } from 'node:fs';import { REVIEW, IMPACT_REVIEW, FPS, PRE } from '../src/timeline.ts';-const serveUrl = await bundle({ entryPoint: 'src/index.tsx' }),- browser = await openBrowser('chrome');+const only = process.argv[2] ? process.argv.slice(2).map(Number) : null;+const serveUrl = await bundle({ entryPoint: 'src/index.tsx' });+const browser = await openBrowser('chrome');try {- const composition = await selectComposition({- serveUrl,- id: 'Release',- puppeteerInstance: browser,- });- for (const [name, times] of [- ['review', REVIEW],- ['impacts', IMPACT_REVIEW.map(t => t + PRE)],- ]) {+ const composition = await selectComposition({ serveUrl, id: 'Release', puppeteerInstance: browser });+ const sets = only+ ? [['pick', only]]+ : [+ ['review', REVIEW],+ ['impacts', IMPACT_REVIEW.flatMap(t => [t - 0.05, t + 0.05, t + 0.2])],+ ];+ for (const [name, times] of sets) {mkdirSync(`out/${name}`, { recursive: true });- for (const [i, time] of times.entries()) {+ for (const time of times) {await renderStill({- serveUrl,- composition,- puppeteerInstance: browser,- frame: Math.round(time * FPS),- scale: 0.5,- output: `out/${name}/${String(i).padStart(2, '0')}.png`,+ serveUrl, composition, puppeteerInstance: browser,+ frame: Math.round((time + PRE) * FPS), scale: 0.5,+ output: `out/${name}/${time.toFixed(2).padStart(5, '0')}.png`,});- console.log(name, i, time);}+ console.log(name, times.length);+ }+ if (!only) {+ const poster = await selectComposition({ serveUrl, id: 'Poster', puppeteerInstance: browser });+ await renderStill({ serveUrl, composition: poster, puppeteerInstance: browser, output: 'out/key-art.png' });+ await renderStill({ serveUrl, composition, puppeteerInstance: browser, frame: 0, output: 'out/thumbnail.png' });}- const poster = await selectComposition({ serveUrl, id: 'Poster', puppeteerInstance: browser });- await renderStill({- serveUrl,- composition: poster,- puppeteerInstance: browser,- output: 'out/key-art.png',- });} finally {await browser.close({ silent: true });}diff --git a/video/release/src/Assay.tsx b/video/release/src/Assay.tsxnew file mode 100644index 0000000..be5a284--- /dev/null+++ b/video/release/src/Assay.tsx@@ -0,0 +1,421 @@+import React from 'react';+import { C, MONO, SERIF, Cam, camCss, clamp, inCubic, inExpo, inOut, lerp, outBack, outCubic, outQuart, prog, pulseAt } from './lib.ts';+import { ASSAY, H, TAG_POPS, VERDICTS, W, mulberry32 } from './timeline.ts';+import { Header } from './hud.tsx';++const BELT_Y = 330;+const TILE_W = 120;+const TILE_H = 153;+const CARD_W = 360;+const CARD_H = 460;+const FUSE = { x: 0, y: -330 };+const REST_Y = -185; // stamp plate centre when touching the batch+const STAMP_W = 900;+const STAMP_H = 220;+const tileX = (i: number) => (i - 5.5) * 168;+const crateX = (i: number) => ((i % 6) - 2.5) * 136;+const crateY = (i: number) => (i < 6 ? BELT_Y - TILE_H / 2 - 4 : BELT_Y - TILE_H / 2 - 4 - 166);+const keeperIdx = (i: number) => ASSAY.keepers.indexOf(i);+const CRATE_LEAVE = 9.35;+const CARD_X = (j: number) => (j - 3.5) * 340;+const CARD_D = (j: number) => [0.4, -0.15, 0.9, 0.1, 0.7, -0.3, 0.5, 0][j];++function cam(t: number): Cam {+ if (t < 7.4) return { x: 0, y: 20, z: lerp(0.84, 0.9, prog(t, 5.9, 7.4)) };+ if (t < 8.0) {+ const p = inOut(prog(t, 7.4, 8.0));+ return { x: 0, y: lerp(20, -60, p), z: lerp(0.9, 0.98, p) };+ }+ if (t < 10.0) {+ const settle = Math.exp(-(t - 8.0) / 0.35);+ return { x: 0, y: lerp(-60, 30, prog(t, 8.0, 10.0)), z: lerp(0.98, 1.0, prog(t, 8, 10)) + 0.06 * settle };+ }+ // card corridor: dolly along the row+ const p = inOut(prog(t, 10.0, 12.1));+ return { x: lerp(-500, 500, p), y: lerp(20, -30, p), z: lerp(0.66, 0.92, p), r: lerp(1.2, -1.2, p) };+}++// ---- card / tile: the same object at two scales ---------------------------------+const Card: React.FC<{ hash: number; hot?: boolean; edge?: boolean }> = ({ hash, hot, edge }) => {+ const rows = Array.from({ length: 10 }, (_, i) => i);+ return (+ <div+ style={{+ width: CARD_W,+ height: CARD_H,+ borderRadius: 26,+ background: C.slip,+ boxShadow: edge+ ? `0 0 0 8px ${C.red}, 0 40px 70px rgba(70,40,20,0.35)`+ : '0 0 0 3px rgba(120,105,80,0.25), 0 24px 44px rgba(70,40,20,0.25)',+ padding: 30,+ boxSizing: 'border-box',+ }}+ >+ <div style={{ display: 'flex', alignItems: 'center', gap: 12, marginBottom: 22 }}>+ <div style={{ width: 16, height: 16, borderRadius: 8, background: C.red }} />+ <div style={{ height: 18, width: 150 + hash * 60, borderRadius: 9, background: C.ink }} />+ </div>+ {rows.map(i => {+ const isHot = i === 4;+ const indent = [0, 0, 28, 28, 28, 56, 28, 0, 0, 0][i];+ return (+ <div key={i} style={{ display: 'flex', alignItems: 'center', gap: 14, height: 34 }}>+ <div style={{ width: 22, height: 8, borderRadius: 4, background: 'rgba(120,115,105,0.35)' }} />+ <div style={{ width: indent }} />+ <div+ style={{+ height: isHot ? 16 : 12,+ width: (isHot ? 190 : 80 + ((hash * 9 + i * 0.41) % 1) * 120) * 1,+ borderRadius: 8,+ background: isHot ? C.red : i % 3 === 0 ? 'rgba(21,24,27,0.6)' : 'rgba(120,115,105,0.45)',+ }}+ />+ </div>+ );+ })}+ </div>+ );+};++const Tag: React.FC<{ size?: number }> = ({ size = 1 }) => (+ <div+ style={{+ width: 60 * size,+ height: 76 * size,+ background: C.red,+ borderRadius: `${10 * size}px ${10 * size}px ${16 * size}px ${16 * size}px`,+ boxShadow: '0 10px 20px rgba(140,40,20,0.35)',+ position: 'relative',+ display: 'flex',+ alignItems: 'center',+ justifyContent: 'center',+ fontFamily: SERIF,+ fontWeight: 900,+ color: C.paper,+ fontSize: 46 * size,+ paddingTop: 8 * size,+ }}+ >+ <div style={{ position: 'absolute', top: 8 * size, left: 26 * size, width: 8 * size, height: 8 * size, borderRadius: 8, background: 'rgba(0,0,0,0.35)' }} />+ ?+ </div>+);++const abs = (x: number, y: number, extra: React.CSSProperties = {}): React.CSSProperties => ({+ position: 'absolute',+ left: x,+ top: y,+ ...extra,+});++const Shards: React.FC<{ t: number; at: number; x: number; y: number; n: number; seed: number; power?: number }> = ({ t, at, x, y, n, seed, power = 1 }) => {+ const tau = t - at;+ if (tau < 0 || tau > 1.1) return null;+ const rng = mulberry32(seed);+ return (+ <>+ {Array.from({ length: n }, (_, i) => {+ const a = -Math.PI * (0.05 + 0.9 * rng());+ const v = (300 + rng() * 700) * power;+ const px = x + Math.cos(a) * v * tau;+ const py = y + Math.sin(a) * v * tau + 1500 * tau * tau;+ const col = [C.red, C.slip, C.ink, C.redSoft][Math.floor(rng() * 4)];+ const s = 10 + rng() * 22;+ return (+ <div+ key={i}+ style={abs(px, py, {+ width: s,+ height: s * 0.6,+ background: col,+ opacity: 1 - prog(tau, 0.6, 1.1),+ transform: `rotate(${tau * (rng() - 0.5) * 900}deg)`,+ boxShadow: '0 4px 8px rgba(60,30,10,0.2)',+ })}+ />+ );+ })}+ </>+ );+};++export const Assay: React.FC<{ t: number }> = ({ t }) => {+ const c = cam(t);+ const beltMoving = 1 - prog(t, 6.6, 7.1);+ const beltOff = -(t < 7.1 ? (t - 5.8) * 520 * (1 - 0.5 * prog(t, 6.6, 7.1) * 1) : 0) - (t > CRATE_LEAVE ? (t - CRATE_LEAVE) * 900 : 0);+ const slamP = pulseAt(t, ASSAY.slam, 0.12);+ const sh = { x: 0, y: 0, r: 0 };+ const showCards = t >= ASSAY.cards;++ // stamp plate ---------------------------------------------------------------------+ const fusedP = outBack(prog(t, ASSAY.fuse, ASSAY.fuse + 0.28), 2.4);+ const windup = outCubic(prog(t, 7.55, 7.93));+ const slamDrop = inExpo(prog(t, 7.9, 8.0));+ const lift = inOut(prog(t, 8.75, 9.3));+ let plateY = lerp(FUSE.y, -560, windup);+ if (t >= 7.9) plateY = lerp(-560, REST_Y, slamDrop);+ if (t >= 8.0) plateY = REST_Y + 26 * Math.exp(-(t - 8.0) / 0.06) * Math.sin(1 + (t - 8.0) * 30) * 0 - lift * 900;+ const plateTilt = t < 7.9 ? -3 * windup : 0;+ const plateSquash = t >= 8.0 ? 1 - 0.1 * slamP : 1;+ const showPlate = t >= ASSAY.fuse && plateY > -1500;+ const knobY = -150 + (t >= 8.0 ? 0 : 0);++ // tiles ---------------------------------------------------------------------------+ const tiles = Array.from({ length: ASSAY.tiles }, (_, i) => {+ const slideP = outQuart(prog(t, 5.9 + i * 0.022, 6.65 + i * 0.022));+ let x = tileX(i) - 2700 * (1 - slideP);+ let y = BELT_Y - TILE_H / 2 - 4;+ let rot = 0;+ let sc = 1;+ // regroup into the crate+ const rp = inOut(prog(t, 7.0 + i * 0.025, 7.55 + i * 0.025));+ if (rp > 0) {+ x = lerp(tileX(i), crateX(i), rp);+ y = lerp(y, crateY(i), rp) - 130 * Math.sin(Math.PI * rp);+ rot = 0;+ }+ const v = VERDICTS[i];+ const pass = v.pass;+ const vp = prog(t, v.t, v.t + 0.2);+ let dy = 0;+ let fade = 1;+ if (vp > 0 && pass) dy = -34 * outBack(vp, 2.5);+ if (vp > 0 && !pass) {+ const fp = t - v.t - 0.14;+ if (fp > 0) {+ dy = 2400 * fp * fp;+ rot = 40 * fp * (i % 2 ? 1 : -1);+ fade = 1 - prog(fp, 0.25, 0.5);+ }+ }+ // keepers rise out of the crate into a hover line, then unfold into cards+ let hover = 0;+ let cardP = 0;+ const j = keeperIdx(i);+ if (pass) {+ const hp = inOut(prog(t, 8.75 + j * 0.03, 9.45 + j * 0.03));+ if (hp > 0) {+ x = lerp(crateX(i), CARD_X(j) * 0.44, hp);+ y = lerp(crateY(i) + dy, 10, hp);+ dy = 0;+ hover = hp;+ }+ cardP = outBack(prog(t, ASSAY.cards + j * 0.035, ASSAY.cards + 0.42 + j * 0.035), 1.6);+ }+ // crate rides away on the belt+ let cx = 0;+ if (!hover && t > CRATE_LEAVE) cx = inCubic(prog(t, CRATE_LEAVE, CRATE_LEAVE + 0.7)) * 2600;+ return { i, x: x + cx, y: y + dy, rot, sc, fade, vp, pass, hover, cardP, j };+ });++ // tags ----------------------------------------------------------------------------+ const tags = tiles.map(tl => {+ const pop = outBack(prog(t, TAG_POPS[tl.i], TAG_POPS[tl.i] + 0.16), 3);+ const fp = inOut(prog(t, ASSAY.peel + tl.i * 0.02, ASSAY.fuse - 0.02));+ const sx = tileX(tl.i);+ const sy = BELT_Y - TILE_H - 44;+ const ctrlX = sx * 0.4;+ const ctrlY = -400 - (tl.i % 3) * 40;+ const qx = (1 - fp) * (1 - fp) * sx + 2 * (1 - fp) * fp * ctrlX + fp * fp * FUSE.x;+ const qy = (1 - fp) * (1 - fp) * sy + 2 * (1 - fp) * fp * ctrlY + fp * fp * FUSE.y;+ return { x: tl.i < 12 && fp > 0 ? qx : sx, y: fp > 0 ? qy : sy, s: pop * (1 - 0.45 * fp), fp, gone: t >= ASSAY.fuse - 0.005, rot: fp > 0 ? fp * 360 * (tl.i % 2 ? 1 : -1) : 0, sx };+ });++ // header ---------------------------------------------------------------------------+ const wallBlur = 5;+ return (+ <div style={{ position: 'absolute', inset: 0, overflow: 'hidden', background: C.paper }}>+ <div style={{ position: 'absolute', inset: 0, transform: `translate(${sh.x}px, ${sh.y}px) rotate(${sh.r}deg)` }}>+ {/* back wall + floor */}+ <div style={{ position: 'absolute', inset: 0, background: `linear-gradient(180deg, #f8f4ea 0%, #efe9d9 ${(BELT_Y - c.y) * c.z / 10 + 34}%, #dcd3bd 100%)` }} />+ <div style={{ position: 'absolute', inset: 0, filter: `blur(${wallBlur}px)`, opacity: 0.8, transform: `translate(${-c.x * 0.25 * c.z}px, ${-c.y * 0.15}px)` }}>+ {[0, 1, 2].map(r =>+ Array.from({ length: 22 }, (_, k) => (+ <div+ key={`${r}-${k}`}+ style={abs(k * 130 - 300 + (r % 2) * 60, 90 + r * 190, {+ width: 92,+ height: 128,+ borderRadius: 8,+ background: C.slip,+ boxShadow: '0 8px 14px rgba(80,60,30,0.15)',+ opacity: 0.7 - r * 0.15,+ })}+ />+ )),+ )}+ </div>+ <div style={{ position: 'absolute', left: 0, top: 0, width: W, height: H, transformOrigin: '0 0', transform: camCss(c) }}>+ {/* belt */}+ <div+ style={abs(-4000, BELT_Y, {+ width: 8000,+ height: 86,+ background: `repeating-linear-gradient(90deg, #22272b 0 34px, #14181b 34px 40px)`,+ backgroundPositionX: beltOff,+ boxShadow: '0 40px 60px rgba(60,40,10,0.35)',+ })}+ />+ <div style={abs(-4000, BELT_Y - 6, { width: 8000, height: 8, background: C.red })} />+ <div style={abs(-4000, BELT_Y + 86, { width: 8000, height: 30, background: 'linear-gradient(#5a5147,#2b2620)' })} />++ {/* crate (back panel) */}+ {t > 7.0 && (+ <div style={{ transform: `translateX(${t > CRATE_LEAVE ? inCubic(prog(t, CRATE_LEAVE, CRATE_LEAVE + 0.7)) * 2600 : 0}px)` }}>+ <div style={abs(-470 + 0, BELT_Y - 385, { width: 940, height: 386, borderRadius: 18, background: '#b9ab8d', opacity: outCubic(prog(t, 6.95, 7.3)), boxShadow: 'inset 0 20px 40px rgba(60,40,10,0.35)' })} />+ </div>+ )}++ {/* tiles */}+ {tiles.map(tl => {+ const scale = lerp(TILE_W / CARD_W, 1, tl.cardP);+ const cardZ = lerp(0, CARD_D(tl.j >= 0 ? tl.j : 0), tl.cardP);+ const cardScreen = tl.cardP > 0;+ // during the corridor, cards sit on the arc (depth via scale)+ const x = cardScreen ? lerp(tl.x, CARD_X(tl.j), tl.cardP) : tl.x;+ const y = cardScreen ? lerp(tl.y, -20, tl.cardP) : tl.y;+ const depthScale = 1 + cardZ * tl.cardP;+ if (t < 5.85) return null;+ const passGlow = tl.pass && tl.vp > 0;+ return (+ <div+ key={tl.i}+ style={abs(x - CARD_W / 2, y - CARD_H / 2, {+ transform: `rotate(${tl.rot + (cardScreen ? (tl.j - 3.5) * -1.2 * tl.cardP : 0)}deg) scale(${scale * depthScale})`,+ transformOrigin: '50% 50%',+ opacity: tl.fade,+ filter: cardScreen && cardZ < 0 ? `blur(${-cardZ * 9 * tl.cardP}px)` : undefined,+ })}+ >+ <Card hash={(tl.i * 0.37) % 1} edge={passGlow} />+ {tl.vp > 0 && (+ <div+ style={abs(CARD_W / 2 - 100, CARD_H / 2 - 100, {+ width: 200,+ height: 200,+ borderRadius: 100,+ background: tl.pass ? C.red : '#74705f',+ color: C.paper,+ display: 'flex',+ alignItems: 'center',+ justifyContent: 'center',+ fontFamily: SERIF,+ fontWeight: 900,+ fontSize: 150,+ transform: `scale(${outBack(tl.vp, 2.6)})`,+ boxShadow: '0 16px 30px rgba(60,20,10,0.35)',+ opacity: tl.cardP > 0 ? 1 - tl.cardP : 1,+ })}+ >+ {tl.pass ? '✓' : '✕'}+ </div>+ )}+ </div>+ );+ })}++ {/* crate front board */}+ {t > 7.0 && (+ <div style={{ transform: `translateX(${t > CRATE_LEAVE ? inCubic(prog(t, CRATE_LEAVE, CRATE_LEAVE + 0.7)) * 2600 : 0}px)` }}>+ <div+ style={abs(-480, BELT_Y - 118, {+ width: 960,+ height: 120,+ borderRadius: 14,+ background: 'linear-gradient(#cdbf9f,#a89a7b)',+ boxShadow: '0 20px 30px rgba(60,40,10,0.4)',+ opacity: outCubic(prog(t, 6.95, 7.3)),+ overflow: 'hidden',+ })}+ >+ <div style={abs(0, 50, { width: 960, height: 16, background: C.red })} />+ </div>+ </div>+ )}++ {/* per-tile tags */}+ {tags.map(tg =>+ !tg.gone && t >= TAG_POPS[tg.sx > 0 ? 0 : 0] ? (+ <div key={tg.sx}>+ {tg.fp === 0 && <div style={abs(tg.x - 1.5, tg.y + 60, { width: 3, height: 36, background: C.ink, opacity: 0.6 * clamp(tg.s) })} />}+ <div style={abs(tg.x - 30, tg.y - 38, { transform: `rotate(${tg.rot}deg) scale(${Math.max(tg.s, 0)})`, filter: 'drop-shadow(0 8px 10px rgba(80,30,10,0.3))' })}>+ <Tag />+ </div>+ </div>+ ) : null,+ )}+ <Shards t={t} at={ASSAY.fuse} x={0} y={FUSE.y} n={16} seed={4} power={0.7} />++ {/* fuse ring */}+ {t >= ASSAY.fuse && t < ASSAY.fuse + 0.5 && (+ <div+ style={abs(FUSE.x - 300, FUSE.y - 300, {+ width: 600,+ height: 600,+ borderRadius: 300,+ border: `${10 * (1 - prog(t, ASSAY.fuse, ASSAY.fuse + 0.5))}px solid ${C.red}`,+ transform: `scale(${0.2 + 1.4 * outCubic(prog(t, ASSAY.fuse, ASSAY.fuse + 0.5))})`,+ opacity: 1 - prog(t, ASSAY.fuse, ASSAY.fuse + 0.5),+ })}+ />+ )}++ {/* the stamp: one brief for the whole batch */}+ {showPlate && (+ <div style={abs(-STAMP_W / 2, plateY - STAMP_H / 2, { width: STAMP_W, height: STAMP_H, transform: `rotate(${plateTilt}deg) scale(${Math.max(fusedP, 0)}, ${Math.max(fusedP, 0) * plateSquash})` })}>+ <div+ style={{+ width: STAMP_W,+ height: STAMP_H,+ borderRadius: 34,+ background: `linear-gradient(180deg, #f76a4c, ${C.red} 40%, ${C.redDeep})`,+ boxShadow: '0 30px 50px rgba(120,30,10,0.45), inset 0 3px 0 rgba(255,255,255,0.35)',+ display: 'flex',+ alignItems: 'center',+ justifyContent: 'center',+ gap: 60,+ color: C.paper,+ fontFamily: SERIF,+ fontWeight: 900,+ fontSize: 190,+ position: 'relative',+ }}+ >+ <div style={{ width: 34, height: 34, borderRadius: 17, background: 'rgba(0,0,0,0.35)', position: 'absolute', left: 44, top: 44 }} />+ <span style={{ transform: 'translateY(8px)' }}>?</span>+ </div>+ {/* handle */}+ <div style={abs(STAMP_W / 2 - 40, -80, { width: 80, height: 90, background: 'linear-gradient(90deg,#0e1113,#4a5259,#14181b)', borderRadius: 10 })} />+ <div style={abs(STAMP_W / 2 - 100, -170, { width: 200, height: 100, background: 'linear-gradient(180deg,#3a4046,#15181b)', borderRadius: 50, boxShadow: '0 16px 20px rgba(0,0,0,0.3)' })} />+ </div>+ )}+ {t >= ASSAY.slam && t < ASSAY.slam + 0.7 && (+ <>+ <div+ style={abs(-400, REST_Y + 110 - 60, {+ width: 800,+ height: 160,+ borderRadius: 400,+ border: `${8 * (1 - prog(t, ASSAY.slam, ASSAY.slam + 0.7))}px solid ${C.red}`,+ opacity: 1 - prog(t, ASSAY.slam, ASSAY.slam + 0.7),+ transform: `scale(${1 + outCubic(prog(t, ASSAY.slam, ASSAY.slam + 0.7)) * 1.2}, ${1 + outCubic(prog(t, ASSAY.slam, ASSAY.slam + 0.7)) * 1.6})`,+ })}+ />+ <Shards t={t} at={ASSAY.slam} x={-300} y={REST_Y + 100} n={18} seed={9} power={1.1} />+ <Shards t={t} at={ASSAY.slam} x={300} y={REST_Y + 100} n={18} seed={19} power={1.1} />+ </>+ )}+ </div>+ </div>+ <Header+ t={t}+ items={[+ { text: 'ASK EVERY TIME', from: 6.15, to: 7.5 },+ { text: 'ONE BRIEF, ONE BATCH', from: 7.5, to: 10.0 },+ { text: 'VERBATIM SOURCE', from: 10.0, to: 12.4 },+ ]}+ />+ </div>+ );+};diff --git a/video/release/src/Cost.tsx b/video/release/src/Cost.tsxnew file mode 100644index 0000000..4ba0068--- /dev/null+++ b/video/release/src/Cost.tsx@@ -0,0 +1,210 @@+import React, { useLayoutEffect, useRef } from 'react';+import { C, MONO, SERIF, clamp, inCubic, lerp, outBack, outCubic, outExpo, prog, pulseAt } from './lib.ts';+import { COST, H, W, mulberry32 } from './timeline.ts';+import { Header } from './hud.tsx';++const COIN_W = 264;+const COIN_E = 62; // ellipse height+const COIN_T = 8.6;+const BASE_Y = 930;+const rngs = mulberry32(77);+const DEBRIS = Array.from({ length: COST.total }, () => ({+ vx: (rngs() - 0.85) * 1900,+ vy: -700 - rngs() * 1100,+ spin: (rngs() - 0.5) * 22,+ ph: rngs() * 6,+}));++const landTime = (i: number) => COST.start + 0.05 + Math.floor(i / COST.perStep) * COST.dropStep + (i % COST.perStep) * 0.006;+const towerX = (t: number) => lerp(W / 2, 520, outCubic(prog(t, 13.6, 14.2)));++function coin(ctx: CanvasRenderingContext2D, x: number, y: number, tilt: number, red: number, rot = 0, glow = 0) {+ // y = top-face centre. tilt: 1 = flat (tower coin), <1 tumbling+ const rx = COIN_W / 2;+ const ry = (COIN_E / 2) * tilt + 0.001;+ const th = COIN_T * (tilt > 0.9 ? 1 : 1 + (1 - tilt) * 1.4);+ ctx.save();+ ctx.translate(x, y);+ ctx.rotate(rot);+ const side = ctx.createLinearGradient(-rx, 0, rx, 0);+ if (red > 0.5) {+ side.addColorStop(0, '#a82c16');+ side.addColorStop(0.35, '#ef5638');+ side.addColorStop(1, '#8e2410');+ } else {+ side.addColorStop(0, '#77736a');+ side.addColorStop(0.35, '#c4bfb0');+ side.addColorStop(1, '#69655c');+ }+ ctx.fillStyle = side;+ ctx.fillRect(-rx, 0, rx * 2, th);+ ctx.beginPath();+ ctx.ellipse(0, th, rx, ry, 0, 0, Math.PI * 2);+ ctx.fill();+ // top face+ ctx.beginPath();+ ctx.ellipse(0, 0, rx, ry, 0, 0, Math.PI * 2);+ ctx.fillStyle = red > 0.5 ? '#f58a72' : '#dcd7c8';+ ctx.fill();+ ctx.lineWidth = 3;+ ctx.strokeStyle = red > 0.5 ? '#c93a20' : '#a39e8f';+ ctx.stroke();+ ctx.beginPath();+ ctx.ellipse(0, 0, rx * 0.72, ry * 0.72, 0, 0, Math.PI * 2);+ ctx.strokeStyle = red > 0.5 ? 'rgba(160,40,20,0.5)' : 'rgba(120,115,100,0.5)';+ ctx.lineWidth = 2;+ ctx.stroke();+ if (glow > 0) {+ ctx.fillStyle = `rgba(255,255,255,${0.7 * glow})`;+ ctx.beginPath();+ ctx.ellipse(-rx * 0.3, -ry * 0.2, rx * 0.35, ry * 0.25, 0, 0, Math.PI * 2);+ ctx.fill();+ }+ ctx.restore();+}++function paint(ctx: CanvasRenderingContext2D, t: number) {+ ctx.setTransform(1, 0, 0, 1, 0, 0);+ ctx.clearRect(0, 0, W, H);+ const cx = towerX(t);+ // contact shadow on the floor+ const tower = COST.total;+ const sh = ctx.createRadialGradient(cx, BASE_Y + 36, 10, cx, BASE_Y + 36, 260);+ sh.addColorStop(0, 'rgba(60,40,10,0.38)');+ sh.addColorStop(1, 'rgba(60,40,10,0)');+ ctx.fillStyle = sh;+ ctx.fillRect(cx - 300, BASE_Y - 60, 600, 200);++ const cut = t >= COST.cut;+ if (cut) {+ const gp = clamp((t - COST.cut) * 6);+ ctx.globalAlpha = 0.16 * gp;+ for (let i = COST.kept; i < tower; i++) coin(ctx, cx + Math.sin(i * 1.7) * 3.5 + Math.sin(i * 0.31) * 6, BASE_Y - i * COIN_T, 1, 0);+ ctx.globalAlpha = 1;+ }+ const bounce = pulseAt(t, COST.cut, 0.09) * -14;+ for (let i = 0; i < tower; i++) {+ const land = landTime(i);+ const p = (t - (land - 0.34)) / 0.34;+ if (p < 0) continue;+ const yFinal = BASE_Y - i * COIN_T;+ const jx = Math.sin(i * 1.7) * 3.5 + Math.sin(i * 0.31) * 6;+ if (i >= COST.kept && cut) {+ const tau = t - COST.cut - (i - COST.kept) * 0.004;+ if (tau > 0) {+ const D = DEBRIS[i];+ const x = cx + jx + D.vx * tau;+ const y = yFinal + D.vy * tau + 2700 * tau * tau;+ if (y > H + 200 || x < -300 || x > W + 300) continue;+ const tilt = Math.cos(D.ph + D.spin * tau);+ const blur = i % 7 === 0;+ if (blur) ctx.filter = 'blur(5px)';+ coin(ctx, x, y, 0.15 + Math.abs(tilt) * 0.85, 0, D.spin * tau * 0.15);+ if (blur) ctx.filter = 'none';+ continue;+ }+ }+ let y = yFinal;+ if (p < 1) y = lerp(-320 - (i % COST.perStep) * 110, yFinal, inCubic(p));+ else {+ // landing squash / tower wobble from the last group's impact+ const q = t - land;+ y += Math.sin(q * 46) * 3 * Math.exp(-q / 0.08);+ }+ if (cut && i < COST.kept) y += bounce * (0.4 + 0.6 * (i / COST.kept));+ const redP = cut ? clamp((t - COST.cut - (COST.kept - 1 - i) * 0.007) * 30) : 0;+ const glint = i >= COST.kept ? 0 : pulseAt(t, COST.cut + (COST.kept - 1 - i) * 0.007, 0.08);+ coin(ctx, cx + jx, y, 1, redP, 0, Math.max(glint, p >= 1 && p < 1.3 ? 0.6 * (1.3 - p) / 0.3 : 0));+ }+}++const Dot: React.FC<{ on: boolean; t: number; at: number }> = ({ on, t, at }) => {+ const s = outBack(prog(t, at, at + 0.14), 3);+ return (+ <div+ style={{+ width: 40,+ height: 40,+ borderRadius: 20,+ transform: `scale(${s})`,+ background: on ? C.red : 'transparent',+ border: on ? 'none' : `4px solid ${C.grey}`,+ boxSizing: 'border-box',+ }}+ />+ );+};++export const Cost: React.FC<{ t: number }> = ({ t }) => {+ const ref = useRef<HTMLCanvasElement>(null);+ useLayoutEffect(() => {+ paint(ref.current!.getContext('2d')!, t);+ });+ const numIn = t >= COST.cut ? outExpo(prog(t, COST.cut, COST.cut + 0.22)) : 0;+ const numScale = lerp(2.2, 1, numIn);+ const kept = t >= COST.cut;+ const count = 59;+ const label = kept ? '0.5' : '0.4.3';+ const tx = towerX(t);+ const dotsAt = 14.35;+ const mkRow = (row: number) => (+ <div style={{ display: 'flex', alignItems: 'center', gap: 22 }}>+ <div style={{ width: 140, fontFamily: MONO, fontWeight: 600, fontSize: 30, color: C.ink, letterSpacing: 3 }}>{row === 0 ? '0.4.3' : '0.5'}</div>+ <div style={{ display: 'flex', gap: 14 }}>+ {Array.from({ length: 10 }, (_, i) => (+ <Dot key={i} on={i < 8} t={t} at={dotsAt + row * 0.5 + i * 0.045} />+ ))}+ </div>+ </div>+ );+ const camRot = Math.sin((t - 12) * 0.5) * 0.5;+ return (+ <div style={{ position: 'absolute', inset: 0, overflow: 'hidden', background: C.paper }}>+ <div style={{ position: 'absolute', inset: 0, transform: `rotate(${camRot}deg) scale(${1 + 0.03 * pulseAt(t, COST.cut, 0.15)})` }}>+ <div style={{ position: 'absolute', inset: 0, background: `linear-gradient(180deg, #f8f4ea 0%, #f1ebdb 82%, #ddd4bd ${100 * (BASE_Y + 40) / H + 2}%, #d3c9b1 100%)` }} />+ <canvas ref={ref} width={W} height={H} style={{ position: 'absolute', inset: 0 }} />+ <div+ style={{+ position: 'absolute',+ left: tx - 120,+ top: BASE_Y + 62,+ width: 240,+ textAlign: 'center',+ fontFamily: MONO,+ fontWeight: 700,+ fontSize: kept ? 64 : 40,+ letterSpacing: 4,+ color: C.ink,+ transform: `scale(${1 + 0.35 * pulseAt(t, COST.cut, 0.12)})`,+ }}+ >+ {label}+ </div>+ {kept && (+ <div style={{ position: 'absolute', left: 860, top: 140, transformOrigin: '0 100%', transform: `scale(${numScale})`, opacity: clamp(numIn * 3) }}>+ <div style={{ fontFamily: SERIF, fontWeight: 900, fontSize: 520, lineHeight: '460px', letterSpacing: -14, color: C.ink, display: 'flex', alignItems: 'flex-start', fontVariationSettings: '"opsz" 144, "SOFT" 30' }}>+ <span>{count}</span>+ <span style={{ color: C.red, fontSize: 380, marginTop: 30, marginLeft: 8 }}>%</span>+ </div>+ <div style={{ fontFamily: MONO, fontWeight: 700, fontSize: 60, letterSpacing: 8, color: C.ink, marginTop: 34 }}>+ LESS <span style={{ color: C.red }}>JEV API</span> COST+ </div>+ </div>+ )}+ {t > dotsAt - 0.05 && (+ <div style={{ position: 'absolute', left: 860, top: 800, display: 'flex', flexDirection: 'column', gap: 22 }}>+ {mkRow(0)}+ {mkRow(1)}+ </div>+ )}+ </div>+ <Header+ t={t}+ items={[+ { text: 'JEV API COST', from: 12.1, to: 14.3 },+ { text: 'SAME TASKS SOLVED', from: 14.3, to: 16.3 },+ ]}+ />+ </div>+ );+};diff --git a/video/release/src/Field.tsx b/video/release/src/Field.tsxdeleted file mode 100644index 4c79d5b..0000000--- a/video/release/src/Field.tsx+++ /dev/null@@ -1,165 +0,0 @@-import React, { useLayoutEffect, useRef } from 'react';-import { CUE, clamp, progress, pulse } from './timeline';-const W = 1920,- H = 1080,- RED = '#ff3e2b',- BLUE = '#87eaff';-const random = (i: number) => {- const n = Math.sin(i * 127.13 + 78.71) * 43758.5453;- return n - Math.floor(n);-};-function project(x: number, y: number, z: number, t: number, k: number) {- const a = Math.sin(t * 0.3) * 0.1,- xx = x * Math.cos(a) + z * Math.sin(a),- zz = z * Math.cos(a) - x * Math.sin(a);- const f = 950 / (zz + 1200 - k * 130);- return { x: 960 + xx * f, y: 540 + y * f, scale: f, z: zz };-}-function glow(g: CanvasRenderingContext2D, color: string, width: number) {- g.strokeStyle = color;- g.lineWidth = width;- g.shadowColor = color;- g.shadowBlur = width * 3;-}-export function Field({ t }: { t: number }) {- const ref = useRef<HTMLCanvasElement>(null);- useLayoutEffect(() => {- const g = ref.current!.getContext('2d')!;- const kick = pulse(t, 'kick'),- snare = pulse(t, 'snare', 0.09),- accent = pulse(t, 'accent', 0.2);- g.clearRect(0, 0, W, H);- g.fillStyle = '#08090d';- g.fillRect(0, 0, W, H);- const bloom = g.createRadialGradient(960, 560, 20, 960, 560, 1000);- bloom.addColorStop(0, 'rgba(28,40,60,.12)');- bloom.addColorStop(0.5, 'rgba(16,24,34,.2)');- bloom.addColorStop(1, 'rgba(0,0,0,0)');- g.fillStyle = bloom;- g.fillRect(0, 0, W, H);- const inSearch = t >= CUE.search && t < CUE.context,- inCollect = t >= CUE.context && t < CUE.terminal;- const closing = t >= CUE.terminal;- // Source strips travel through perspective, then converge toward the search aperture.- g.save();- g.translate(Math.sin(t * 91) * accent * 7, Math.cos(t * 83) * accent * 5);- for (let i = 0; i < 230; i++) {- let z = 500 + ((((random(i + 1) * 5000 - t * (inSearch ? 750 : 420)) % 5000) + 5000) % 5000);- let x = (random(i + 20) - 0.5) * 7400,- y = (random(i + 80) - 0.5) * 3900;- const chosen = i % 17 === 0;- const pull =- inSearch && chosen- ? progress(t, CUE.lock, 0.65)- : inCollect- ? progress(t, CUE.collect, 0.8)- : 0;- x *= 1 - pull * 0.94;- y *= 1 - pull * 0.94;- z = z * (1 - pull) + 400 * pull;- const p = project(x, y, z, t, kick);- if (p.x < -600 || p.x > W + 600 || p.y < -300 || p.y > H + 300) continue;- const opacity = (chosen ? 0.78 : 0.15 + random(i + 5) * 0.16) * (closing ? 0.23 : 1);- g.globalAlpha = opacity * (inCollect || chosen ? 1 - pull : 1);- g.strokeStyle = chosen ? (inSearch ? BLUE : RED) : '#acb4c1';- g.lineWidth = Math.max(0.7, p.scale * 3);- g.shadowBlur = chosen ? 12 : 0;- g.shadowColor = g.strokeStyle;- for (let j = 0; j < 3; j++) {- const len = (120 + random(i + j + 7) * 210) * p.scale;- g.beginPath();- g.moveTo(p.x, p.y + j * 18 * p.scale);- g.lineTo(p.x + len, p.y + j * 18 * p.scale);- g.stroke();- }- if (chosen && p.scale > 0.24 && pull < 0.1) {- g.font = `${Math.max(10, p.scale * 20)}px Mono`;- g.fillStyle = g.strokeStyle;- g.fillText(- ['selection.ts', 'retrieve.ts', 'source.ts', 'preview.py'][i % 4],- p.x,- p.y - 14 * p.scale,- );- }- }- g.restore();- g.globalAlpha = 1;- g.shadowBlur = 0;- // The API cost mass loses 59% of its fragments exactly on the accent.- if (t >= CUE.claim && t < CUE.search) {- const d = t - CUE.fracture;- for (let i = 0; i < 100; i++) {- let x = 190 + i * 15,- y = 786;- const discard = i >= 41;- if (discard && d >= 0) {- x += (180 + random(i + 50) * 900) * d;- y += (50 + random(i + 60) * 250) * d + 900 * d * d;- }- g.globalAlpha = discard && d > 0 ? clamp(1 - d * 1.3) : 0.5 + kick * 0.3;- g.fillStyle = discard ? '#d5e4ea' : RED;- g.shadowColor = g.fillStyle;- g.shadowBlur = discard ? 8 : 15;- g.save();- g.translate(x, y);- g.rotate(discard ? Math.max(0, d) * (random(i + 4) - 0.5) * 12 : 0);- g.fillRect(-6, -48, 13, 96);- g.restore();- }- g.globalAlpha = 1;- g.shadowBlur = 0;- }- if (inSearch) {- const scan = progress(t, CUE.scan, CUE.lock - CUE.scan),- lock = progress(t, CUE.lock, 0.3);- const originalX = 250 + scan * 1420,- sx = originalX + (960 - originalX) * lock,- sy = 570 + (660 - 570) * lock;- g.globalAlpha = 1 - lock * 0.8;- glow(g, BLUE, 3 + kick * 8);- g.beginPath();- g.ellipse(sx, sy, 170 + lock * 340 + kick * 20, 280 - lock * 130 + kick * 20, 0, 0, 6.283);- g.stroke();- const laser = g.createLinearGradient(sx - 100, 0, sx + 100, 0);- laser.addColorStop(0, '#87eaff00');- laser.addColorStop(0.5, `rgba(135,234,255,${0.08 + kick * 0.08})`);- laser.addColorStop(1, '#87eaff00');- g.fillStyle = laser;- g.fillRect(sx - 100, 250, 200, 650);- g.globalAlpha = 1;- g.shadowBlur = 0;- }- // Bass hits drive perspective streaks, giving the field a physical acceleration.- if (kick > 0.12 && !closing) {- g.globalAlpha = kick * 0.26;- glow(g, t < CUE.search ? RED : BLUE, 1.5);- for (let i = 0; i < 20; i++) {- const a = (i * Math.PI) / 10 + 0.12,- r = 650 + random(i) * 250,- length = kick * (100 + random(i + 8) * 220);- g.beginPath();- g.moveTo(960 + Math.cos(a) * r, 540 + Math.sin(a) * r * 0.7);- g.lineTo(960 + Math.cos(a) * (r + length), 540 + Math.sin(a) * (r + length) * 0.7);- g.stroke();- }- g.globalAlpha = 1;- g.shadowBlur = 0;- }- // Snare tears, moving edge light and hats create rhythmic foreground detail.- g.globalAlpha = snare * 0.38;- g.fillStyle = BLUE;- for (let i = 0; i < 3; i++)- g.fillRect(0, Math.floor(random(i + Math.floor(t * 2)) * H), W, 2 + i * 3);- g.globalAlpha = 1;- for (let i = 0; i < 70; i++) {- const phase = (t * 0.65 + random(i)) % 1;- const x = 960 + (random(i + 120) - 0.5) * 2400 * phase,- y = 540 + (random(i + 300) - 0.5) * 1500 * phase;- g.fillStyle = i % 4 === 0 ? RED : '#e1efff';- g.globalAlpha = (1 - phase) * (0.2 + kick * 0.6) * (closing ? 0.3 : 1);- g.fillRect(x, y, 2 + phase * 7, 1 + phase * 3);- }- g.globalAlpha = 1;- }, [t]);- return <canvas ref={ref} width={W} height={H} style={{ position: 'absolute', inset: 0 }} />;-}diff --git a/video/release/src/Film.tsx b/video/release/src/Film.tsxindex 7dd73f4..ae7c9ca 100644--- a/video/release/src/Film.tsx+++ b/video/release/src/Film.tsx@@ -1,541 +1,158 @@-import React, { useLayoutEffect, useState } from 'react';-import {- AbsoluteFill,- Audio,- cancelRender,- continueRender,- delayRender,- spring,- staticFile,- useCurrentFrame,-} from 'remotion';-import { Field } from './Field';-import { CUE, DURATION, FPS, PRE, clamp, progress, pulse } from './timeline';-const RED = '#ff3e2b',- WHITE = '#f2f7fa',- BLUE = '#87eaff';-const at = (left: number, top: number): React.CSSProperties => ({- position: 'absolute',- left,- top,-});-const bounce = (t: number, when: number) =>- spring({ frame: (t - when) * FPS, fps: FPS, config: { mass: 0.6, stiffness: 320, damping: 18 } });-function useFonts() {- const [h] = useState(() => delayRender('Load fonts'));- const [ready, setReady] = useState(false);- useLayoutEffect(() => {- Promise.all(- [- ['Display', 'Anton.ttf'],- ['Mono', 'Mono.ttf'],- ].map(async ([name, file]) => {- const f = new FontFace(name, `url(${staticFile('fonts/' + file)})`);- await f.load();- document.fonts.add(f);- }),- )- .then(() => setReady(true))- .catch(cancelRender);- }, []);- useLayoutEffect(() => {- if (ready) continueRender(h);- }, [ready, h]);- return ready;-}-function Label({- children,- x = 120,- y = 130,- color = WHITE,-}: {- children: React.ReactNode;- x?: number;- y?: number;- color?: string;-}) {+import React, { useEffect, useState } from 'react';+import { Html5Audio, continueRender, delayRender, staticFile, useCurrentFrame } from 'remotion';+import { C, MONO, clamp, inOut, prog, shake, useT } from './lib.ts';+import { FPS, H, IMPACTS, PRE, W, mulberry32 } from './timeline.ts';+import { Mountain } from './Mountain.tsx';+import { Assay } from './Assay.tsx';+import { Cost } from './Cost.tsx';+import { Install } from './Install.tsx';++const FONT_CSS = `+@font-face{font-family:Fraunces;src:url(${staticFile('fonts/Fraunces.ttf')});font-weight:100 900;}+@font-face{font-family:PlexMono;src:url(${staticFile('fonts/Mono.ttf')});font-weight:100 900;}+`;+const useFonts = () => {+ const [h] = useState(() => delayRender('fonts'));+ useEffect(() => {+ Promise.all([+ document.fonts.load('900 100px Fraunces'),+ document.fonts.load('500 40px PlexMono'),+ document.fonts.load('700 40px PlexMono'),+ document.fonts.load('600 40px PlexMono'),+ ]).finally(() => continueRender(h));+ }, [h]);+};++const grainStyle = (f: number): React.CSSProperties => {+ const r = mulberry32(f * 13 + 1);+ return {+ position: 'absolute',+ inset: 0,+ backgroundImage: `url(${staticFile('grain.png')})`,+ backgroundSize: '512px 512px',+ backgroundPosition: `${Math.floor(r() * 512)}px ${Math.floor(r() * 512)}px`,+ mixBlendMode: 'soft-light',+ opacity: 0.28,+ pointerEvents: 'none',+ };+};++export const Frame: React.FC<{ t: number; f: number; children?: React.ReactNode }> = ({ t, f, children }) => {+ let ab = 0;+ let sx = 0;+ let sy = 0;+ let sr = 0;+ for (const im of IMPACTS) {+ const dt = t - im.t;+ if (dt >= -0.01 && dt < 0.5) ab += 9 * im.size * Math.exp(-Math.max(dt, 0) / 0.07);+ const s = shake(t, im.t, 16 * im.size, 0.16);+ sx += s.x;+ sy += s.y;+ sr += s.r;+ }return (- <div style={{ ...at(x, y), fontFamily: 'Mono', fontSize: 28, letterSpacing: 6, color }}>- {children}- </div>- );-}-function HitText({- text,- t,- start,- x,- y,- size,- color = WHITE,- width = 1720,-}: {- text: string;- t: number;- start: number;- x: number;- y: number;- size: number;- color?: string;- width?: number;-}) {- const p = bounce(t, start),- kick = pulse(t, 'kick', 0.1);- return (- <div style={{ ...at(x, y), width, overflow: 'hidden', paddingBottom: 20 }}>- <div- style={{- fontFamily: 'Display',- fontSize: size,- lineHeight: 1.12,- letterSpacing: -size * 0.018,- color,- whiteSpace: 'nowrap',- transformOrigin: 'left center',- transform: `translateY(${(1 - p) * size * 1.3}px) scaleX(${1 + kick * 0.012})`,- textShadow: `${pulse(t, 'snare', 0.06) * 6}px 0 rgba(255,62,43,.4)`,- }}- >- {text}- </div>- </div>- );-}-function Intro({ t }: { t: number }) {- const kick = pulse(t, 'kick'),- depart = progress(t, CUE.claim - 0.3, 0.3);- const settle = progress(t, CUE.version, 0.55);- return (- <AbsoluteFill- style={{ transform: `scale(${1 + depart * 0.32 + kick * 0.014})`, opacity: 1 - depart }}- >- <Label>INTRODUCING</Label>- <div- style={{- position: 'absolute',- inset: 0,- transformOrigin: '110px 250px',- transform: `scale(${1.5 - settle * 0.5})`,- }}- >- <HitText text="JEVGREP" t={t} start={CUE.name} x={110} y={250} size={290} />- </div>- <HitText- text="0.5"- t={t}- start={CUE.version}- x={110 + (1 - settle) * 850}- y={580}- size={290}- color={RED}- />- <div- style={{- ...at(1010, 681),- fontFamily: 'Display',- fontSize: 70,- lineHeight: 1.12,- color: WHITE,- opacity: progress(t, CUE.version + 0.5),- transform: `translateX(${(1 - progress(t, CUE.version + 0.5)) * 120}px)`,- }}- >- FIND CODE.- <br />- <span style={{ color: BLUE }}>KEEP CONTEXT.</span>- </div>- <div style={{ ...at(110, 980), height: 4, width: 1700, background: '#fff2' }}>- <div- style={{- height: 4,- width: `${clamp(t / CUE.claim) * 100}%`,- background: RED,- boxShadow: `0 0 ${10 + kick * 30}px ${RED}`,- }}- />- </div>- </AbsoluteFill>- );-}-function Proof({ t }: { t: number }) {- const reframe = progress(t, CUE.fracture, 0.4);- return (- <>- <Label color={BLUE}>JEVGREP 0.5</Label>- <div- style={{- position: 'absolute',- inset: 0,- transformOrigin: '110px 218px',- transform: `translateX(${(1 - reframe) * 160}px) scale(${1.65 - reframe * 0.65})`,- }}- >- <HitText- text="59%"- t={t}- start={CUE.claim}- x={110}- y={218}- size={445}- color={RED}- width={970}- />- </div>- <HitText text="LESS" t={t} start={CUE.fracture} x={1090} y={310} size={120} width={750} />- <HitText- text="JEV API COST"- t={t}- start={CUE.fracture + 0.12}- x={1090}- y={460}- size={94}- width={750}- />- <HitText text="SAME PERFORMANCE." t={t} start={CUE.parity} x={110} y={888} size={89} />- </>- );-}-const paths = ['src/retrieve.ts', 'assets/python/preview.py', 'src/selection.ts'];-function Source({- index,- x,- y,- scale = 1,- opacity = 1,- energy = 0,-}: {- index: number;- x: number;- y: number;- scale?: number;- opacity?: number;- energy?: number;-}) {- return (- <div- style={{- ...at(x, y),- width: 620,- height: 190,- padding: 28,- boxSizing: 'border-box',- border: `2px solid ${energy > 0.1 ? WHITE : index === 0 ? RED : BLUE}`,- background: 'linear-gradient(125deg,#171f2cf5,#090c14f5)',- boxShadow: `0 0 ${32 + energy * 100}px ${energy > 0.1 ? '#c4f3ffbb' : index === 0 ? '#ff3e2b35' : '#87eaff25'}`,- transform: `translate(-50%,-50%) scale(${scale})`,- opacity,- }}- >- <div- style={{- fontFamily: 'Mono',- fontSize: 27,- color: index === 0 ? RED : BLUE,- marginBottom: 24,- }}- >- {paths[index]}- </div>- <div style={{ fontFamily: 'Mono', fontSize: 21, color: WHITE }}>- {- [- 'async function withDirectoryContent(',- 'def preview(query,path,text,budget=16384):',- 'export async function selectFile(',- ][index]- }+ <div style={{ position: 'absolute', inset: 0, background: C.paper, overflow: 'hidden' }}>+ <svg width="0" height="0" style={{ position: 'absolute' }}>+ <defs>+ <filter id="ab" x="0" y="0" width="100%" height="100%" colorInterpolationFilters="sRGB">+ <feColorMatrix in="SourceGraphic" type="matrix" values="1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0" result="r" />+ <feOffset in="r" dx={ab} dy={0} result="ro" />+ <feColorMatrix in="SourceGraphic" type="matrix" values="0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0" result="g" />+ <feColorMatrix in="SourceGraphic" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0" result="b" />+ <feOffset in="b" dx={-ab} dy={0} result="bo" />+ <feBlend in="ro" in2="g" mode="screen" result="rg" />+ <feBlend in="rg" in2="bo" mode="screen" />+ </filter>+ </defs>+ </svg>+ <div style={{ position: 'absolute', inset: 0, filter: ab > 0.4 ? 'url(#ab)' : undefined }}>+ <div style={{ position: 'absolute', inset: -40, transform: `translate(${sx}px, ${sy}px) rotate(${sr}deg)` }}>+ <div style={{ position: 'absolute', left: 40, top: 40, width: W, height: H }}>{children}</div>+ </div></div>- <div style={{ marginTop: 18, height: 4, width: 360, background: '#c1cfdf55' }} />- <div style={{ marginTop: 12, height: 4, width: 240, background: '#c1cfdf35' }} />+ {/* lens: vignette + grain */}+ <div style={{ position: 'absolute', inset: 0, background: 'radial-gradient(120% 100% at 50% 45%, rgba(0,0,0,0) 55%, rgba(30,20,5,0.22) 100%)', pointerEvents: 'none' }} />+ <div style={grainStyle(f)} /></div>);-}-function Search({ t }: { t: number }) {- const lock = bounce(t, CUE.lock),- fade = 1 - progress(t, CUE.lock, 0.25);+};++const Whip: React.FC<{ p: number; dx: number; dy: number; children: React.ReactNode }> = ({ p, dx, dy, children }) => {+ // p: 0..1 through the whip; content offset + directional motion blur+ const blur = Math.sin(Math.PI * clamp(p)) * 90;+ const id = dx !== 0 ? 'wx' : 'wy';return (- <>- <HitText- text="PREVIEW BEFORE FULL READS."- t={t}- start={CUE.search}- x={110}- y={125}- size={106}- />- {[0, 1, 2].map(i => (- <div- key={i}- style={{- ...at(190 + i * 560, 480),- width: 420,- height: 170,- border: `2px solid ${BLUE}`,- background: '#101823',- padding: 28,- boxSizing: 'border-box',- opacity: fade,- }}- >- <div style={{ fontFamily: 'Mono', fontSize: 29, color: BLUE }}>PREVIEW</div>- {[280, 220, 300].map((w, j) => (- <div key={j} style={{ height: 5, width: w, background: '#dbe7f688', marginTop: 18 }} />- ))}- </div>- ))}- <div style={{ opacity: clamp(lock * 3) }}>- <Source- index={0}- x={960}- y={625}- scale={0.5 + lock * 0.85}- energy={pulse(t, 'accent', 0.1)}- />- <div- style={{- ...at(1320, 510),- width: 104,- height: 104,- borderRadius: '50%',- background: BLUE,- color: '#08090d',- fontFamily: 'Display',- fontSize: 73,- textAlign: 'center',- lineHeight: '104px',- }}- >- ✓- </div>- </div>- <HitText- text="FULL READS ONLY WHEN RELEVANT."- t={t}- start={CUE.lock + 0.25}- x={110}- y={888}- size={70}- color={BLUE}- />- </>+ <div style={{ position: 'absolute', inset: 0, transform: `translate(${dx * p}px, ${dy * p}px)`, filter: blur > 1 ? `url(#${id})` : undefined }}>{children}</div>);-}-function Context({ t }: { t: number }) {- const collect = progress(t, CUE.collect, 0.85),- tick = pulse(t, 'kick', 0.08);+};++export const Film: React.FC = () => {+ useFonts();+ const f = useCurrentFrame();+ const t = useT();+ const w1 = inOut(prog(t, 5.8, 6.15)); // horizontal whip: mountain -> assay+ const w2 = inOut(prog(t, 11.82, 12.2)); // vertical whip: assay -> cost+ const b1 = Math.sin(Math.PI * w1) * 110;+ const b2 = Math.sin(Math.PI * w2) * 110;return (<>- <HitText text="ONE BRIEF. MORE CODE." t={t} start={CUE.context} x={110} y={125} size={120} />- {[0, 1, 2].map(i => (- <div- key={i}- style={{- ...at(160 + i * 555 + (960 - (160 + i * 555)) * collect, 330 - collect * 20),- width: 490,- height: 85,- background: BLUE,- color: '#08090d',- fontFamily: 'Mono',- fontSize: 27,- lineHeight: '85px',- textAlign: 'center',- opacity: clamp(1 - collect * 3),- transform: `translateX(${-collect * 245}px)`,- }}- >- RELEVANCE CRITERIA- </div>- ))}- {Array.from({ length: 18 }, (_, i) => {- const x = 190 + (i % 6) * 266,- y = 495 + Math.floor(i / 6) * 115;- return (+ <style>{FONT_CSS}</style>+ <svg width="0" height="0" style={{ position: 'absolute' }}>+ <defs>+ <filter id="wx" x="-20%" y="0" width="140%" height="100%">+ <feGaussianBlur stdDeviation={`${b1} 0`} />+ </filter>+ <filter id="wy" x="0" y="-20%" width="100%" height="140%">+ <feGaussianBlur stdDeviation={`0 ${b2}`} />+ </filter>+ </defs>+ </svg>+ <Html5Audio src={staticFile('score.wav')} />+ <Frame t={t} f={f}>+ {t < 6.3 && (+ <div style={{ position: 'absolute', inset: 0, transform: `translateX(${-W * w1}px)`, filter: b1 > 1 ? 'url(#wx)' : undefined }}>+ <Mountain t={t} />+ </div>+ )}+ {t >= 5.75 && t < 12.3 && (<div- key={i}style={{- ...at(- x + (550 + (i % 6) * 130 - x) * collect,- y + (500 + Math.floor(i / 6) * 75 - y) * collect,- ),- width: 210 * (1 - collect) + 110 * collect,- height: 72 * (1 - collect) + 48 * collect,- border: `2px solid ${BLUE}`,- background: '#132130',- transform: `scale(${1 + tick * 0.035})`,+ position: 'absolute',+ inset: 0,+ transform: `translate(${W * (1 - w1) * (t < 6.5 ? 1 : 0)}px, ${-H * w2}px)`,+ filter: t < 6.5 ? (b1 > 1 ? 'url(#wx)' : undefined) : b2 > 1 ? 'url(#wy)' : undefined,}}>- {[0, 1, 2].map(j => (- <div- key={j}- style={{- margin: '6px 12px',- height: 3,- width: `${70 - j * 13}%`,- background: '#cfe5fa99',- }}- />- ))}+ <Assay t={t} /></div>- );- })}- <div- style={{- ...at(475, 330),- width: 950,- height: 405,- border: `3px solid ${BLUE}`,- boxShadow: '0 0 25px #87eaff22',- opacity: collect,- }}- >- <div- style={{- height: 92,- background: BLUE,- color: '#08090d',- fontFamily: 'Mono',- fontSize: 38,- textAlign: 'center',- lineHeight: '92px',- }}- >- ONE SHARED BRIEF- </div>- </div>- <HitText- text="UP TO 128 CODE UNITS PER BATCH."- t={t}- start={CUE.collect + 0.6}- x={110}- y={865}- size={75}- />- </>- );-}-function Thumbnail() {- return (- <>- <div style={{ ...at(110, 100), fontFamily: 'Display', fontSize: 91, color: WHITE }}>- INTRODUCING JEVGREP 0.5- </div>- <div style={{ ...at(115, 250), fontFamily: 'Mono', fontSize: 32, color: BLUE }}>- Find code by what it does.- </div>- <div- style={{- ...at(110, 370),- width: 1700,- height: 380,- border: '1px solid #7e8a9c',- borderLeft: `7px solid ${RED}`,- background: '#0a0e17f5',- fontFamily: 'Mono',- padding: '34px 40px',- boxSizing: 'border-box',- color: WHITE,- fontSize: 29,- lineHeight: 1.65,- }}- >- <div>- <span style={{ color: RED }}>$</span> jg "How are previews used to decide which files to- open?" packages/core- </div>- <div style={{ marginTop: 26 }}>- <span style={{ color: BLUE }}>Jevgrep: 17 relevant files.</span>- <br />- {paths[0]}- <br />- {paths[1]} · {paths[2]} …- </div>- </div>- <div style={{ ...at(115, 838), fontFamily: 'Mono', fontSize: 36, color: WHITE }}>- npm i -g @dzhng/jevgrep- </div>- <div style={{ ...at(115, 901), fontFamily: 'Mono', fontSize: 31, color: BLUE }}>- jg auth → jg skill- </div>+ )}+ {t >= 11.75 && t < 16.4 && (+ <div style={{ position: 'absolute', inset: 0, transform: `translateY(${H * (1 - w2) * (t < 12.6 ? 1 : 0)}px)`, filter: t < 12.6 && b2 > 1 ? 'url(#wy)' : undefined }}>+ <Cost t={t} />+ </div>+ )}+ {t >= 15.6 && <Install t={t} />}+ {t >= 2.0 && t < 15.95 && (+ <div style={{ position: 'absolute', right: 70, top: 64, height: 80, padding: '0 34px', display: 'flex', alignItems: 'center', gap: 16, borderRadius: 40, background: C.red, color: C.paper, fontFamily: MONO, fontWeight: 700, fontSize: 44, letterSpacing: 3, boxShadow: '0 14px 30px rgba(140,40,20,0.35)', opacity: clamp((t - 2.0) * 6) }}>+ jevgrep 0.5+ </div>+ )}+ </Frame></>);-}-function Install({ t }: { t: number }) {+};++export const Poster: React.FC = () => {+ useFonts();return (<>- <HitText text="INSTALL JEVGREP." t={t} start={CUE.install} x={110} y={130} size={132} />- {['npm i -g @dzhng/jevgrep', 'jg auth', 'jg skill'].map((command, i) => {- const p = progress(t, CUE.install + 0.25 + i * 0.5, 0.25);- return (- <div- key={command}- style={{- ...at(120, 420 + i * 175),- fontFamily: 'Mono',- fontSize: 57,- color: WHITE,- opacity: p,- transform: `translateX(${(1 - p) * 100}px)`,- }}- >- <span style={{ color: BLUE, marginRight: 45, fontSize: 35 }}>0{i + 1}</span>- {command}- </div>- );- })}- <div style={{ ...at(115, 970), fontFamily: 'Mono', fontSize: 28, color: BLUE }}>- github.com/dzhng/jevgrep- </div>+ <style>{FONT_CSS}</style>+ <Frame t={0} f={5}>+ <Cost t={15.4} />+ </Frame></>);-}-export function Film() {- const ready = useFonts(),- frame = useCurrentFrame(),- seconds = frame / FPS,- pre = seconds < PRE,- t = Math.max(0, (frame - Math.round(PRE * FPS)) / FPS);- return (- <AbsoluteFill style={{ background: '#08090d', overflow: 'hidden' }}>- <Audio src={staticFile('score.wav')} />- {ready && (- <>- <Field t={pre ? 22 : t} />- {pre ? (- <Thumbnail />- ) : t < CUE.claim ? (- <Intro t={t} />- ) : t < CUE.search ? (- <Proof t={t} />- ) : t < CUE.context ? (- <Search t={t} />- ) : t < CUE.terminal ? (- <Context t={t} />- ) : (- <Install t={t} />- )}- </>- )}- <div- style={{- position: 'absolute',- inset: 0,- pointerEvents: 'none',- boxShadow: 'inset 0 0 180px #0008',- }}- />- </AbsoluteFill>- );-}-export function Poster() {- const ready = useFonts();- return (- <AbsoluteFill style={{ background: '#08090d' }}>- {ready && (- <>- <Field t={4.25} />- <Proof t={4.25} />- </>- )}- </AbsoluteFill>- );-}+};++export const FPS_ = FPS;+export const PRE_ = PRE;diff --git a/video/release/src/Install.tsx b/video/release/src/Install.tsxnew file mode 100644index 0000000..52d147c--- /dev/null+++ b/video/release/src/Install.tsx@@ -0,0 +1,169 @@+import React from 'react';+import { C, MONO, SERIF, clamp, inOutExpo, lerp, outBack, outCubic, outExpo, prog, pulseAt } from './lib.ts';+import { H, INSTALL, W, lineEnd } from './timeline.ts';+import { Header } from './hud.tsx';++// Where the vermilion dot lands on the dotless j (tuned against a rendered frame).+export const DOT = { x: -12, y: 52 };+const WORD = 'ȷevgrep';+const CHIP = { x: W / 2, y: 740, w: 300, h: 120 };+const FONT = 340;++const Word: React.FC<{ t: number }> = ({ t }) => {+ const letters = WORD.split('');+ return (+ <div style={{ display: 'flex', fontFamily: SERIF, fontWeight: 900, fontSize: FONT, lineHeight: `${FONT}px`, letterSpacing: -8, color: C.ink, fontVariationSettings: '"opsz" 144, "SOFT" 0, "WONK" 0' }}>+ {letters.map((ch, i) => {+ const p = outExpo(prog(t, INSTALL.wordmark + i * 0.035, INSTALL.wordmark + 0.4 + i * 0.035));+ return (+ <span key={i} style={{ display: 'inline-block', overflow: 'hidden', height: FONT * 1.08, paddingRight: 2 }}>+ <span style={{ display: 'inline-block', transform: `translateY(${(1 - p) * 110}%)`, opacity: clamp(p * 4) }}>{ch}</span>+ </span>+ );+ })}+ </div>+ );+};++export const Install: React.FC<{ t: number }> = ({ t }) => {+ const grow = inOutExpo(prog(t, INSTALL.iris, INSTALL.iris + 0.4));+ const fold = inOutExpo(prog(t, INSTALL.fold, INSTALL.fold + 0.45));+ // dark window: grows out of the tower, later folds into the jg chip+ const g = grow * (1 - fold);+ const x0 = 520 - 100;+ const y0 = 790;+ let left = 0;+ let top = lerp(H, 0, grow);+ let width = W;+ let height = H;+ let rad = lerp(60, 0, grow);+ if (fold > 0) {+ left = lerp(0, CHIP.x - CHIP.w / 2, fold);+ top = lerp(0, CHIP.y - CHIP.h / 2, fold);+ width = lerp(W, CHIP.w, fold);+ height = lerp(H, CHIP.h, fold);+ rad = lerp(0, 30, fold);+ }+ const contentA = clamp((t - (INSTALL.iris + 0.35)) * 8) * (1 - clamp((t - INSTALL.fold) * 9));+ const chipA = clamp((t - (INSTALL.fold + 0.3)) * 10);+ const active = INSTALL.lines.findIndex((l, i) => t < (INSTALL.lines[i + 1]?.t ?? 1e9));+ const dotP = prog(t, 20.2, 20.5);+ const dotY = lerp(-300, 0, dotP * dotP) - (t > 20.5 ? Math.abs(Math.sin((t - 20.5) * 13)) * 60 * Math.exp(-(t - 20.5) / 0.2) : 0);+ const badge = outBack(prog(t, 20.75, 21.0), 2.6);+ const wmShow = t >= INSTALL.wordmark - 0.05;+ return (+ <div style={{ position: 'absolute', inset: 0, overflow: 'hidden' }}>+ {fold > 0 && <div style={{ position: 'absolute', inset: 0, background: `linear-gradient(180deg,#f8f4ea,#ece5d3)` }} />}+ {/* wordmark */}+ {wmShow && (+ <div style={{ position: 'absolute', left: -120, top: 130, width: W, display: 'flex', justifyContent: 'center' }}>+ <div style={{ position: 'relative' }}>+ <Word t={t} />+ <div+ style={{+ position: 'absolute',+ left: 24 + DOT.x,+ top: 6 + DOT.y,+ width: 84,+ height: 84,+ borderRadius: 42,+ background: `radial-gradient(circle at 35% 30%, #ff8a6f, ${C.red} 55%, ${C.redDeep})`,+ transform: `translateY(${dotY}px) scale(${1 + 0.25 * pulseAt(t, 20.5, 0.1)})`,+ boxShadow: '0 12px 20px rgba(150,40,20,0.35)',+ opacity: t > 20.2 ? 1 : 0,+ }}+ />+ <div+ style={{+ position: 'absolute',+ right: -340,+ top: -60,+ transform: `rotate(6deg) scale(${lerp(3, 1, outExpo(prog(t, 20.7, 20.95)))})`,+ opacity: clamp((t - 20.7) * 12),+ background: C.red,+ color: C.paper,+ fontFamily: MONO,+ fontWeight: 700,+ fontSize: 200,+ lineHeight: 1.05,+ padding: '6px 38px',+ borderRadius: 42,+ letterSpacing: 4,+ boxShadow: '0 24px 40px rgba(140,40,20,0.4), inset 0 3px 0 rgba(255,255,255,0.3)',+ }}+ >+ 0.5+ </div>+ </div>+ </div>+ )}+ {/* dark window / jg chip */}+ {grow > 0 && (+ <div+ style={{+ position: 'absolute',+ left,+ top,+ width,+ height,+ borderRadius: rad,+ background: `radial-gradient(120% 90% at 50% 40%, #20262a, ${C.ink})`,+ boxShadow: fold > 0 ? '0 30px 50px rgba(50,30,10,0.35)' : undefined,+ overflow: 'hidden',+ }}+ >+ {fold > 0 && (+ <div style={{ position: 'absolute', inset: 0, opacity: chipA, display: 'flex', alignItems: 'center', justifyContent: 'center', fontFamily: MONO, fontWeight: 700, fontSize: 64, color: C.paper }}>+ <span style={{ color: C.red, marginRight: 22 }}>❯</span>jg+ </div>+ )}+ </div>+ )}+ {/* typed commands */}+ <div style={{ position: 'absolute', left: 190, top: 330, opacity: contentA, transformOrigin: '0 50%', transform: `scale(${1 + 0.05 * clamp((t - 16) / 3.5)})` }}>+ {INSTALL.lines.map((l, i) => {+ const n = clamp((t - l.t) * l.cps, 0, l.text.length);+ const shown = l.text.slice(0, Math.floor(n));+ const done = t >= lineEnd(i);+ const started = t >= l.t - 0.1;+ const caret = Math.floor(t * 3) % 2 === 0 || !done;+ const isAsk = i === 3;+ const parts = isAsk ? [shown.slice(0, 3), shown.slice(3)] : [shown, ''];+ return (+ <div key={i} style={{ display: 'flex', alignItems: 'center', height: 120, fontFamily: MONO, fontSize: 50, color: C.paper, fontWeight: 500, opacity: started ? 1 : 0 }}>+ <span style={{ color: C.red, marginRight: 30, fontWeight: 700 }}>❯</span>+ <span>+ {isAsk ? (+ <>+ {parts[0]}+ <span style={{ color: '#f4d9a8' }}>{parts[1]}</span>+ </>+ ) : (+ shown+ )}+ </span>+ {active === i && caret && <span style={{ display: 'inline-block', width: 26, height: 58, background: C.red, marginLeft: 6 }} />}+ {done && i < 3 && (+ <span style={{ marginLeft: 40, color: C.red, fontWeight: 700, transform: `scale(${outBack(prog(t, lineEnd(i), lineEnd(i) + 0.15), 3)})` }}>✓</span>+ )}+ </div>+ );+ })}+ </div>+ {t < INSTALL.fold && (+ <div style={{ opacity: contentA }}>+ <Header+ dark+ t={t}+ items={[+ { text: 'INSTALL', from: 16.1, to: 17.3 },+ { text: 'AUTHENTICATE', from: 17.3, to: 17.75 },+ { text: 'ADD THE AGENT SKILL', from: 17.75, to: 18.2 },+ { text: 'ASK', from: 18.2, to: 19.5 },+ ]}+ />+ </div>+ )}+ </div>+ );+};diff --git a/video/release/src/Mountain.tsx b/video/release/src/Mountain.tsxnew file mode 100644index 0000000..e192656--- /dev/null+++ b/video/release/src/Mountain.tsx@@ -0,0 +1,515 @@+import React, { useLayoutEffect, useRef } from 'react';+import { C, MONO, SERIF, Cam, camCss, clamp, inCubic, inOut, inOutExpo, lerp, ms, outBack, outCubic, prog, pulse } from './lib.ts';+import { DRILL, GRID, H, STABS, Stab, W, mulberry32, slipX, slipY } from './timeline.ts';+import { Counter, Header } from './hud.tsx';+import { Wordmark } from './Wordmark.tsx';++// ---------------------------------------------------------------- the mountain+type Slip = { row: number; col: number; x: number; y: number; h: number; rot: number };+const SLIPS: Slip[] = [];+const halfWidth = (row: number) =>+ 200 + row * 150 + Math.sin(row * 1.7) * 150 + Math.sin(row * 0.63 + 1) * 260 + (row > 20 ? (row - 20) * 40 : 0);+{+ const rng = mulberry32(5);+ for (let row = 0; row < GRID.rows; row++)+ for (let col = -60; col <= 60; col++) {+ const x = slipX(row, col);+ if (Math.abs(x) <= halfWidth(row) + (rng() - 0.5) * 420)+ SLIPS.push({ row, col, x: x + (rng() - 0.5) * 14, y: slipY(row) + (rng() - 0.5) * 14, h: rng(), rot: (rng() - 0.5) * 0.09 });+ }+}+const SLIP_W = 84;+const SLIP_H = 112;+const key = (row: number, col: number) => row * 1000 + col + 500;+const STAB_BY_SLIP = new Map<number, Stab>(STABS.map(s => [key(s.row, s.col), s]));+const ORE = STABS.filter(s => s.ore).sort((a, b) => a.t - b.t || a.d - b.d);+const oreIndex = new Map<Stab, number>(ORE.map((s, i) => [s, i]));+const CARD_Y = 190;++const OPEN_DELAY = 0.28;+const LEAVE_T = 5.3;++export function mountainCam(t: number): Cam {+ // 0-1.35 slow push on the terminal, then a speed-ramped pull-back that lands on the beat+ if (t < 1.35) return { x: 0, y: 0, z: 1 + 0.05 * (t / 1.35) };+ if (t < 2.0) {+ const p = Math.pow(prog(t, 1.35, 2.0), 2.3);+ return { x: 0, y: lerp(0, -700, p), z: ms(1.05, 0.23, p) };+ }+ if (t < 2.3) return { x: 0, y: -700, z: 0.23 + (t - 2.0) * 0.03 };+ if (t < 3.1) {+ const p = inOutExpo(prog(t, 2.3, 3.1));+ return { x: lerp(0, -60, p), y: lerp(-700, -660, p), z: ms(0.236, 0.72, p), r: 0 };+ }+ if (t < LEAVE_T) {+ const p = prog(t, 3.1, LEAVE_T);+ return { x: lerp(-60, 30, p), y: lerp(-660, -540, p), z: lerp(0.72, 0.8, p), r: lerp(0, -0.8, p) };+ }+ const p = inOut(prog(t, LEAVE_T, 6.1));+ return { x: lerp(30, 1000, p), y: lerp(-540, -720, p), z: lerp(0.8, 0.6, p), r: lerp(-0.8, -1.5, p) };+}++// ---------------------------------------------------------------- drawing helpers+function setCam(ctx: CanvasRenderingContext2D, c: Cam) {+ ctx.setTransform(1, 0, 0, 1, 0, 0);+ ctx.translate(W / 2, H / 2);+ ctx.rotate(((c.r ?? 0) * Math.PI) / 180);+ ctx.scale(c.z, c.z);+ ctx.translate(-c.x, -c.y);+}+const rr = (ctx: CanvasRenderingContext2D, x: number, y: number, w: number, h: number, r: number) => {+ ctx.beginPath();+ ctx.roundRect(x, y, w, h, r);+};+const mix = (a: [number, number, number], b: [number, number, number], t: number) =>+ `rgb(${Math.round(lerp(a[0], b[0], t))},${Math.round(lerp(a[1], b[1], t))},${Math.round(lerp(a[2], b[2], t))})`;+const SLIP_LIT: [number, number, number] = [253, 250, 243];+const SLIP_DIM: [number, number, number] = [214, 205, 186];++export function drawSlipFace(ctx: CanvasRenderingContext2D, w: number, h: number, opts: { detail: boolean; ore?: boolean; open?: number; hash?: number; fill?: string }) {+ const { detail, ore, open = 0, hash = 0.5 } = opts;+ rr(ctx, -w / 2, -h / 2, w, h, 6);+ ctx.fillStyle = opts.fill ?? C.slip;+ ctx.fill();+ ctx.lineWidth = ore ? 5 : 1.5;+ ctx.strokeStyle = ore ? C.red : 'rgba(120,105,80,0.28)';+ ctx.stroke();+ if (!detail) return;+ // folded corner+ ctx.beginPath();+ ctx.moveTo(w / 2 - 20, -h / 2);+ ctx.lineTo(w / 2, -h / 2 + 20);+ ctx.lineTo(w / 2 - 20, -h / 2 + 20);+ ctx.closePath();+ ctx.fillStyle = 'rgba(150,135,105,0.28)';+ ctx.fill();+ // text lines+ const n = open > 0 ? 7 : 4;+ for (let i = 0; i < n; i++) {+ const ly = -h / 2 + 26 + i * (open > 0 ? 24 : 17);+ const lw = (w - 30) * (0.45 + ((hash * 7 + i * 0.37) % 0.5));+ const hot = open > 0 && i === 3;+ ctx.fillStyle = hot ? C.red : i === 0 ? 'rgba(21,24,27,0.75)' : 'rgba(120,115,105,0.42)';+ rr(ctx, -w / 2 + 15 + (open > 0 && i > 0 && i < 6 && i % 2 === 0 ? 14 : 0), ly, lw * (hot ? 1 : 0.9), open > 0 ? 9 : 6, 3);+ ctx.fill();+ }+}++function ridge(ctx: CanvasRenderingContext2D, seed: number, base: number, amp: number, color: string, freq: number) {+ const rng = mulberry32(seed);+ const pts: [number, number][] = [];+ let y = 0;+ for (let x = -12000; x <= 12000; x += 500) {+ y = lerp(y, (rng() - 0.5) * 2, 0.5);+ pts.push([x, base - amp * (0.5 + 0.5 * Math.sin(x * freq + seed)) - amp * 0.5 * y]);+ }+ ctx.beginPath();+ ctx.moveTo(-12000, 4000);+ for (const [x, yy] of pts) ctx.lineTo(x, yy);+ ctx.lineTo(12000, 4000);+ ctx.closePath();+ ctx.fillStyle = color;+ ctx.fill();+}++// ---------------------------------------------------------------- frame painter+function paint(ctx: CanvasRenderingContext2D, t: number) {+ const cam = mountainCam(t);+ ctx.setTransform(1, 0, 0, 1, 0, 0);+ const g = ctx.createLinearGradient(0, 0, 0, H);+ g.addColorStop(0, '#f8f4ea');+ g.addColorStop(1, '#e9e2cf');+ ctx.fillStyle = g;+ ctx.fillRect(0, 0, W, H);++ // far ridges (parallax) — paper layers with warm mist between them+ const layers = [+ { seed: 3, base: 300, amp: 2200, col: '#ede6d4', par: 0.3, zk: 0.55, freq: 0.0005 },+ { seed: 8, base: 900, amp: 1900, col: '#e6ddc7', par: 0.45, zk: 0.7, freq: 0.0007 },+ ];+ for (const L of layers) {+ setCam(ctx, { x: cam.x * L.par, y: cam.y * L.par + 300, z: cam.z * L.zk + 0.05, r: cam.r });+ ridge(ctx, L.seed, L.base, L.amp, L.col, L.freq);+ }++ setCam(ctx, cam);++ // shadowed under-body so gaps read as depth+ const top = slipY(0) - 90;+ ctx.beginPath();+ ctx.moveTo(-halfWidth(0) - 70, top);+ for (let row = 0; row < GRID.rows; row++) ctx.lineTo(-halfWidth(row) - 70, slipY(row) + 80);+ for (let row = GRID.rows - 1; row >= 0; row--) ctx.lineTo(halfWidth(row) + 70, slipY(row) + 80);+ ctx.lineTo(halfWidth(0) + 70, top);+ ctx.closePath();+ ctx.shadowColor = 'rgba(70,50,20,0.35)';+ ctx.shadowBlur = 90 * cam.z + 8;+ ctx.shadowOffsetY = 40 * cam.z;+ ctx.fillStyle = '#c9bfa6';+ ctx.fill();+ ctx.shadowColor = 'transparent';+ ctx.shadowBlur = 0;+ ctx.shadowOffsetY = 0;++ const sw = SLIP_W * cam.z;+ const detail = sw > 30;+ const cullX = (W / 2 + 200) / cam.z;+ const cullY = (H / 2 + 260) / cam.z;+ const opens: { s: Slip; st: Stab; o: number }[] = [];++ for (const s of SLIPS) {+ if (Math.abs(s.x - cam.x) > cullX * 1.5 || Math.abs(s.y - cam.y) > cullY * 1.5) continue;+ const st = STAB_BY_SLIP.get(key(s.row, s.col));+ const light = clamp(1 - s.row / 34 + (s.h - 0.5) * 0.25);+ let fill = mix(SLIP_DIM, SLIP_LIT, light);+ let dy = 0;+ let holed = 0;+ if (st && t >= st.t) {+ if (st.ore) {+ const o = prog(t, st.t + OPEN_DELAY, st.t + OPEN_DELAY + 0.3);+ if (o > 0) {+ opens.push({ s, st, o });+ continue;+ }+ } else {+ fill = mix(SLIP_DIM, SLIP_LIT, light * 0.62);+ dy = 3 * prog(t, st.t, st.t + 0.1);+ holed = prog(t, st.t, st.t + 0.05);+ }+ }+ ctx.save();+ ctx.translate(s.x, s.y + dy);+ ctx.rotate(s.rot);+ // contact shadow+ if (!detail) {+ ctx.fillStyle = 'rgba(80,60,30,0.16)';+ ctx.fillRect(-SLIP_W / 2 + 4, -SLIP_H / 2 + 6, SLIP_W, SLIP_H);+ } else {+ ctx.shadowColor = 'rgba(80,60,30,0.28)';+ ctx.shadowBlur = 14;+ ctx.shadowOffsetY = 6;+ }+ drawSlipFace(ctx, SLIP_W, SLIP_H, { detail, hash: s.h, fill });+ ctx.shadowColor = 'transparent';+ ctx.shadowBlur = 0;+ ctx.shadowOffsetY = 0;+ if (holed) {+ ctx.fillStyle = C.ink;+ ctx.beginPath();+ ctx.arc(0, -SLIP_H / 2 + 18, 9 * holed, 0, Math.PI * 2);+ ctx.fill();+ }+ ctx.restore();+ }++ // opened ore slips on top, and the ones leaving toward the assay+ opens.sort((a, b) => a.s.row - b.s.row);+ for (const { s, st, o } of opens) {+ const i = oreIndex.get(st)!;+ const tl = LEAVE_T + 0.045 * i;+ const lp = prog(t, tl, tl + 0.75);+ const grow = 1 + 1.15 * outBack(o, 2.2);+ const lift = outCubic(o);+ let x = s.x;+ let y = s.y - 30 * lift;+ let rot = s.rot * 3 + (s.h - 0.5) * 0.12;+ let sc = grow;+ if (lp > 0) {+ // streak trail+ for (let k = 4; k >= 1; k--) {+ const q = prog(t - k * 0.018, tl, tl + 0.75);+ const gx = x + 5200 * inCubic(q);+ const gy = y - 420 * outCubic(q) + 180 * q * q;+ ctx.save();+ ctx.globalAlpha = 0.12 * (5 - k);+ ctx.translate(gx, gy);+ ctx.rotate(rot + q * 1.6);+ ctx.scale(sc * (1 - 0.3 * q), sc * (1 - 0.3 * q));+ drawSlipFace(ctx, SLIP_W, SLIP_H, { detail: true, ore: true, open: 1, hash: s.h });+ ctx.restore();+ }+ x += 5200 * inCubic(lp);+ y += -420 * outCubic(lp) + 180 * lp * lp;+ rot += lp * 1.6;+ sc *= 1 - 0.3 * lp;+ }+ ctx.save();+ ctx.translate(x, y);+ ctx.rotate(rot);+ ctx.scale(sc, sc);+ ctx.shadowColor = 'rgba(70,40,20,0.4)';+ ctx.shadowBlur = 30;+ ctx.shadowOffsetY = 14;+ drawSlipFace(ctx, SLIP_W, SLIP_H, { detail: true, ore: true, open: 1, hash: s.h });+ ctx.restore();+ }++ drawRig(ctx, t, cam);+ drawChips(ctx, t);++ // foreground bokeh scraps, fast parallax, out of focus+ ctx.setTransform(1, 0, 0, 1, 0, 0);+ const rng = mulberry32(41);+ for (let i = 0; i < 26; i++) {+ const depth = 0.6 + rng() * 1.6;+ const bx = rng() * 2600 - 340 - (cam.x * depth * cam.z * 0.5) + Math.sin(t * 0.4 + i) * 30;+ const by = rng() * 1500 - 200 - cam.y * depth * cam.z * 0.4 + t * 18 * depth;+ const px = ((bx % 2600) + 2600) % 2600 - 340;+ const py = ((by % 1500) + 1500) % 1500 - 200;+ const rad = 16 + depth * 26;+ const gr = ctx.createRadialGradient(px, py, 0, px, py, rad);+ const warm = i % 5 === 0;+ gr.addColorStop(0, warm ? 'rgba(239,86,56,0.32)' : 'rgba(255,252,244,0.5)');+ gr.addColorStop(1, 'rgba(255,255,255,0)');+ ctx.fillStyle = gr;+ ctx.fillRect(px - rad, py - rad, rad * 2, rad * 2);+ }+}++// rail, carriages and drill bits ------------------------------------------------+const RAIL_IN = DRILL.t0 - 0.5;+const RAIL_OUT = DRILL.t0 + DRILL.steps * DRILL.dt + 0.25;+const BIT_LEN = 380;+function stepPos(d: number, k: number) {+ const row = DRILL.rows[Math.floor(k / 4)];+ const col = DRILL.colStart + d * 4 + (k % 4);+ return { x: slipX(row, col), row };+}+function drawRig(ctx: CanvasRenderingContext2D, t: number, cam: Cam) {+ if (t < RAIL_IN || t > RAIL_OUT + 0.5) return;+ const enter = outCubic(prog(t, RAIL_IN, RAIL_IN + 0.4));+ const leave = inCubic(prog(t, RAIL_OUT, RAIL_OUT + 0.5));+ const off = -(1 - enter) * 900 - leave * 900;+ // current step index and rail row+ const hit = (k: number) => DRILL.t0 + k * DRILL.dt;+ const k = clamp(Math.floor((t - DRILL.t0 + 0.11) / DRILL.dt + 1e-6), 0, DRILL.steps - 1);+ const kPrev = Math.max(0, k - 1);+ const move = outCubic(prog(t, hit(kPrev) + 0.08, hit(k) - 0.1));+ const railRow = lerp(stepPos(0, kPrev).row, stepPos(0, k).row, move);+ const railY = slipY(railRow) - 56 - BIT_LEN + off;+ // rail beam+ const bx0 = slipX(14, -13);+ const bx1 = slipX(14, 12);+ const grad = ctx.createLinearGradient(0, railY - 26, 0, railY + 30);+ grad.addColorStop(0, '#3a4046');+ grad.addColorStop(0.5, C.ink);+ grad.addColorStop(1, '#0b0d0f');+ ctx.save();+ ctx.shadowColor = 'rgba(40,25,10,0.4)';+ ctx.shadowBlur = 40;+ ctx.shadowOffsetY = 26;+ rr(ctx, bx0, railY - 26, bx1 - bx0, 56, 14);+ ctx.fillStyle = grad;+ ctx.fill();+ ctx.restore();+ ctx.fillStyle = C.red;+ rr(ctx, bx0 + 30, railY - 4, bx1 - bx0 - 60, 8, 4);+ ctx.fill();++ for (let d = 0; d < DRILL.drills; d++) {+ const px = lerp(stepPos(d, kPrev).x, stepPos(d, k).x, move);+ // carriage+ rr(ctx, px - 46, railY - 40, 92, 84, 14);+ ctx.fillStyle = '#2a2f33';+ ctx.fill();+ ctx.fillStyle = C.red;+ ctx.beginPath();+ ctx.arc(px, railY - 18, 8, 0, Math.PI * 2);+ ctx.fill();+ // bit: descend to the slip, hold, retract+ const tHit = hit(k);+ const tau = t - tHit;+ let ext = 0;+ if (tau >= -0.11 && tau < 0) ext = inCubic((tau + 0.11) / 0.11);+ else if (tau >= 0 && tau < 0.05) ext = 1;+ else if (tau >= 0.05 && tau < 0.24) ext = 1 - outCubic((tau - 0.05) / 0.19);+ // idle bit hangs short; k-1 bit still retracting handled by ext continuity+ const len = 70 + (BIT_LEN - 70 + 12) * ext;+ const y0 = railY + 44;+ rr(ctx, px - 17, y0, 34, len, 8);+ const bg = ctx.createLinearGradient(px - 17, 0, px + 17, 0);+ bg.addColorStop(0, '#0e1113');+ bg.addColorStop(0.35, '#4a5259');+ bg.addColorStop(1, '#14181b');+ ctx.fillStyle = bg;+ ctx.fill();+ // vermilion cutting tip+ ctx.fillStyle = C.red;+ ctx.beginPath();+ const ty = y0 + len;+ ctx.moveTo(px - 19, ty - 34);+ ctx.lineTo(px + 19, ty - 34);+ ctx.lineTo(px + 19, ty);+ for (let z = 0; z < 4; z++) {+ ctx.lineTo(px + 19 - z * 9.5 - 4.75, ty - 10);+ ctx.lineTo(px + 19 - z * 9.5 - 9.5, ty);+ }+ ctx.closePath();+ ctx.fill();+ // impact ring + shards+ if (tau >= 0 && tau < 0.3) {+ const s = STABS.find(q => q.step === k && q.d === d)!;+ const ix = slipX(s.row, s.col);+ const iy = slipY(s.row) - SLIP_H / 2 + 14;+ const p = tau / 0.3;+ ctx.strokeStyle = `rgba(239,86,56,${0.7 * (1 - p)})`;+ ctx.lineWidth = 5 * (1 - p) + 1;+ ctx.beginPath();+ ctx.arc(ix, iy, 20 + 70 * outCubic(p), 0, Math.PI * 2);+ ctx.stroke();+ for (let q = 0; q < 6; q++) {+ const a = -Math.PI * (0.15 + 0.7 * (q / 5));+ const dist = 90 * outCubic(p);+ ctx.fillStyle = `rgba(252,249,242,${1 - p})`;+ ctx.save();+ ctx.translate(ix + Math.cos(a) * dist, iy + Math.sin(a) * dist + 80 * p * p);+ ctx.rotate(q + p * 5);+ ctx.fillRect(-6, -4, 12, 8);+ ctx.restore();+ }+ }+ }+}++// core samples popping out of the slips ---------------------------------------+function drawChips(ctx: CanvasRenderingContext2D, t: number) {+ for (const s of STABS) {+ const tau = t - s.t - 0.04;+ if (tau < 0 || tau > 0.7) continue;+ const ix = slipX(s.row, s.col);+ const iy = slipY(s.row) - SLIP_H / 2 + 14;+ const rng = mulberry32(s.step * 31 + s.d * 7 + 3);+ const vx = (rng() - 0.5) * 140;+ if (s.ore) {+ const p = outCubic(prog(tau, 0, 0.26));+ const y = iy - 150 * p;+ const fade = 1 - prog(tau, 0.26, 0.36);+ const gr = ctx.createRadialGradient(ix, y, 0, ix, y, 90);+ gr.addColorStop(0, `rgba(239,86,56,${0.75 * fade})`);+ gr.addColorStop(1, 'rgba(239,86,56,0)');+ ctx.fillStyle = gr;+ ctx.fillRect(ix - 90, y - 90, 180, 180);+ ctx.globalAlpha = fade;+ chip(ctx, ix, y, C.red, tau * 12);+ ctx.globalAlpha = 1;+ } else {+ const y = iy - 260 * tau + 1500 * tau * tau;+ const a = 1 - prog(tau, 0.3, 0.65);+ ctx.globalAlpha = a;+ chip(ctx, ix + vx * tau, y, '#9b968a', tau * 9);+ ctx.globalAlpha = 1;+ }+ }+}+function chip(ctx: CanvasRenderingContext2D, x: number, y: number, col: string, rot: number) {+ ctx.save();+ ctx.translate(x, y);+ ctx.rotate(Math.sin(rot) * 0.5);+ rr(ctx, -16, -11, 32, 22, 7);+ ctx.fillStyle = col;+ ctx.fill();+ ctx.fillStyle = 'rgba(255,255,255,0.35)';+ rr(ctx, -12, -8, 24, 5, 3);+ ctx.fill();+ ctx.restore();+}++// ---------------------------------------------------------------- terminal card+const PATHS = ['src/retrieve.ts', 'assets/python/preview.py', 'src/selection.ts'];+export const Terminal: React.FC<{ t: number }> = ({ t }) => {+ const caret = Math.floor(t * 2.4) % 2 === 0;+ const hot = Math.floor(prog(t, 0.25, 1.3) * 3.99);+ const mono = { fontFamily: MONO, fontSize: 36, lineHeight: '54px', whiteSpace: 'pre' as const };+ return (+ <div+ style={{+ position: 'absolute',+ left: -720,+ top: CARD_Y - 290,+ width: 1440,+ height: 580,+ borderRadius: 30,+ background: `linear-gradient(180deg, #1f2428, ${C.ink})`,+ boxShadow: '0 60px 120px rgba(50,30,10,0.45), 0 0 0 2px rgba(255,255,255,0.05) inset',+ color: C.paper,+ padding: '34px 64px',+ boxSizing: 'border-box',+ }}+ >+ <div style={{ display: 'flex', gap: 12, marginBottom: 30 }}>+ {[C.red, '#5b6167', '#5b6167'].map((c, i) => (+ <div key={i} style={{ width: 16, height: 16, borderRadius: 8, background: c }} />+ ))}+ </div>+ <div style={mono}>+ <span style={{ color: C.red, fontWeight: 700 }}>❯ </span>+ jg <span style={{ color: '#f4d9a8' }}>"How are previews used to decide which</span>+ </div>+ <div style={mono}>+ {' '}+ <span style={{ color: '#f4d9a8' }}>files to open?"</span> packages/core+ <span style={{ opacity: caret ? 1 : 0, color: C.red }}> ▌</span>+ </div>+ <div style={{ ...mono, marginTop: 26, color: C.red, fontWeight: 700 }}>Jevgrep: 17 relevant files.</div>+ {PATHS.map((p, i) => (+ <div key={p} style={{ ...mono, display: 'flex', alignItems: 'center', gap: 16, color: hot === i ? C.paper : '#a9a598' }}>+ <span style={{ width: 8, height: 40, borderRadius: 4, background: hot === i ? C.red : 'transparent' }} />+ {p}+ </div>+ ))}+ <div style={{ ...mono, color: '#6d7176', paddingLeft: 24 }}>… 14 more</div>+ </div>+ );+};++// ---------------------------------------------------------------- scene+export const Mountain: React.FC<{ t: number }> = ({ t }) => {+ const ref = useRef<HTMLCanvasElement>(null);+ useLayoutEffect(() => {+ const ctx = ref.current!.getContext('2d')!;+ paint(ctx, t);+ });+ const cam = mountainCam(t);+ const blur = 11 * (1 - prog(t, 0.9, 1.7));+ const stabsDone = STABS.filter(s => t >= s.t).length;+ const opened = STABS.filter(s => s.ore && t >= s.t + OPEN_DELAY).length;+ const showHud = t >= 2.0;+ return (+ <div style={{ position: 'absolute', inset: 0, overflow: 'hidden', background: C.paper }}>+ <canvas ref={ref} width={W} height={H} style={{ position: 'absolute', inset: 0, filter: blur > 0.2 ? `blur(${blur}px)` : undefined }} />+ <div style={{ position: 'absolute', left: 0, top: 0, width: W, height: H, transformOrigin: '0 0', transform: camCss(cam) }}>+ <div style={{ position: 'absolute', left: 0, top: 0, transformOrigin: '0 0', transform: `scale(${1 - 0 * blur})` }}>+ <div style={{ opacity: 1 - prog(t, 2.35, 2.9) }}>+ {t < 2.95 && (+ <>+ <div style={{ position: 'absolute', left: -1000, top: -470, width: 2000, display: 'flex', justifyContent: 'center' }}>+ <div style={{ marginRight: 260 }}>+ <Wordmark size={250} />+ </div>+ </div>+ <Terminal t={t} />+ </>+ )}+ </div>+ </div>+ </div>+ {showHud && (+ <Header+ t={t}+ items={[+ { text: 'YOUR REPO', from: 2.0, to: 2.9 },+ { text: 'PEEK BEFORE OPENING', from: 2.9, to: 7 },+ ]}+ right={+ t > 3 && t < 5.9 ? (+ <div style={{ display: 'flex', gap: 46, marginLeft: 0 }}>+ <Counter label="PREVIEWED" value={stabsDone} />+ <Counter label="OPENED" value={opened} />+ </div>+ ) : undefined+ }+ />+ )}+ </div>+ );+};diff --git a/video/release/src/Wordmark.tsx b/video/release/src/Wordmark.tsxnew file mode 100644index 0000000..7a69baf--- /dev/null+++ b/video/release/src/Wordmark.tsx@@ -0,0 +1,37 @@+import React from 'react';+import { C, MONO, SERIF } from './lib.ts';++// Static lockup: dotless j + vermilion dot, with the version badge.+export const Wordmark: React.FC<{ size: number; badge?: number; badgeScale?: number; children?: never }> = ({ size, badge = 1, badgeScale = 1 }) => {+ const k = size / 340;+ return (+ <div style={{ position: 'relative', display: 'inline-block' }}>+ <div style={{ fontFamily: SERIF, fontWeight: 900, fontSize: size, lineHeight: `${size}px`, letterSpacing: -8 * k, color: C.ink, fontVariationSettings: '"opsz" 144, "SOFT" 0, "WONK" 0', textShadow: '0 0 40px rgba(250,246,236,0.9)' }}>+ ȷevgrep+ </div>+ <div style={{ position: 'absolute', left: 12 * k, top: 58 * k, width: 84 * k, height: 84 * k, borderRadius: 42 * k, background: `radial-gradient(circle at 35% 30%, #ff8a6f, ${C.red} 55%, ${C.redDeep})`, boxShadow: '0 12px 20px rgba(150,40,20,0.35)' }} />+ {badge > 0 && (+ <div+ style={{+ position: 'absolute',+ right: -250 * k,+ top: -20 * k,+ transform: `rotate(6deg) scale(${badgeScale})`,+ background: C.red,+ color: C.paper,+ fontFamily: MONO,+ fontWeight: 700,+ fontSize: 190 * k,+ lineHeight: 1.05,+ padding: `${6 * k}px ${34 * k}px`,+ borderRadius: 40 * k,+ letterSpacing: 4,+ boxShadow: '0 24px 40px rgba(140,40,20,0.4), inset 0 3px 0 rgba(255,255,255,0.3)',+ }}+ >+ 0.5+ </div>+ )}+ </div>+ );+};diff --git a/video/release/src/hud.tsx b/video/release/src/hud.tsxnew file mode 100644index 0000000..f75bf7e--- /dev/null+++ b/video/release/src/hud.tsx@@ -0,0 +1,71 @@+import React from 'react';+import { C, MONO, clamp, outCubic, prog } from './lib.ts';++/** One header per shot: says what is happening. Text swaps with a masked rise. */+export const Header: React.FC<{ items: { text: string; from: number; to: number }[]; t: number; dark?: boolean; right?: React.ReactNode }> = ({+ items,+ t,+ dark,+ right,+}) => {+ const col = dark ? C.paper : C.ink;+ return (+ <>+ <div+ style={{+ position: 'absolute',+ left: 70,+ top: 64,+ height: 80,+ padding: '0 40px 0 34px',+ borderRadius: 40,+ background: dark ? 'rgba(42,47,51,0.92)' : 'rgba(250,246,236,0.93)',+ boxShadow: '0 14px 30px rgba(60,40,10,0.22)',+ display: 'flex',+ alignItems: 'center',+ gap: 22,+ fontFamily: MONO,+ fontWeight: 600,+ fontSize: 36,+ letterSpacing: 5,+ color: col,+ }}+ >+ <div style={{ width: 20, height: 20, borderRadius: 10, background: C.red }} />+ <div style={{ position: 'relative', height: 56, overflow: 'hidden', minWidth: 520 }}>+ {items.map((it, i) => {+ const inn = outCubic(prog(t, it.from, it.from + 0.28));+ const out = outCubic(prog(t, it.to - 0.2, it.to));+ const vis = t >= it.from && t < it.to;+ if (!vis) return null;+ return (+ <div+ key={i}+ style={{+ position: 'absolute',+ left: 0,+ top: 0,+ lineHeight: '56px',+ whiteSpace: 'nowrap',+ transform: `translateY(${(1 - inn) * 56 - out * 56}px)`,+ }}+ >+ {it.text}+ </div>+ );+ })}+ </div>+ </div>+ {right && <div style={{ position: 'absolute', left: 70, top: 164, padding: '12px 36px', borderRadius: 34, background: dark ? 'rgba(42,47,51,0.92)' : 'rgba(250,246,236,0.93)', boxShadow: '0 14px 30px rgba(60,40,10,0.22)' }}>{right}</div>}+ </>+ );+};++export const Counter: React.FC<{ label: string; value: number; dark?: boolean }> = ({ label, value, dark }) => (+ <div style={{ display: 'flex', gap: 14, alignItems: 'baseline', fontFamily: MONO, color: dark ? C.paper : C.ink }}>+ <span style={{ fontSize: 22, letterSpacing: 4, opacity: 0.55 }}>{label}</span>+ <span style={{ fontSize: 44, fontWeight: 700, minWidth: 64, textAlign: 'right' }}>{Math.round(value)}</span>+ </div>+);++export const visible = (t: number, a: number, b: number) => clamp(Math.min(t - a, b - t) * 8);diff --git a/video/release/src/index.tsx b/video/release/src/index.tsxindex ad2606b..f14c604 100644--- a/video/release/src/index.tsx+++ b/video/release/src/index.tsx@@ -1,24 +1,12 @@import React from 'react';import { Composition, registerRoot } from 'remotion';-import { Film, Poster } from './Film';-import { FPS, PRE, DURATION } from './timeline';-registerRoot(() => (+import { Film, Poster } from './Film.tsx';+import { FPS, H, TOTAL_FRAMES, W } from './timeline.ts';++const Root: React.FC = () => (<>- <Composition- id="Release"- component={Film}- durationInFrames={Math.round((PRE + DURATION) * FPS)}- fps={FPS}- width={1920}- height={1080}- />- <Composition- id="Poster"- component={Poster}- durationInFrames={1}- fps={FPS}- width={1920}- height={1080}- />+ <Composition id="Release" component={Film} durationInFrames={TOTAL_FRAMES} fps={FPS} width={W} height={H} />+ <Composition id="Poster" component={Poster} durationInFrames={1} fps={FPS} width={W} height={H} /></>-));+);+registerRoot(Root);diff --git a/video/release/src/lib.ts b/video/release/src/lib.tsnew file mode 100644index 0000000..5b8356d--- /dev/null+++ b/video/release/src/lib.ts@@ -0,0 +1,75 @@+import { useCurrentFrame } from 'remotion';+import { FPS, PRE } from './timeline.ts';++export const C = {+ paper: '#f5f1e7',+ paper2: '#ebe5d5',+ slip: '#fcf9f2',+ edge: '#d8d0bd',+ ink: '#15181b',+ ink2: '#2a2f33',+ grey: '#8b877c',+ red: '#ef5638',+ redDeep: '#c93a20',+ redSoft: '#f7a08f',+};+export const SERIF = 'Fraunces, Georgia, serif';+export const MONO = 'PlexMono, ui-monospace, Menlo, monospace';++export const clamp = (x: number, a = 0, b = 1) => Math.min(b, Math.max(a, x));+export const lerp = (a: number, b: number, t: number) => a + (b - a) * t;+export const prog = (t: number, a: number, b: number) => clamp((t - a) / (b - a));+export const inOut = (x: number) => (x < 0.5 ? 4 * x * x * x : 1 - Math.pow(-2 * x + 2, 3) / 2);+export const outCubic = (x: number) => 1 - Math.pow(1 - x, 3);+export const outQuart = (x: number) => 1 - Math.pow(1 - x, 4);+export const outExpo = (x: number) => (x >= 1 ? 1 : 1 - Math.pow(2, -10 * x));+export const inCubic = (x: number) => x * x * x;+export const inExpo = (x: number) => (x <= 0 ? 0 : Math.pow(2, 10 * x - 10));+export const inOutExpo = (x: number) =>+ x <= 0 ? 0 : x >= 1 ? 1 : x < 0.5 ? Math.pow(2, 20 * x - 10) / 2 : (2 - Math.pow(2, -20 * x + 10)) / 2;+export const outBack = (x: number, s = 1.70158) => 1 + (s + 1) * Math.pow(x - 1, 3) + s * Math.pow(x - 1, 2);+export const outElastic = (x: number) =>+ x <= 0 ? 0 : x >= 1 ? 1 : Math.pow(2, -10 * x) * Math.sin((x * 10 - 0.75) * ((2 * Math.PI) / 3)) + 1;+export const outBounce = (x: number) => {+ const n = 7.5625,+ d = 2.75;+ if (x < 1 / d) return n * x * x;+ if (x < 2 / d) return n * (x -= 1.5 / d) * x + 0.75;+ if (x < 2.5 / d) return n * (x -= 2.25 / d) * x + 0.9375;+ return n * (x -= 2.625 / d) * x + 0.984375;+};++/** Main time in seconds; holds the opening frame through the pre-roll. */+export function useT() {+ const f = useCurrentFrame();+ return Math.max(0, f / FPS - PRE);+}++/** Envelope: 1 at the most recent event <= t, decaying exponentially. */+export function pulse(t: number, times: number[], decay = 0.12) {+ let last = -1e9;+ for (const x of times) if (x <= t && x > last) last = x;+ return Math.exp(-(t - last) / decay);+}+export const pulseAt = (t: number, at: number, decay = 0.12) => (t < at ? 0 : Math.exp(-(t - at) / decay));++/** Damped shake offset. */+export function shake(t: number, at: number, amp: number, decay = 0.18, freq = 38) {+ if (t < at) return { x: 0, y: 0, r: 0 };+ const e = Math.exp(-(t - at) / decay);+ return {+ x: Math.sin((t - at) * freq) * amp * e,+ y: Math.cos((t - at) * freq * 1.3) * amp * 0.8 * e,+ r: Math.sin((t - at) * freq * 0.7) * amp * 0.02 * e,+ };+}++export type Cam = { x: number; y: number; z: number; r?: number };+/** world -> screen */+export const w2s = (c: Cam, x: number, y: number, W = 1920, H = 1080) => [+ W / 2 + (x - c.x) * c.z,+ H / 2 + (y - c.y) * c.z,+];+export const camCss = (c: Cam, W = 1920, H = 1080) =>+ `translate(${W / 2}px, ${H / 2}px) rotate(${c.r ?? 0}deg) scale(${c.z}) translate(${-c.x}px, ${-c.y}px)`;+export const ms = (a: number, b: number, t: number) => Math.exp(lerp(Math.log(a), Math.log(b), t));diff --git a/video/release/src/timeline.ts b/video/release/src/timeline.tsindex f0aa892..90d395e 100644--- a/video/release/src/timeline.ts+++ b/video/release/src/timeline.ts@@ -1,63 +1,165 @@-export const FPS = 60,- PRE = 0.3,- DURATION = 18,- BPM = 120;-export const CUE = {- introduce: 0,- name: 0.25,- version: 1,- claim: 2.5,- fracture: 3,- parity: 3.5,- search: 5,- scan: 5.25,- lock: 7,- context: 9,- collect: 10.5,- terminal: 13.5,- results: 14,- install: 13.5,- end: 18,+// Single timing source. Scenes and score.mjs both import this file (times are in+// "main time": seconds after the 0.3s thumbnail pre-roll).+export const FPS = 60;+export const W = 1920;+export const H = 1080;+export const PRE = 0.3;+export const DUR = 22;+export const BPM = 120;+export const BEAT = 60 / BPM;+export const TOTAL_FRAMES = Math.round((PRE + DUR) * FPS);++export function mulberry32(seed: number) {+ let a = seed >>> 0;+ return () => {+ a = (a + 0x6d2b79f5) >>> 0;+ let t = a;+ t = Math.imul(t ^ (t >>> 15), t | 1);+ t ^= t + Math.imul(t ^ (t >>> 7), t | 61);+ return ((t ^ (t >>> 14)) >>> 0) / 4294967296;+ };+}++export const SCENES = {+ mountain: [0, 6],+ assay: [6, 12],+ cost: [12, 16],+ install: [16, 22],+} as const;++// ---- Mountain: core-drill previews ------------------------------------------+export const GRID = { colW: 110, rowH: 140, top: -2600, rows: 29 };+export const slipX = (row: number, col: number) => col * GRID.colW + (row % 2) * 55;+export const slipY = (row: number) => GRID.top + row * GRID.rowH;++export const DRILL = {+ t0: 2.75,+ dt: 0.25,+ steps: 12,+ drills: 5,+ rows: [13, 14, 15],+ colStart: -10,};-export const SHOTS = [- { at: 0, end: 2.5 },- { at: 2.5, end: 5 },- { at: 5, end: 9 },- { at: 9, end: 13.5 },- { at: 13.5, end: 18 },-];-export type Event = { t: number; kind: 'kick' | 'snare' | 'hat' | 'accent'; a: number };-export const EVENTS: Event[] = [- ...Array.from({ length: DURATION * 2 }, (_, i) => ({- t: i * 0.5,- kind: 'kick' as const,- a: i < 4 ? 0.65 : 1,- })),- ...Array.from({ length: DURATION }, (_, i) => ({ t: i + 0.5, kind: 'snare' as const, a: 0.8 })),- ...Array.from({ length: DURATION * 4 }, (_, i) => ({- t: i * 0.25,- kind: 'hat' as const,- a: i % 2 ? 0.7 : 0.3,- })),- ...Array.from(new Set(Object.values(CUE)))- .filter(t => t < DURATION)- .map(t => ({ t, kind: 'accent' as const, a: 1 })),+export type Stab = { t: number; d: number; step: number; row: number; col: number; ore: boolean };+export const STABS: Stab[] = (() => {+ const rng = mulberry32(11);+ const list: Stab[] = [];+ for (let k = 0; k < DRILL.steps; k++)+ for (let d = 0; d < DRILL.drills; d++)+ list.push({+ t: DRILL.t0 + k * DRILL.dt,+ d,+ step: k,+ row: DRILL.rows[Math.floor(k / 4)],+ col: DRILL.colStart + d * 4 + (k % 4),+ ore: false,+ });+ const order = list.map((_, i) => i).sort(() => rng() - 0.5);+ // ore: 12 of 60, at most 2 per step so the rhythm stays even+ const perStep = new Array(DRILL.steps).fill(0);+ let n = 0;+ for (const i of order) {+ if (n >= 12) break;+ if (perStep[list[i].step] >= 2) continue;+ list[i].ore = true;+ perStep[list[i].step]++;+ n++;+ }+ return list;+})();++// ---- Assay: one brief, one batch -------------------------------------------+export const ASSAY = {+ tiles: 12,+ slideIn: 6.0, // tiles arrive on the belt+ tagPop: 6.4, // 12 tags, one every 0.04s+ peel: 7.0, // tags leave their tiles+ fuse: 7.5, // tags become one brief+ slam: 8.0, // stamp hits the batch+ verdict: 8.0, // wave of verdicts, 0.05s apart+ cards: 10.0, // verified tiles unfold into source cards+ keepers: [0, 2, 3, 5, 6, 8, 9, 11], // tiles the stamp passes+};+export const TAG_POPS = Array.from({ length: ASSAY.tiles }, (_, i) => ASSAY.tagPop + i * 0.04);+export const VERDICTS = Array.from({ length: ASSAY.tiles }, (_, i) => ({+ t: ASSAY.verdict + 0.03 + i * 0.05,+ pass: ASSAY.keepers.includes(i),+}));++// ---- Cost: the tower -------------------------------------------------------+export const COST = {+ start: 12.0,+ dropStep: 0.125, // 9 coins per 16th note+ perStep: 9,+ cut: 13.5,+ total: 100,+ kept: 41,+};+export const COIN_DROPS = Array.from({ length: 12 }, (_, k) => COST.start + 0.05 + k * COST.dropStep);++// ---- Install ---------------------------------------------------------------+export const INSTALL = {+ iris: 15.65, // dark terminal grows out of the tower+ lines: [+ { text: 'npm install -g @dzhng/jevgrep', t: 16.4, cps: 42 },+ { text: 'jg auth', t: 17.3, cps: 30 },+ { text: 'jg skill', t: 17.75, cps: 30 },+ { text: 'jg "How are telemetry events recorded and sent?" .', t: 18.2, cps: 48 },+ ],+ fold: 19.5, // terminal folds into the jg chip+ wordmark: 20.0,+ dotLand: 20.5,+};+export const KEYS: number[] = INSTALL.lines.flatMap(l =>+ Array.from({ length: l.text.length }, (_, i) => l.t + (i + 1) / l.cps),+);+export const lineEnd = (i: number) => INSTALL.lines[i].t + INSTALL.lines[i].text.length / INSTALL.lines[i].cps;++// ---- Music schedule --------------------------------------------------------+const range = (a: number, b: number, s: number) => {+ const out: number[] = [];+ for (let t = a; t < b - 1e-6; t += s) out.push(+t.toFixed(4));+ return out;+};+export const KICKS = [...range(2.0, 16.0, BEAT), 16.0, 17.0, 18.0, 19.0];+export const SNARES = range(4.5, 16.0, 1.0); // beats 2 and 4+export const HATS = [...range(2.0, 12.0, 0.25), ...range(12.0, 16.0, 0.125)];+export const IMPACTS: { t: number; size: number }[] = [+ { t: 2.0, size: 1 },+ { t: 6.0, size: 0.5 },+ { t: 8.0, size: 1 },+ { t: 10.0, size: 0.7 },+ { t: 12.0, size: 0.5 },+ { t: 13.5, size: 1 },+ { t: 16.0, size: 0.7 },+ { t: 20.0, size: 1.1 },+ { t: 20.75, size: 0.8 },];-export const clamp = (x: number) => Math.min(1, Math.max(0, x));-export const ease = (x: number) => 1 - (1 - clamp(x)) ** 3;-export const progress = (t: number, at: number, duration = 0.5) => ease((t - at) / duration);-export const pulse = (t: number, kind: Event['kind'], decay = 0.14) =>- Math.min(- 1.5,- EVENTS.filter(e => e.kind === kind && t >= e.t && t - e.t < decay * 7).reduce(- (sum, e) => sum + e.a * Math.exp(-(t - e.t) / decay),- 0,- ),- );-export const REVIEW = [- 0.15, 0.9, 1.8, 2.6, 3.25, 4.25, 5.15, 5.9, 7.1, 8.6, 9.5, 10.8, 12.5, 13.6, 14.3, 15.4, 17.8,+export const RISERS: [number, number][] = [+ [0.8, 2.0],+ [7.0, 8.0],+ [9.0, 10.0],+ [11.0, 12.0],+ [12.75, 13.5],+ [19.0, 20.0],];-export const IMPACT_REVIEW = [- 2.95, 3, 3.08, 3.25, 3.5, 4.1, 6.9, 7, 7.15, 7.4, 8, 8.5, 10.4, 10.5, 10.7, 11, 11.3, 12, 13.5,- 13.7, 14, 14.5, 15, 17,+export const WHIPS = [5.85, 11.85];+// chord per 2s bar: root Hz + triad+const A = 220;+export const CHORDS = [+ [A, 1.2, 1.5],+ [A, 1.2, 1.5],+ [A * 0.794, 1.25, 1.5],+ [A * 1.189, 1.25, 1.5],+ [A * 0.891, 1.25, 1.5],+ [A, 1.2, 1.5],+ [A * 0.794, 1.25, 1.5],+ [A * 1.189, 1.25, 1.5],+ [A * 0.891, 1.25, 1.5],+ [A, 1.2, 1.5],+ [A, 1.2, 1.5],];++// ---- Review times ----------------------------------------------------------+export const REVIEW = [0.2, 1.7, 2.1, 2.8, 3.6, 4.6, 5.5, 6.6, 7.3, 7.9, 8.2, 8.9, 10.4, 11.4, 12.6, 13.4, 13.7, 14.8, 15.85, 16.8, 18.0, 19.3, 20.2, 21.5];+export const IMPACT_REVIEW = IMPACTS.map(i => i.t);diff --git a/video/release/tsconfig.json b/video/release/tsconfig.jsonindex 7d86275..e4aad66 100644--- a/video/release/tsconfig.json+++ b/video/release/tsconfig.json@@ -1 +1 @@-{"compilerOptions":{"target":"ES2022","module":"ESNext","moduleResolution":"Bundler","jsx":"react-jsx","strict":true,"skipLibCheck":true,"noEmit":true,"lib":["ES2022","DOM","DOM.Iterable"]},"include":["src"]}+{"compilerOptions":{"target":"ES2022","module":"ESNext","moduleResolution":"Bundler","jsx":"react-jsx","strict":true,"skipLibCheck":true,"noEmit":true,"allowImportingTsExtensions":true,"lib":["ES2022","DOM","DOM.Iterable"]},"include":["src"]}