teaser v4: calm 60 s 16:9 cut, from an empty folder to ready on both stores
Nine scenes of 6-7 s, one slow camera move each, soft dissolves, one plain-English caption per scene at the top (on screen at least 4 s): the stores' to-do list and one rejection mail, `init` in an empty folder, the agent prompt and `release plan` (25 steps), store text and renders in 7 sizes x 4 languages, `play products --dry` and `catalog diff`, the scan's declarations proposal with the ask-owner line, three findings with plain reasons turning green, the desktop release timeline and Store readiness "No blockers", Submit and the end card. Every CLI line is real output: tests/teaser.test.ts runs each command (store answers from tests/helpers/teaser-store-mock.ts, preloaded through bunfig.toml, never the network) and checks scene lengths, caption holds, the 55-65 s total and 16:9 only. The vertical output is gone; the web version targets 4.5 MB. Calmer music (D major pads, soft pluck, bells on scene changes). desktop.ts adds the Store readiness frame.
This commit is contained in:
parent
179e4d3815
commit
f07f3acbd8
12 changed files with 1197 additions and 1381 deletions
|
|
@ -1,59 +1,64 @@
|
||||||
# storebound teaser (about 37 s social video)
|
# storebound teaser (60 s, 16:9)
|
||||||
|
|
||||||
A scripted motion piece, not a screen recording. Every frame is a pure function of time, rendered from an
|
A calm, scripted motion piece: from an empty folder to everything ready on both stores. Every frame is a pure function
|
||||||
HTML/CSS/JS timeline in headless Chrome and encoded with ffmpeg. The music and the sound design are original and
|
of time, rendered from an HTML/CSS/JS timeline in headless Chrome and encoded with ffmpeg. The music and the sound
|
||||||
synthesized from scratch in the same browser (Web Audio `OfflineAudioContext`): no samples, no downloaded audio,
|
design are original and synthesized from scratch in the same browser (Web Audio `OfflineAudioContext`): no samples,
|
||||||
nothing to license.
|
no downloaded audio, nothing to license.
|
||||||
|
|
||||||
| s | scene |
|
One idea per scene, 6-7 s each, one slow camera move per scene, soft dissolves between scenes. Each scene has one
|
||||||
|---|---|
|
plain-English caption at the top, fully on screen for at least 4 s; below it, the real product.
|
||||||
| 0.00-3.28 | hook: a generic, made-up inbox; three rejection mails stack up, then "Rejected. Again." |
|
|
||||||
| 3.28-11.25 | hard cut to black: `storebound scan` is typed; the real output: SDKs with file:line, five findings with guideline and fix, the camera on each |
|
| s | shows | caption |
|
||||||
| 11.25-14.06 | the re-scan after the fixes: the five reds flip green, 0 blockers |
|
|---|---|---|
|
||||||
| 14.06-16.88 | the store screenshot wall (the demo game's real renders), 200 store screenshots |
|
| 0-6 | the demo game's icon, "Done"; the stores' to-do list line by line; one rejection mail (Guideline 2.1) | Your app is done. The stores are not. |
|
||||||
| 16.88-19.69 | the declarations proposal from the scan, Data safety answers ticking, 764 answers |
|
| 6-12 | an empty folder; `bunx storebound init` is typed; the files it creates list in | storebound takes it from an empty folder. |
|
||||||
| 19.69-28.13 | the desktop app (real frames, fixture data): Portfolio across studios · release timeline, rollout filling to 20% · Checks, rejection risks turning green |
|
| 12-19 | the prompt "Get my app ready for both stores."; `storebound release plan 1.0.0`: 25 steps in fix order | You ask once. It plans every step. |
|
||||||
| 28.13-30.94 | CLI montage, three panels cut on the beat: `storebound api coverage` (1303 App Store Connect + 170 Google Play endpoints) · `play build --dry` plan · `console fill apple-app-privacy --dry` answers |
|
| 19-26 | the demo game's store text in 4 languages; its renders in 7 store sizes x 4 languages | Store text and screenshots. Every language, every size. |
|
||||||
| 30.94-33.75 | "It never presses Submit. You do." over a Submit button |
|
| 26-33 | `play products --dry` (174 regions), then `catalog diff` (175 / 174 region prices, 0 mismatches) | In-app products on both stores, priced in 175 countries. |
|
||||||
| 33.75-36.56 | logo, storebound.dev, Open source · macOS · Windows · Linux |
|
| 33-40 | the scan's declarations proposal: detected answers with file:line, one "ask owner" line highlighted; 764 Data safety answers | The forms, answered from your code. It asks what it can't know. |
|
||||||
|
| 40-47 | `storebound scan`: three findings, each with a plain reason; fixed, the re-scan is clean | It catches rejections before Apple does. |
|
||||||
|
| 47-54 | the desktop app: the release timeline with both stores on one track, then Store readiness: "No blockers" | Both stores, one view. Ready for review. |
|
||||||
|
| 54-60 | "Submit for Review" with the cursor resting on it (it never clicks), then the end card: storebound.dev, Open source · CLI · Desktop app | You press Submit. That's it. |
|
||||||
|
|
||||||
| file | what |
|
| file | what |
|
||||||
|---|---|
|
|---|---|
|
||||||
| `script.js` | the timeline: 128 BPM, scenes in beats (every cut on the beat), captions, the inbox, the scan lines, the desktop camera, the sound cues |
|
| `script.js` | the timeline: scenes in seconds, camera moves, captions, every line shown, the sound cues |
|
||||||
| `desktop.ts` | the desktop scenes' frames: apps/desktop's Vite dev server in fixture mode (`VITE_FIXTURES=1`, example.com-style data), captured headlessly in dark at 1280x800 @2x with the dev markers hidden, plus `boxes.json` (cursor and callout targets) -> `out/desktop/` |
|
| `desktop.ts` | the desktop frames: apps/desktop's Vite dev server in fixture mode (`VITE_FIXTURES=1`, example.com-style data), captured headlessly in dark at 1280x800 @2x with the dev markers hidden, plus `boxes.json` (callout targets) -> `out/desktop/` |
|
||||||
| `index.html` + `teaser.js` | the picture; `window.teaser.seek(t)` sets every element for time `t` |
|
| `index.html` + `teaser.js` | the picture; `window.teaser.seek(t)` sets every element for time `t` |
|
||||||
| `music.js` | music (F minor: tense intro, silence for the typed command, the groove from Enter, a calm bar under Submit, the logo hit) and sound design: mail blips, key clicks, a whoosh into every whip / mask / zoom, a hit on every cut, ticks on findings, rising chimes on fixes |
|
| `music.js` | calm music (D major, one chord per scene: pads, a slow soft pluck, a quiet sub) and soft sound design: a bell and an airy swell on each scene change, key clicks, quiet ticks, chimes for the fixes |
|
||||||
| `render.ts` | frames at 60 fps blended to 30 fps (motion blur) -> ffmpeg (H.264 high, yuv420p), sound -> loudnorm (-14 LUFS, -1.5 dBTP), mux, posters, the 1280x720 web version |
|
| `render.ts` | frames at 60 fps blended to 30 fps -> ffmpeg (H.264 high, yuv420p), sound -> loudnorm (-16 LUFS, -1.5 dBTP), mux, poster, the 1280x720 web version |
|
||||||
| `icons/` | the mouse cursor and the UI icons: Phosphor files copied unchanged by `bun tools/site-icons.ts` (no hand-written SVG; CI checks it) |
|
| `icons/` | the mouse cursor and the UI icons: Phosphor files copied unchanged by `bun tools/site-icons.ts` (no hand-written SVG; CI checks it) |
|
||||||
| `poster.jpg` | end card still (1920x1080, small) |
|
|
||||||
|
|
||||||
The scan text is the real `storebound scan` output of `tests/fixtures/scan/teaser` (five classic App Review
|
Every CLI line in the video is real output, and `tests/teaser.test.ts` runs each command and checks every line (the
|
||||||
rejections) and, after the fixes, of `tests/fixtures/scan/teaser-fixed`; `tests/teaser.test.ts` runs both scans and
|
clock prefix and the "(0s)" timer left out):
|
||||||
checks every line the video shows, the beat grid, the caption lengths (at most 7 words) and holds (at least 1.2 s), and
|
|
||||||
that every scene holds at least 2.5 s. Each fix line shows a verbatim piece of the real fix. The mail list is fictional:
|
- `storebound init` in an empty temp folder.
|
||||||
no real names or addresses, no mail-app branding. The montage lines are real output too, trimmed (revision dates,
|
- `storebound release plan 1.0.0`, `play products --dry` and `catalog diff` in that folder, with the stores answered by
|
||||||
clock prefixes and the source column left out): `api coverage` in the repo, `play build --dry --version-code 12` in a
|
`tests/helpers/teaser-store-mock.ts` (preloaded through a `bunfig.toml` in the folder, so the children `release plan`
|
||||||
throwaway example.com Capacitor project, `console fill apple-app-privacy --dry` in `examples/demo-app`; the test runs
|
starts use it too; nothing reaches the network): a brand-new app record with nothing on it for the plan and the dry
|
||||||
each command and checks every line and the endpoint counts. The desktop scenes are real frames of the app on its fixture data;
|
run, then the two products on both stores for the diff. Regions: the App Store's 175 storefronts, Google Play 174
|
||||||
the "after" Checks frame is the same tab with the fixture's scan answering no findings.
|
(the count Play answered in a recorded read-only run).
|
||||||
|
- `storebound scan` of `tests/fixtures/scan/teaser` (findings, declarations proposal) and of `teaser-fixed` after the
|
||||||
|
fixes, and the Data safety answer count of `storebound check`.
|
||||||
|
|
||||||
|
The plain reasons under the findings and the callouts on the desktop frames are annotations, set apart from the CLI
|
||||||
|
text. The store text is `examples/demo-game/store/shots/copy.json`, the screenshots its real renders, the app icon its
|
||||||
|
`store/icon/icon.png`. The mail row is fictional: no real names or addresses, no mail-app branding. The test also checks
|
||||||
|
the timing: scenes 6-7 s, captions on screen at least 4 s, 55-65 s in total, 16:9 only.
|
||||||
|
|
||||||
## Render
|
## Render
|
||||||
|
|
||||||
Needs Bun, ffmpeg and Playwright (repo devDependency; Playwright's Chromium or an installed Google Chrome).
|
Needs Bun, ffmpeg, Playwright (repo devDependency; Playwright's Chromium or an installed Google Chrome) and the demo
|
||||||
|
game's store renders:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
# optional, for the real screenshot wall: the demo renders (otherwise crops of docs/img/showcase.jpg are used)
|
|
||||||
cd examples/demo-game && bun serve.ts & bun ../../cli/index.ts shots capture && bun ../../cli/index.ts shots fonts && bun ../../cli/index.ts shots render
|
cd examples/demo-game && bun serve.ts & bun ../../cli/index.ts shots capture && bun ../../cli/index.ts shots fonts && bun ../../cli/index.ts shots render
|
||||||
# from the repo root
|
# from the repo root
|
||||||
bun media/teaser/render.ts # both formats, sound, posters, web version: about 15 min
|
bun media/teaser/render.ts > media/teaser/out/render.log 2>&1 & # master, sound, poster, web version: about 15 min
|
||||||
bun media/teaser/render.ts --desktop # capture the desktop app frames again (after a UI change)
|
bun media/teaser/render.ts --desktop # capture the desktop app frames again (after a UI change)
|
||||||
bun media/teaser/render.ts --only v # vertical only (h = horizontal; the web version is made from h)
|
|
||||||
bun media/teaser/render.ts --stills 2,12.5,30 # PNG stills in out/stills for a quick layout check
|
bun media/teaser/render.ts --stills 2,12.5,30 # PNG stills in out/stills for a quick layout check
|
||||||
bun media/teaser/render.ts --serve --port 8750 # live preview: /index.html?w=1080&h=1920&play=1 (or &t=12.5)
|
bun media/teaser/render.ts --serve --port 8750 # live preview: /index.html?play=1 (or ?t=12.5)
|
||||||
```
|
```
|
||||||
|
|
||||||
Outputs (gitignored) in `media/teaser/out/`: `teaser-1080x1920.mp4` (X / TikTok / Reels), `teaser-1920x1080.mp4`
|
Outputs (gitignored) in `media/teaser/out/`: `teaser-1920x1080.mp4` (master), `teaser-web.mp4` (1280x720, about
|
||||||
(X / YouTube), `teaser-web.mp4` (1280x720, about 3.5 MB, for the site) with `poster-web.jpg`, `-silent` variants,
|
4.5 MB) with `poster-web.jpg`, `teaser-1920x1080-silent.mp4`, `poster-1920x1080.jpg`, `music.wav`.
|
||||||
`poster-*.jpg`, `music.wav`.
|
|
||||||
|
|
||||||
The vertical layout keeps captions inside the centre 80% and the bottom ~22% free of key text for app overlays.
|
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,16 @@
|
||||||
#!/usr/bin/env bun
|
#!/usr/bin/env bun
|
||||||
// Real desktop-app frames for the teaser's three desktop scenes: the Vite dev server of apps/desktop in fixture mode
|
// Real desktop-app frames for the teaser's desktop scene: the Vite dev server of apps/desktop in fixture mode
|
||||||
// (VITE_FIXTURES=1: example.com-style fixture data, no Tauri, no store accounts), captured headlessly, dark theme,
|
// (VITE_FIXTURES=1: example.com-style fixture data, no Tauri, no store accounts), captured headlessly, dark theme,
|
||||||
// with the two dev-build markers hidden (they are not in a release build).
|
// with the two dev-build markers hidden (they are not in a release build).
|
||||||
// Writes media/teaser/out/desktop/*.jpg plus boxes.json (cursor and callout targets, as fractions of the frame).
|
// Writes media/teaser/out/desktop/*.jpg plus boxes.json (callout targets, as fractions of the frame).
|
||||||
// portfolio.jpg Portfolio: every app of every studio, grouped by studio
|
// portfolio.jpg Portfolio: every app of every studio, grouped by studio
|
||||||
// releases.jpg Prism Puddle's release timeline, both stores rolling out at 20%
|
// releases.jpg Prism Puddle's release timeline, both stores rolling out at 20%
|
||||||
// releases-empty.jpg the same frame with the rollout bars' fill and "20%" hidden (the video fills the bar)
|
// releases-empty.jpg the same frame with the rollout bars' fill and "20%" hidden (the video fills the bar)
|
||||||
// checks.jpg the Checks tab: the "Rejection risks" card with its findings
|
// checks.jpg the Checks tab: the "Rejection risks" card with its findings
|
||||||
// checks-clean.jpg the same tab after the fixes: the fixture's scan answer with no findings (the app's own
|
// checks-clean.jpg the same tab after the fixes: the fixture's scan answer with no findings (the app's own
|
||||||
// "No rejection risks found" state; the fixture module is served with an empty findings list)
|
// "No rejection risks found" state; the fixture module is served with an empty findings list)
|
||||||
|
// ready.jpg the same tab scrolled to "Store readiness" (validate, both stores) after the fixes: the
|
||||||
|
// fixture's validate answer with no findings (the app's own "No blockers" state)
|
||||||
// render.ts runs it when out/desktop/ is missing; run it by hand after a UI change: bun media/teaser/desktop.ts
|
// render.ts runs it when out/desktop/ is missing; run it by hand after a UI change: bun media/teaser/desktop.ts
|
||||||
import { mkdirSync, writeFileSync } from 'node:fs';
|
import { mkdirSync, writeFileSync } from 'node:fs';
|
||||||
import { join } from 'node:path';
|
import { join } from 'node:path';
|
||||||
|
|
@ -46,8 +48,11 @@ export async function captureDesktop(): Promise<void> {
|
||||||
await ctx.route(/\/src\/dev\/fixtures\.ts/, async (route: any) => {
|
await ctx.route(/\/src\/dev\/fixtures\.ts/, async (route: any) => {
|
||||||
const res = await route.fetch();
|
const res = await route.fetch();
|
||||||
const src = await res.text();
|
const src = await res.text();
|
||||||
const body = src.replace(/findings:\s*SCAN_PRISM,\s*counts:\s*scanCounts\(SCAN_PRISM\)/, 'findings: [], counts: scanCounts([])');
|
const scan = src.replace(/findings:\s*SCAN_PRISM,\s*counts:\s*scanCounts\(SCAN_PRISM\)/, 'findings: [], counts: scanCounts([])');
|
||||||
if (body === src) errors.push('fixtures.ts: the Prism Puddle scan entry moved (desktop.ts clean capture)');
|
if (scan === src) errors.push('fixtures.ts: the Prism Puddle scan entry moved (desktop.ts clean capture)');
|
||||||
|
// ... and its store readiness report (validate) answers with no blockers and no findings
|
||||||
|
const body = scan.replace(/(["']p-prism["']:\s*\{\s*blockers:\s*)1(,\s*findings:\s*)\[[^\]]*\]/, '$10$2[]');
|
||||||
|
if (body === scan) errors.push('fixtures.ts: the Prism Puddle validate entry moved (desktop.ts clean capture)');
|
||||||
await route.fulfill({ response: res, body });
|
await route.fulfill({ response: res, body });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -104,12 +109,24 @@ export async function captureDesktop(): Promise<void> {
|
||||||
await open(b.page, 'app:checks');
|
await open(b.page, 'app:checks');
|
||||||
await box(b.page, 'scanClean', b.page.locator('.card').first());
|
await box(b.page, 'scanClean', b.page.locator('.card').first());
|
||||||
await shot(b.page, 'checks-clean');
|
await shot(b.page, 'checks-clean');
|
||||||
|
// the store readiness card (validate) at the top of the view: "No blockers" for both stores
|
||||||
|
// (room below the last row, so the card can scroll up to the top of the view)
|
||||||
|
await b.page.addStyleTag({ content: '#content { padding-bottom: 640px !important; }' });
|
||||||
|
const ready = b.page.locator('.card').filter({ hasText: 'Store readiness' }).first();
|
||||||
|
await ready.evaluate((el: HTMLElement) => {
|
||||||
|
el.scrollIntoView({ block: 'start' });
|
||||||
|
document.getElementById('content')?.scrollBy({ top: -120 });
|
||||||
|
});
|
||||||
|
await b.page.waitForTimeout(300);
|
||||||
|
await box(b.page, 'ready', ready);
|
||||||
|
await box(b.page, 'readyEmpty', ready.locator('.empty, [class*=empty]').first());
|
||||||
|
await shot(b.page, 'ready');
|
||||||
await b.ctx.close();
|
await b.ctx.close();
|
||||||
|
|
||||||
writeFileSync(join(OUT, 'boxes.json'), `${JSON.stringify(boxes, null, 1)}\n`);
|
writeFileSync(join(OUT, 'boxes.json'), `${JSON.stringify(boxes, null, 1)}\n`);
|
||||||
await browser.close();
|
await browser.close();
|
||||||
if (errors.length) throw new Error(`page errors:\n ${[...new Set(errors)].join('\n ')}`);
|
if (errors.length) throw new Error(`page errors:\n ${[...new Set(errors)].join('\n ')}`);
|
||||||
log(`5 frames + boxes.json -> ${OUT}`);
|
log(`6 frames + boxes.json -> ${OUT}`);
|
||||||
} finally {
|
} finally {
|
||||||
vite.kill();
|
vite.kill();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z"/></svg>
|
|
||||||
|
Before Width: | Height: | Size: 228 B |
|
|
@ -1 +0,0 @@
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z"/></svg>
|
|
||||||
|
Before Width: | Height: | Size: 339 B |
|
|
@ -6,13 +6,12 @@
|
||||||
<title>storebound teaser</title>
|
<title>storebound teaser</title>
|
||||||
<style>
|
<style>
|
||||||
:root {
|
:root {
|
||||||
--bg: #070b16; --bg-2: #0d1426; --surface: #111a2e; --surface-2: #17223a; --line: #1f2a40; --line-2: #33415a;
|
--bg: #070b16; --surface: #0f1729; --surface-2: #151f36; --line: #1f2a40; --line-2: #33415a;
|
||||||
--ink: #f4f6fb; --ink-2: #cdd5e3; --muted: #93a0b8; --dim: #64718a;
|
--ink: #f4f6fb; --ink-2: #cdd5e3; --muted: #93a0b8; --dim: #64718a;
|
||||||
--accent: #8b93ff; --accent-2: #5b5cf0; --accent-ink: #c7caff;
|
--accent: #8b93ff; --accent-2: #5b5cf0; --accent-ink: #c7caff;
|
||||||
--red: #ff5a5f; --red-2: #e5484d; --red-bg: rgba(229,72,77,.16); --orange: #ff9f43;
|
--red: #ff6b6f; --red-2: #e5484d; --red-bg: rgba(229,72,77,.14);
|
||||||
--green: #3ddc84; --green-2: #22c55e; --green-bg: rgba(34,197,94,.16);
|
--green: #3ddc84; --green-2: #22c55e; --green-bg: rgba(34,197,94,.14);
|
||||||
--cyan: #67d4ff; --yellow: #ffd166;
|
--cyan: #67d4ff; --yellow: #ffd166; --yellow-bg: rgba(255,209,102,.13);
|
||||||
/* one display font for every caption and title; the terminal and code use the system mono */
|
|
||||||
--display: "SF Pro Display", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
--display: "SF Pro Display", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
||||||
--text: "SF Pro Text", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
--text: "SF Pro Text", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
||||||
--mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
--mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
||||||
|
|
@ -22,268 +21,252 @@ html, body { margin: 0; padding: 0; background: #000; overflow: hidden; }
|
||||||
#stage { position: relative; overflow: hidden; background: var(--bg); color: var(--ink); font-family: var(--text);
|
#stage { position: relative; overflow: hidden; background: var(--bg); color: var(--ink); font-family: var(--text);
|
||||||
-webkit-font-smoothing: antialiased; }
|
-webkit-font-smoothing: antialiased; }
|
||||||
#stage > * { position: absolute; }
|
#stage > * { position: absolute; }
|
||||||
.scene { inset: 0; opacity: 0; will-change: transform, clip-path, filter; overflow: hidden; }
|
.scene { inset: 0; opacity: 0; visibility: hidden; overflow: hidden; }
|
||||||
|
.scene > .cam { position: absolute; inset: 0; transform-origin: 50% 60%; }
|
||||||
.abs { position: absolute; }
|
.abs { position: absolute; }
|
||||||
|
|
||||||
/* icons: Phosphor files in icons/ (tools/site-icons.ts), shown as masks in the element's colour */
|
/* icons: Phosphor files in icons/ (tools/site-icons.ts), shown as masks in the element's colour */
|
||||||
.pi { display: inline-block; width: 1em; height: 1em; background: currentColor; vertical-align: -0.14em;
|
.pi { display: inline-block; width: 1em; height: 1em; background: currentColor; vertical-align: -0.14em; flex: none;
|
||||||
-webkit-mask: var(--pi) center / contain no-repeat; mask: var(--pi) center / contain no-repeat; }
|
-webkit-mask: var(--pi) center / contain no-repeat; mask: var(--pi) center / contain no-repeat; }
|
||||||
.i-tray { --pi: url(icons/tray-bold.svg); } .i-search { --pi: url(icons/magnifying-glass-bold.svg); }
|
.i-tray { --pi: url(icons/tray-bold.svg); } .i-x { --pi: url(icons/x-circle-fill.svg); }
|
||||||
.i-compose { --pi: url(icons/pencil-simple-bold.svg); } .i-x { --pi: url(icons/x-circle-fill.svg); }
|
|
||||||
.i-ok { --pi: url(icons/check-circle-fill.svg); } .i-check { --pi: url(icons/check-bold.svg); }
|
.i-ok { --pi: url(icons/check-circle-fill.svg); } .i-check { --pi: url(icons/check-bold.svg); }
|
||||||
.i-stop { --pi: url(icons/warning-octagon-fill.svg); } .i-send { --pi: url(icons/paper-plane-tilt-fill.svg); }
|
.i-stop { --pi: url(icons/warning-octagon-fill.svg); } .i-send { --pi: url(icons/paper-plane-tilt-fill.svg); }
|
||||||
.i-term { --pi: url(icons/terminal-window-bold.svg); } .i-cursor { --pi: url(icons/navigation-arrow-fill.svg); }
|
.i-term { --pi: url(icons/terminal-window-bold.svg); } .i-cursor { --pi: url(icons/navigation-arrow-fill.svg); }
|
||||||
|
|
||||||
/* ---------- background (every scene after the hook) ---------- */
|
/* ---------- background: a calm, slowly drifting glow ---------- */
|
||||||
#bg { inset: 0; opacity: 0; }
|
#bg { inset: 0; }
|
||||||
#bg .glow { position: absolute; border-radius: 50%; }
|
#bg .glow { position: absolute; border-radius: 50%; }
|
||||||
#bg .g1 { width: 1100px; height: 1100px; background: radial-gradient(circle, rgba(91,92,240,.42), rgba(91,92,240,0) 62%); }
|
#bg .g1 { width: 1400px; height: 1400px; background: radial-gradient(circle, rgba(91,92,240,.30), rgba(91,92,240,0) 62%); }
|
||||||
#bg .g2 { width: 900px; height: 900px; background: radial-gradient(circle, rgba(103,212,255,.16), rgba(103,212,255,0) 62%); }
|
#bg .g2 { width: 1100px; height: 1100px; background: radial-gradient(circle, rgba(103,212,255,.11), rgba(103,212,255,0) 62%); }
|
||||||
#bg .g3 { width: 800px; height: 800px; background: radial-gradient(circle, rgba(255,90,95,.0), rgba(255,90,95,0) 62%); }
|
#bg .grid { position: absolute; inset: -96px; opacity: .45;
|
||||||
#bg .grid { position: absolute; inset: -96px; opacity: .5;
|
background-image: linear-gradient(rgba(148,163,184,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(148,163,184,.05) 1px, transparent 1px);
|
||||||
background-image: linear-gradient(rgba(148,163,184,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(148,163,184,.06) 1px, transparent 1px);
|
|
||||||
background-size: 96px 96px; }
|
background-size: 96px 96px; }
|
||||||
#vig { inset: 0; pointer-events: none; z-index: 40; background: radial-gradient(ellipse at 50% 45%, rgba(0,0,0,0) 55%, rgba(0,0,0,.55) 100%); }
|
#vig { inset: 0; pointer-events: none; z-index: 40; background: radial-gradient(ellipse at 50% 50%, rgba(0,0,0,0) 60%, rgba(0,0,0,.45) 100%); }
|
||||||
#flash { inset: 0; z-index: 60; background: #fff; opacity: 0; mix-blend-mode: soft-light; }
|
|
||||||
#black { inset: 0; z-index: 59; background: #000; opacity: 0; }
|
|
||||||
|
|
||||||
/* ---------- captions: one display font, kinetic words ---------- */
|
/* ---------- caption: top, big, clean ---------- */
|
||||||
#cap { z-index: 50; left: 10%; width: 80%; text-align: center; font-family: var(--display); font-weight: 850;
|
#capband { left: 0; right: 0; top: 0; height: 250px; z-index: 45; pointer-events: none;
|
||||||
letter-spacing: -0.035em; line-height: 1.02; color: #fff; text-shadow: 0 6px 30px rgba(0,0,0,.55); }
|
background: linear-gradient(rgba(7,11,22,.9) 0%, rgba(7,11,22,.7) 60%, rgba(7,11,22,0) 100%); }
|
||||||
|
#cap { z-index: 50; left: 100px; right: 100px; top: 58px; text-align: center; font-family: var(--display); font-weight: 750;
|
||||||
|
font-size: 72px; letter-spacing: -0.025em; line-height: 1.12; color: #fff; text-shadow: 0 4px 24px rgba(0,0,0,.5); }
|
||||||
#cap .line { display: block; white-space: nowrap; }
|
#cap .line { display: block; white-space: nowrap; }
|
||||||
#cap .w { display: inline-block; will-change: transform, opacity, filter; }
|
|
||||||
#cap .hl { color: var(--accent); } #cap.red .hl { color: var(--red); } #cap.green .hl { color: var(--green); }
|
#cap .hl { color: var(--accent); } #cap.red .hl { color: var(--red); } #cap.green .hl { color: var(--green); }
|
||||||
body.v #cap { top: 230px; font-size: 104px; }
|
|
||||||
body.h #cap { top: 64px; font-size: 92px; }
|
|
||||||
#cap.big { top: 50% !important; font-size: 210px !important; line-height: .95; text-shadow: 0 20px 80px rgba(0,0,0,.6); }
|
|
||||||
body.h #cap.big { font-size: 190px !important; }
|
|
||||||
|
|
||||||
/* ---------- hook: a generic inbox (made up; no product branding) ---------- */
|
/* ---------- shared: cards, terminal, pills ---------- */
|
||||||
#s-hook { background: #f3f4f7; color: #16181d; }
|
.card { position: absolute; background: var(--surface); border: 2px solid var(--line); border-radius: 24px; overflow: hidden;
|
||||||
#s-hook .cam { position: absolute; inset: 0; transform-origin: 50% 30%; }
|
box-shadow: 0 30px 80px rgba(0,0,0,.45); }
|
||||||
#inbox { position: absolute; background: #fff; overflow: hidden; }
|
.card .ch { display: flex; align-items: center; gap: 14px; padding: 18px 26px; border-bottom: 2px solid var(--line);
|
||||||
body.v #inbox { inset: 0; }
|
font: 700 26px/1.2 var(--mono); color: #fff; background: rgba(255,255,255,.02); }
|
||||||
body.h #inbox { left: 380px; right: 0; top: 0; bottom: 0; border-left: 1px solid #e3e5ea; }
|
.card .ch .dots { display: flex; gap: 9px; margin-right: 8px; } .card .ch .dots i { width: 14px; height: 14px; border-radius: 50%; background: #3a4255; display: block; }
|
||||||
#side { position: absolute; left: 0; top: 0; bottom: 0; width: 380px; background: #eceef2; padding: 64px 28px; display: none; }
|
.card .ch .sub { margin-left: auto; font: 600 22px/1 var(--text); color: var(--muted); }
|
||||||
body.h #side { display: block; }
|
.term { font-family: var(--mono); color: var(--ink-2); }
|
||||||
#side .f { font: 600 28px/1 var(--text); color: #3b4150; padding: 18px 20px; border-radius: 12px; display: flex; align-items: center; gap: 16px; }
|
.term .ln { display: block; white-space: pre; overflow: hidden; text-overflow: ellipsis; opacity: 0; }
|
||||||
#side .f.on { background: #dfe3ec; color: #111; }
|
.ps { color: var(--green); font-weight: 700; } .cmd { color: #fff; font-weight: 700; }
|
||||||
#side .f .n { margin-left: auto; font-size: 24px; color: #2563eb; font-weight: 700; }
|
.caret { display: inline-block; width: .55em; height: 1.05em; background: #e5e7eb; vertical-align: -0.18em; margin-left: 3px; }
|
||||||
#inbox .top { display: flex; align-items: center; gap: 22px; padding: 0 56px; border-bottom: 1px solid #e6e8ee; }
|
.tag { color: var(--dim); } .okk { color: var(--green); font-weight: 800; } .bad { color: var(--red); font-weight: 800; }
|
||||||
body.v #inbox .top { height: 300px; padding-top: 110px; }
|
.num { color: #fff; font-weight: 800; } .loc { color: var(--cyan); } .warnk { color: var(--yellow); font-weight: 800; }
|
||||||
body.h #inbox .top { height: 150px; }
|
.pill { position: absolute; display: inline-flex; align-items: center; gap: 12px; border-radius: 99px; background: rgba(13,20,38,.94);
|
||||||
#inbox .top h1 { margin: 0; font: 800 76px/1 var(--display); letter-spacing: -0.03em; display: flex; align-items: center; gap: 20px; }
|
border: 2px solid var(--line-2); box-shadow: 0 20px 50px rgba(0,0,0,.45); font: 800 40px/1 var(--display); color: #fff;
|
||||||
body.h #inbox .top h1 { font-size: 60px; }
|
padding: 18px 34px; letter-spacing: -0.015em; white-space: nowrap; opacity: 0; }
|
||||||
#inbox .top .cnt { font: 700 30px/1 var(--text); color: #fff; background: #2563eb; border-radius: 99px; padding: 8px 16px; }
|
.pill b { color: var(--accent); font-weight: 900; } .pill.green b { color: var(--green); }
|
||||||
#inbox .top .tools { margin-left: auto; display: flex; gap: 30px; font-size: 44px; color: #5b6272; }
|
|
||||||
#inbox .list { position: absolute; left: 0; right: 0; }
|
|
||||||
body.v #inbox .list { top: 300px; } body.h #inbox .list { top: 150px; }
|
|
||||||
.mrow { position: absolute; left: 0; right: 0; display: grid; grid-template-columns: 52px 1fr auto; column-gap: 8px;
|
|
||||||
padding: 28px 56px 28px 30px; border-bottom: 1px solid #eceef2; background: #fff; }
|
|
||||||
body.v .mrow { height: 236px; } body.h .mrow { height: 168px; padding-top: 22px; }
|
|
||||||
.mrow .dot { width: 20px; height: 20px; border-radius: 50%; background: #2563eb; margin: 14px 0 0 14px; }
|
|
||||||
.mrow .from { font: 800 36px/1.15 var(--text); color: #101216; }
|
|
||||||
.mrow .date { font: 500 28px/1.3 var(--text); color: #6b7280; text-align: right; }
|
|
||||||
.mrow .subj { grid-column: 2 / 4; font: 700 33px/1.3 var(--text); color: #1d5fe0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
||||||
.mrow .prev { grid-column: 2 / 4; font: 400 29px/1.35 var(--text); color: #5d6575; overflow: hidden;
|
|
||||||
display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
|
|
||||||
body.h .mrow .prev { -webkit-line-clamp: 1; }
|
|
||||||
.mrow .prev b { color: #111827; font-weight: 700; }
|
|
||||||
.mrow.old .dot { background: transparent; } .mrow.old .from { font-weight: 600; } .mrow.old .subj { color: #2a2f3a; font-weight: 500; }
|
|
||||||
.mrow .hi { position: absolute; inset: 0; background: #dbe8ff; opacity: 0; pointer-events: none; }
|
|
||||||
.mrow > *:not(.hi) { position: relative; }
|
|
||||||
#s-hook .dim { position: absolute; inset: 0; background: #05070d; opacity: 0; }
|
|
||||||
|
|
||||||
/* ---------- terminal (scan) ---------- */
|
/* ---------- 1 hook ---------- */
|
||||||
#s-scan { background: #04060c; }
|
#appcard { left: 230px; top: 330px; width: 520px; text-align: center; }
|
||||||
#s-scan .cam { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
|
#appcard img { width: 300px; height: 300px; border-radius: 66px; display: block; margin: 0 auto;
|
||||||
#s-fixed .cam { position: absolute; inset: 0; }
|
box-shadow: 0 40px 90px rgba(0,0,0,.55), 0 0 0 2px rgba(255,255,255,.08); }
|
||||||
#rescan { position: absolute; }
|
#appcard .nm { margin-top: 30px; font: 800 46px/1 var(--display); letter-spacing: -0.02em; }
|
||||||
/* the caption band stays clean: earlier terminal lines fade out under it */
|
#appcard .done { display: inline-flex; align-items: center; gap: 12px; margin-top: 22px; font: 800 30px/1 var(--display); color: #052e16;
|
||||||
#s-scan .scrim { position: absolute; left: 0; right: 0; top: 0; background: linear-gradient(#04060c 0%, #04060c 70%, rgba(4,6,12,0) 100%); }
|
background: var(--green); border-radius: 99px; padding: 12px 26px; }
|
||||||
body.v #s-scan .scrim { height: 560px; } body.h #s-scan .scrim { height: 290px; }
|
#todo { left: 870px; top: 320px; width: 820px; }
|
||||||
.term { font-family: var(--mono); color: var(--ink-2); white-space: pre-wrap; }
|
#todo .ch { font-family: var(--display); font-size: 30px; }
|
||||||
body.v .term { font-size: 31px; line-height: 1.38; width: 840px; }
|
#todo .row { display: flex; align-items: center; gap: 24px; padding: 20px 30px; border-bottom: 1px solid var(--line); font: 700 40px/1.1 var(--display);
|
||||||
body.h .term { font-size: 30px; line-height: 1.38; width: 1560px; }
|
color: var(--ink); opacity: 0; letter-spacing: -0.01em; }
|
||||||
.term .ln { display: block; opacity: 0; }
|
#todo .row:last-child { border-bottom: 0; }
|
||||||
.term .ps { color: var(--green); font-weight: 700; } .term .cmd { color: #fff; font-weight: 700; }
|
#todo .box { width: 38px; height: 38px; border-radius: 10px; border: 3px solid var(--line-2); flex: none; }
|
||||||
.term .caret { display: inline-block; width: .6em; height: 1.1em; background: #e5e7eb; vertical-align: -0.2em; margin-left: 2px; }
|
#mail { left: 230px; width: 1460px; top: 806px; height: 156px; background: #fff; color: #16181d; border-radius: 22px; opacity: 0;
|
||||||
.term .head { color: #fff; font-weight: 700; } .term .dimt { color: var(--dim); }
|
display: grid; grid-template-columns: 50px 1fr auto; column-gap: 8px; padding: 24px 40px 24px 26px; box-shadow: 0 30px 80px rgba(0,0,0,.55); }
|
||||||
.term .sec { color: var(--accent-ink); font-weight: 800; letter-spacing: .02em; }
|
#mail .dot { width: 18px; height: 18px; border-radius: 50%; background: #2563eb; margin: 12px 0 0 14px; }
|
||||||
.term .sdk b { color: #fff; } .term .loc { color: var(--cyan); } .term .risk { color: #fff; font-weight: 800; }
|
#mail .from { font: 800 32px/1.2 var(--text); color: #101216; }
|
||||||
.term .risk .r { color: var(--red); }
|
#mail .date { font: 500 26px/1.3 var(--text); color: #6b7280; text-align: right; }
|
||||||
.term .fd { display: block; position: relative; opacity: 0; padding: 14px 0 16px 0; margin: 6px 0; }
|
#mail .subj { grid-column: 2 / 4; font: 700 30px/1.35 var(--text); color: #1d5fe0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
||||||
.term .fd .glow { position: absolute; left: -24px; right: -24px; top: 0; bottom: 0; border-radius: 16px; background: var(--red-bg);
|
#mail .prev { grid-column: 2 / 4; font: 400 26px/1.35 var(--text); color: #5d6575; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
||||||
border: 2px solid rgba(255,90,95,.45); opacity: 0; }
|
#mail .prev b { color: #b91c1c; font-weight: 800; }
|
||||||
.term .fd > span:not(.glow) { position: relative; display: block; }
|
|
||||||
.term .sev { display: inline-block; font-weight: 800; color: #fff; background: var(--red-2); border-radius: 8px; padding: 0 12px; margin-right: 12px; }
|
|
||||||
.term .sev.high { background: #c2410c; }
|
|
||||||
.term .gl { color: #fff; font-weight: 800; }
|
|
||||||
.term .ttl { color: #ffd0d1; font-weight: 600; }
|
|
||||||
.term .fx { color: var(--green); } .term .fx i { font-style: normal; color: var(--dim); }
|
|
||||||
.term .sk { color: var(--accent-ink); }
|
|
||||||
|
|
||||||
/* ---------- fixed ---------- */
|
/* ---------- 2 init ---------- */
|
||||||
#s-fixed { background: transparent; }
|
#folder { left: 150px; top: 300px; width: 540px; height: 680px; }
|
||||||
.frow { position: absolute; display: grid; grid-template-columns: auto 1fr auto; align-items: center; column-gap: 26px;
|
#folder .ch { font-family: var(--display); }
|
||||||
border-radius: 22px; padding: 0 28px; background: var(--surface); border: 2px solid var(--line); overflow: hidden; }
|
#folder .empty { position: absolute; left: 0; right: 0; top: 300px; text-align: center; font: 600 30px/1 var(--text); color: var(--dim); }
|
||||||
.frow .tint { position: absolute; inset: 0; } .frow > *:not(.tint) { position: relative; }
|
#folder .files { padding: 18px 0; }
|
||||||
.frow .ic { position: relative; width: 56px; height: 56px; font-size: 56px; }
|
#folder .f { display: flex; align-items: center; gap: 16px; padding: 9px 30px; font: 600 27px/1.2 var(--mono); color: var(--ink); opacity: 0; }
|
||||||
.frow .ic .pi { position: absolute; left: 0; top: 0; }
|
#folder .f .ic { width: 26px; height: 32px; border-radius: 5px; background: var(--surface-2); border: 2px solid var(--line-2); flex: none; }
|
||||||
.frow .ic .bad { color: var(--red); } .frow .ic .good { color: var(--green); }
|
#folder .f .d { color: var(--dim); }
|
||||||
.frow .t1 { font: 800 36px/1.1 var(--display); color: #fff; letter-spacing: -0.01em; }
|
#initterm { left: 750px; top: 300px; width: 1030px; height: 680px; }
|
||||||
.frow .t2 { font: 600 24px/1.2 var(--mono); color: var(--muted); margin-top: 6px; }
|
#initterm .body { padding: 22px 30px; font-size: 27px; line-height: 1.55; }
|
||||||
.frow .chip { position: relative; font: 800 24px/1 var(--mono); padding: 10px 16px; border-radius: 10px; min-width: 150px; text-align: center; }
|
|
||||||
.frow .chip span { display: block; } .frow .chip .c2 { position: absolute; inset: 0; padding: 10px 16px; border-radius: 10px; }
|
/* ---------- 3 plan ---------- */
|
||||||
.frow .chip .c1 { color: #fff; } .frow .chip .c2 { color: #052e16; background: var(--green); }
|
#prompt { left: 210px; top: 270px; width: 1500px; padding: 24px 32px; display: flex; align-items: center; gap: 22px;
|
||||||
#counter { text-align: center; font-family: var(--display); }
|
background: var(--surface-2); border: 2px solid var(--accent-2); border-radius: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.4), 0 0 0 6px rgba(91,92,240,.12); opacity: 0; }
|
||||||
#counter .n { font-weight: 900; letter-spacing: -0.05em; line-height: .9; }
|
#prompt .who { font: 800 22px/1 var(--text); color: var(--accent-ink); text-transform: uppercase; letter-spacing: .08em; flex: none; }
|
||||||
#counter .lab { font-weight: 800; color: var(--ink-2); letter-spacing: -0.01em; }
|
#prompt .txt { font: 700 40px/1.2 var(--display); color: #fff; letter-spacing: -0.01em; }
|
||||||
#rescan { font-family: var(--mono); color: var(--ink-2); }
|
#planterm { left: 210px; top: 392px; width: 1500px; opacity: 0; }
|
||||||
|
#planterm .body { padding: 16px 30px 20px; font-size: 24px; line-height: 1.5; }
|
||||||
|
#plan-pill { left: 50%; top: 940px; }
|
||||||
|
|
||||||
|
/* ---------- 4 store ---------- */
|
||||||
|
#copy { left: 110px; top: 300px; width: 640px; }
|
||||||
|
#copy .row { display: grid; grid-template-columns: 76px 1fr; align-items: center; gap: 18px; padding: 22px 28px; border-bottom: 1px solid var(--line); opacity: 0; }
|
||||||
|
#copy .row:last-child { border-bottom: 0; }
|
||||||
|
#copy .lg { font: 800 26px/1 var(--mono); color: var(--accent-ink); background: rgba(91,92,240,.18); border-radius: 10px; padding: 10px 0; text-align: center; }
|
||||||
|
#copy .tt { font: 800 33px/1.2 var(--display); white-space: nowrap; color: #fff; letter-spacing: -0.01em; }
|
||||||
|
#copy .tt.rtl { direction: rtl; text-align: right; }
|
||||||
|
#shots { left: 800px; top: 300px; width: 1020px; height: 700px; }
|
||||||
|
#shots .lab { position: absolute; font: 700 17px/1.15 var(--text); color: var(--muted); text-align: center; white-space: pre; opacity: 0; }
|
||||||
|
#shots .lang { position: absolute; font: 800 20px/1 var(--mono); color: var(--accent-ink); opacity: 0; }
|
||||||
|
#shots .tile { position: absolute; border-radius: 8px; background-size: cover; background-position: center; opacity: 0;
|
||||||
|
box-shadow: 0 10px 26px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.08); }
|
||||||
|
#store-pill { left: 430px; top: 770px; }
|
||||||
|
#shotcmd { left: 430px; top: 880px; transform: translateX(-50%); font: 700 26px/1 var(--mono); color: var(--ink-2); opacity: 0; white-space: nowrap; }
|
||||||
|
|
||||||
|
/* ---------- 5 products ---------- */
|
||||||
|
#prodterm { left: 160px; top: 300px; width: 1600px; }
|
||||||
|
#prodterm .body { padding: 20px 32px; font-size: 26px; line-height: 1.62; }
|
||||||
|
#prod-pill { left: 50%; top: 900px; }
|
||||||
|
|
||||||
|
/* ---------- 6 forms ---------- */
|
||||||
|
#prop { left: 110px; top: 300px; width: 1010px; }
|
||||||
|
#prop .ln { display: block; font: 600 25px/1.45 var(--mono); padding: 8px 28px; opacity: 0; white-space: nowrap; position: relative; }
|
||||||
|
#prop .ln .v1 { display: block; white-space: pre; } #prop .ln .v1 .loc { float: right; }
|
||||||
|
#prop .ln .v2 { display: block; padding-left: 11ch; color: var(--muted); }
|
||||||
|
#prop .ln .k { color: var(--green); font-weight: 800; } #prop .ln .w { color: #fff; font-weight: 800; }
|
||||||
|
#prop .ln.ask { display: block; white-space: normal; margin: 10px 16px 14px; border-radius: 14px; padding: 14px 18px; }
|
||||||
|
#prop .ln.ask .k { color: var(--yellow); }
|
||||||
|
#prop .ln.ask .glow { position: absolute; inset: 0; border-radius: 14px; background: var(--yellow-bg); border: 3px solid var(--yellow); opacity: 0; }
|
||||||
|
#prop .ln.ask > span:not(.glow) { position: relative; }
|
||||||
|
#prop .askn { display: block; padding: 0 28px 22px; font: 700 26px/1.3 var(--display); color: var(--yellow); opacity: 0; }
|
||||||
|
#form { left: 1170px; top: 300px; width: 640px; }
|
||||||
|
#form .ch { font-family: var(--display); }
|
||||||
|
#form .row { display: flex; align-items: center; gap: 20px; padding: 0 28px; height: 64px; border-bottom: 1px solid var(--line); font: 700 30px/1 var(--text); color: var(--ink-2); }
|
||||||
|
#form .row:last-child { border-bottom: 0; }
|
||||||
|
#form .box { width: 38px; height: 38px; border-radius: 10px; border: 3px solid var(--line-2); position: relative; flex: none; }
|
||||||
|
#form .box .pi { position: absolute; left: 4px; top: 4px; width: 24px; height: 24px; color: #04150b; }
|
||||||
|
#form .box .fill { position: absolute; inset: -3px; border-radius: 10px; background: var(--green); opacity: 0; }
|
||||||
|
#form .row .tg { margin-left: auto; font: 700 21px/1 var(--mono); color: var(--green); opacity: 0; }
|
||||||
|
#forms-pill { left: 1490px; top: 900px; }
|
||||||
|
|
||||||
|
/* ---------- 7 rejections ---------- */
|
||||||
|
#scanterm { left: 160px; top: 290px; width: 1600px; }
|
||||||
|
#scanterm .body { padding: 18px 30px 24px; font-size: 26px; line-height: 1.45; }
|
||||||
|
.fd { position: relative; margin: 10px 0; padding: 14px 22px 16px; border-radius: 16px; opacity: 0; }
|
||||||
|
.fd .tint { position: absolute; inset: 0; border-radius: 16px; }
|
||||||
|
.fd .tint.b { background: var(--red-bg); border: 2px solid rgba(255,90,95,.4); }
|
||||||
|
.fd .tint.g { background: var(--green-bg); border: 2px solid rgba(61,220,132,.55); opacity: 0; }
|
||||||
|
.fd > *:not(.tint) { position: relative; }
|
||||||
|
.fd .l1 { display: flex; align-items: center; gap: 14px; white-space: nowrap; overflow: hidden; }
|
||||||
|
.fd .sev { display: inline-block; font-weight: 800; color: #fff; background: var(--red-2); border-radius: 8px; padding: 1px 12px; }
|
||||||
|
.fd .sev.high { background: #c2410c; }
|
||||||
|
.fd .gl { color: #fff; font-weight: 800; } .fd .ttl { color: #ffd6d7; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
|
||||||
|
.fd .why { display: flex; align-items: center; gap: 12px; margin-top: 8px; font: 700 31px/1.2 var(--display); color: #fff; letter-spacing: -0.005em; }
|
||||||
|
.fd .why .pi { color: var(--red); font-size: 30px; }
|
||||||
|
.fd .why .at { margin-left: auto; font: 600 24px/1 var(--mono); }
|
||||||
|
.fd .why .fixed { margin-left: 18px; }
|
||||||
|
.fd .fixed { font: 800 22px/1 var(--mono); color: #052e16; background: var(--green); border-radius: 8px; padding: 6px 12px; opacity: 0; }
|
||||||
#rescan .ln { display: block; opacity: 0; }
|
#rescan .ln { display: block; opacity: 0; }
|
||||||
|
|
||||||
/* ---------- shots ---------- */
|
/* ---------- 8 desktop window ---------- */
|
||||||
#wall { position: absolute; left: 50%; top: 50%; transform-style: preserve-3d; }
|
.win { position: absolute; border-radius: 20px; overflow: hidden; background: #0b0f19; border: 1.5px solid rgba(255,255,255,.12);
|
||||||
#wall .tile { position: absolute; border-radius: 14px; background-size: cover; background-position: center;
|
|
||||||
box-shadow: 0 18px 40px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.08); opacity: 0; }
|
|
||||||
#s-shots .scrim, #s-decl .scrim { position: absolute; left: 0; right: 0; top: 0; background: linear-gradient(#070b16 0%, rgba(7,11,22,.92) 55%, rgba(7,11,22,0) 100%); }
|
|
||||||
body.v #s-shots .scrim { height: 640px; } body.h #s-shots .scrim { height: 380px; }
|
|
||||||
.pill { display: inline-flex; align-items: center; gap: 14px; border-radius: 99px; background: rgba(13,20,38,.92);
|
|
||||||
border: 2px solid var(--line-2); box-shadow: 0 20px 50px rgba(0,0,0,.5); }
|
|
||||||
#shotcount { font-family: var(--display); font-weight: 900; color: #fff; padding: 18px 40px 18px 30px; letter-spacing: -0.02em; }
|
|
||||||
#shotcount .num { color: var(--accent); min-width: 2.3em; text-align: right; font-variant-numeric: tabular-nums; }
|
|
||||||
#shotcmd { font: 700 30px/1 var(--mono); color: #fff; padding: 18px 30px; }
|
|
||||||
#shotcmd .ps { color: var(--green); }
|
|
||||||
|
|
||||||
/* ---------- declarations ---------- */
|
|
||||||
.card { position: absolute; background: var(--surface); border: 2px solid var(--line); border-radius: 26px; overflow: hidden;
|
|
||||||
box-shadow: 0 30px 80px rgba(0,0,0,.5); }
|
|
||||||
.card .ch { display: flex; align-items: center; gap: 16px; padding: 22px 30px; border-bottom: 2px solid var(--line);
|
|
||||||
font: 800 30px/1 var(--display); color: #fff; }
|
|
||||||
.card .ch .sub { margin-left: auto; font: 600 24px/1 var(--mono); color: var(--muted); }
|
|
||||||
#prop .ln { display: block; font: 600 25px/1.45 var(--mono); padding: 6px 30px; opacity: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
||||||
#prop .ln .k { color: var(--green); font-weight: 800; } #prop .ln .w { color: #fff; font-weight: 800; } #prop .ln .loc { color: var(--cyan); }
|
|
||||||
#prop .ln.ask .k { color: var(--yellow); }
|
|
||||||
#form .row { display: flex; align-items: center; gap: 20px; padding: 0 30px; border-bottom: 1px solid var(--line); font: 700 30px/1 var(--text); color: var(--ink-2); }
|
|
||||||
#form .box { width: 40px; height: 40px; border-radius: 10px; border: 3px solid var(--line-2); position: relative; flex: none; }
|
|
||||||
#form .box .pi { position: absolute; left: 4px; top: 4px; width: 26px; height: 26px; color: #04150b; }
|
|
||||||
#form .box .fill { position: absolute; inset: -3px; border-radius: 10px; background: var(--green); opacity: 0; }
|
|
||||||
#form .row .tag { margin-left: auto; font: 700 22px/1 var(--mono); color: var(--green); opacity: 0; }
|
|
||||||
#declcount { font-family: var(--display); font-weight: 900; color: #fff; padding: 18px 40px 18px 30px; }
|
|
||||||
#declcount .num { color: var(--green); font-variant-numeric: tabular-nums; }
|
|
||||||
|
|
||||||
/* ---------- desktop window ---------- */
|
|
||||||
.win { position: absolute; border-radius: 22px; overflow: hidden; background: #0b0f19; border: 1.5px solid rgba(255,255,255,.12);
|
|
||||||
box-shadow: 0 50px 120px rgba(0,0,0,.65), 0 0 0 1px rgba(0,0,0,.6); }
|
box-shadow: 0 50px 120px rgba(0,0,0,.65), 0 0 0 1px rgba(0,0,0,.6); }
|
||||||
.win .bar { position: absolute; left: 0; right: 0; top: 0; height: 44px; background: #161b27; border-bottom: 1px solid #222a3a;
|
.win .bar { position: absolute; left: 0; right: 0; top: 0; height: 40px; background: #161b27; border-bottom: 1px solid #222a3a;
|
||||||
display: flex; align-items: center; gap: 10px; padding: 0 18px; z-index: 2; }
|
display: flex; align-items: center; gap: 10px; padding: 0 16px; z-index: 2; }
|
||||||
.win .bar i { width: 14px; height: 14px; border-radius: 50%; background: #3a4255; display: block; }
|
.win .bar i { width: 13px; height: 13px; border-radius: 50%; background: #3a4255; display: block; }
|
||||||
.win .bar .tt { position: absolute; left: 0; right: 0; text-align: center; font: 600 18px/1 var(--text); color: #8a93a6; }
|
.win .bar .tt { position: absolute; left: 0; right: 0; text-align: center; font: 600 17px/1 var(--text); color: #8a93a6; }
|
||||||
.win .view { position: absolute; left: 0; right: 0; top: 44px; bottom: 0; overflow: hidden; }
|
.win .view { position: absolute; left: 0; right: 0; top: 40px; bottom: 0; overflow: hidden; }
|
||||||
.win .view img { position: absolute; left: 0; top: 0; transform-origin: 0 0; display: block; width: 1280px; height: 800px; }
|
.win .view .cam2 { position: absolute; left: 0; top: 0; width: 1280px; height: 800px; transform-origin: 0 0; }
|
||||||
.win .view .clip { position: absolute; inset: 0; }
|
.win .view img { position: absolute; left: 0; top: 0; display: block; width: 1280px; height: 800px; }
|
||||||
.win .scanline { position: absolute; left: 0; height: 6px; background: linear-gradient(90deg, rgba(61,220,132,0), var(--green), rgba(61,220,132,0));
|
.callout { position: absolute; z-index: 5; font: 800 32px/1 var(--display); color: #fff; background: var(--accent-2);
|
||||||
box-shadow: 0 0 30px 8px rgba(61,220,132,.45); opacity: 0; }
|
padding: 16px 26px; border-radius: 16px; white-space: nowrap; box-shadow: 0 20px 50px rgba(0,0,0,.55), 0 0 0 3px rgba(255,255,255,.12);
|
||||||
.callout { position: absolute; z-index: 5; font: 800 34px/1 var(--display); color: #fff; background: var(--accent-2);
|
|
||||||
padding: 18px 28px; border-radius: 18px; white-space: nowrap; box-shadow: 0 20px 50px rgba(0,0,0,.55), 0 0 0 3px rgba(255,255,255,.12);
|
|
||||||
transform-origin: 50% 100%; opacity: 0; }
|
transform-origin: 50% 100%; opacity: 0; }
|
||||||
.callout.green { background: #15803d; }
|
.callout.green { background: #15803d; }
|
||||||
.ring { position: absolute; z-index: 4; border: 4px solid var(--accent); border-radius: 14px; opacity: 0;
|
.ring { position: absolute; z-index: 4; border: 4px solid var(--accent); border-radius: 14px; opacity: 0;
|
||||||
box-shadow: 0 0 0 6px rgba(139,147,255,.25), 0 0 40px rgba(139,147,255,.5); }
|
box-shadow: 0 0 0 6px rgba(139,147,255,.22), 0 0 40px rgba(139,147,255,.45); }
|
||||||
.ring.green { border-color: var(--green); box-shadow: 0 0 0 6px rgba(61,220,132,.25), 0 0 40px rgba(61,220,132,.5); }
|
.ring.green { border-color: var(--green); box-shadow: 0 0 0 6px rgba(61,220,132,.22), 0 0 40px rgba(61,220,132,.45); }
|
||||||
|
|
||||||
/* ---------- cursor (Phosphor navigation-arrow, fill) ---------- */
|
/* ---------- cursor (Phosphor navigation-arrow, fill) ---------- */
|
||||||
#cursor { z-index: 55; width: 64px; height: 64px; left: 0; top: 0; opacity: 0;
|
#cursor { z-index: 55; width: 60px; height: 60px; left: 0; top: 0; opacity: 0;
|
||||||
filter: drop-shadow(0 0 1.5px #000) drop-shadow(0 0 1.5px #000) drop-shadow(0 8px 12px rgba(0,0,0,.55)); }
|
filter: drop-shadow(0 0 1.5px #000) drop-shadow(0 0 1.5px #000) drop-shadow(0 8px 12px rgba(0,0,0,.55)); }
|
||||||
#cursor .pi { position: absolute; inset: 0; width: 100%; height: 100%; color: #fff; }
|
#cursor .pi { position: absolute; inset: 0; width: 100%; height: 100%; color: #fff; }
|
||||||
#click { z-index: 54; width: 90px; height: 90px; margin: -45px 0 0 -45px; border-radius: 50%; border: 4px solid #fff; opacity: 0; left: 0; top: 0; }
|
|
||||||
|
|
||||||
/* ---------- submit + brand ---------- */
|
/* ---------- 9 submit + brand ---------- */
|
||||||
#sbtn { position: absolute; left: 50%; display: flex; align-items: center; gap: 22px; font: 800 58px/1 var(--display);
|
#sbtn { position: absolute; left: 50%; top: 520px; display: flex; align-items: center; gap: 22px; font: 800 60px/1 var(--display);
|
||||||
color: #fff; background: linear-gradient(#3b82f6, #2563eb); border-radius: 28px; padding: 40px 64px; letter-spacing: -0.01em;
|
color: #fff; background: linear-gradient(#3b82f6, #2563eb); border-radius: 28px; padding: 42px 68px; letter-spacing: -0.01em;
|
||||||
box-shadow: 0 30px 80px rgba(37,99,235,.45), inset 0 2px 0 rgba(255,255,255,.25); white-space: nowrap; }
|
box-shadow: 0 30px 80px rgba(37,99,235,.45), inset 0 2px 0 rgba(255,255,255,.25); white-space: nowrap; }
|
||||||
#sbtn .pi { font-size: 56px; }
|
#sbtn .pi { font-size: 56px; }
|
||||||
#sbtn .hov { position: absolute; inset: 0; border-radius: 28px; background: rgba(255,255,255,.14); opacity: 0; }
|
#sbtn .hov { position: absolute; inset: 0; border-radius: 28px; background: rgba(255,255,255,.12); opacity: 0; }
|
||||||
#s-brand { text-align: center; }
|
#brand { left: 0; right: 0; top: 330px; text-align: center; }
|
||||||
#s-brand .wrap { position: absolute; left: 0; right: 0; top: 50%; }
|
#brand > * { opacity: 0; }
|
||||||
#s-brand .mark { width: 240px; height: 240px; display: block; margin: 0 auto; filter: drop-shadow(0 30px 70px rgba(91,92,240,.7)); }
|
#brand .mark { width: 190px; height: 190px; display: block; margin: 0 auto; filter: drop-shadow(0 30px 70px rgba(91,92,240,.6)); }
|
||||||
#s-brand .word { margin-top: 36px; font: 900 150px/1 var(--display); letter-spacing: -0.05em; color: #fff; }
|
#brand .word { margin-top: 30px; font: 900 118px/1 var(--display); letter-spacing: -0.05em; color: #fff; }
|
||||||
#s-brand .url { margin-top: 30px; font: 800 64px/1 var(--display); color: var(--accent); letter-spacing: -0.02em; }
|
#brand .url { margin-top: 26px; font: 800 56px/1 var(--display); color: var(--accent); letter-spacing: -0.02em; }
|
||||||
#s-brand .plat { margin-top: 34px; font: 600 36px/1.3 var(--text); color: var(--ink-2); }
|
#brand .plat { margin-top: 26px; font: 600 34px/1.3 var(--text); color: var(--ink-2); }
|
||||||
#s-brand > .wrap > * { opacity: 0; }
|
|
||||||
|
|
||||||
/* ---------- more: real CLI output, three panels ---------- */
|
|
||||||
#s-more .panel { position: absolute; inset: 0; visibility: hidden; }
|
|
||||||
#s-more .card .ch { font: 700 28px/1.2 var(--mono); }
|
|
||||||
#s-more .card .ch .ps { color: var(--green); }
|
|
||||||
#s-more .card .ch .sub { font: 600 22px/1 var(--text); }
|
|
||||||
#s-more .body { padding: 14px 0; }
|
|
||||||
#s-more .ln { display: block; font: 600 25px/1.6 var(--mono); padding: 2px 30px; color: var(--ink-2); white-space: pre; overflow: hidden; text-overflow: ellipsis; }
|
|
||||||
#s-more .ln .n { color: #fff; font-weight: 800; } #s-more .ln .ok { color: var(--green); font-weight: 800; } #s-more .ln .ask { color: var(--yellow); font-weight: 800; }
|
|
||||||
#s-more .ln .dimt { color: var(--dim); }
|
|
||||||
body.v #s-more .ln { font-size: 21px; padding: 2px 24px; } body.v #s-more .card .ch { font-size: 23px; padding: 20px 24px; }
|
|
||||||
#s-more .stat { font-family: var(--display); font-weight: 900; color: #fff; padding: 18px 36px; letter-spacing: -0.02em; white-space: nowrap; }
|
|
||||||
#s-more .stat b { color: var(--accent); }
|
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="stage">
|
<div id="stage">
|
||||||
<div id="bg"><div class="grid"></div><div class="glow g1"></div><div class="glow g2"></div><div class="glow g3"></div></div>
|
<div id="bg"><div class="grid"></div><div class="glow g1"></div><div class="glow g2"></div></div>
|
||||||
|
|
||||||
<div class="scene" id="s-hook"><div class="cam">
|
<div class="scene" id="s-hook"><div class="cam">
|
||||||
<div id="side">
|
<div id="appcard" class="abs"><img id="appicon" src="examples/demo-game/store/icon/icon.png" alt=""><div class="nm"></div><span class="done"><span class="pi i-check"></span>Done</span></div>
|
||||||
<div class="f on"><span class="pi i-tray"></span>Inbox<span class="n">3</span></div>
|
<div class="card" id="todo"><div class="ch">Still to do on the stores</div><div class="rows"></div></div>
|
||||||
<div class="f">Flagged</div><div class="f">Sent</div><div class="f">Drafts</div><div class="f">Archive</div>
|
<div id="mail" class="abs"><span class="dot"></span><span class="from"></span><span class="date"></span><span class="subj"></span><span class="prev"></span></div>
|
||||||
</div>
|
|
||||||
<div id="inbox">
|
|
||||||
<div class="top"><h1><span class="pi i-tray"></span>Inbox</h1><span class="cnt">0 new</span>
|
|
||||||
<span class="tools"><span class="pi i-search"></span><span class="pi i-compose"></span></span></div>
|
|
||||||
<div class="list"></div>
|
|
||||||
</div>
|
|
||||||
</div><div class="dim"></div></div>
|
|
||||||
|
|
||||||
<div class="scene" id="s-scan"><div class="cam"><div class="term" id="term"></div></div><div class="scrim"></div></div>
|
|
||||||
|
|
||||||
<div class="scene" id="s-fixed"><div class="cam">
|
|
||||||
<div class="term" id="rescan"></div>
|
|
||||||
<div id="frows"></div>
|
|
||||||
<div id="counter" class="abs"><div class="n">5</div><div class="lab">rejection risks</div></div>
|
|
||||||
</div></div>
|
</div></div>
|
||||||
|
|
||||||
<div class="scene" id="s-shots"><div id="wall"></div><div class="scrim"></div>
|
<div class="scene" id="s-init"><div class="cam">
|
||||||
<div class="pill abs" id="shotcount"><span class="num">0</span> store screenshots</div>
|
<div class="card" id="folder"><div class="ch"><span class="dots"><i></i><i></i><i></i></span><span class="fname"></span></div><div class="empty">empty folder</div><div class="files"></div></div>
|
||||||
<div class="pill abs" id="shotcmd"><span class="ps">$</span> storebound shots render</div>
|
<div class="card term" id="initterm"><div class="ch"><span class="dots"><i></i><i></i><i></i></span>Terminal</div><div class="body"></div></div>
|
||||||
</div>
|
</div></div>
|
||||||
|
|
||||||
<div class="scene" id="s-decl">
|
<div class="scene" id="s-plan"><div class="cam">
|
||||||
<div class="card" id="prop"><div class="ch"><span class="pi i-term"></span>storebound scan<span class="sub">declarations proposal</span></div><div class="body"></div></div>
|
<div id="prompt" class="abs"><span class="who">You, to your agent</span><span class="txt"></span></div>
|
||||||
|
<div class="card term" id="planterm"><div class="ch"><span class="dots"><i></i><i></i><i></i></span>Terminal<span class="sub">read-only</span></div><div class="body"></div></div>
|
||||||
|
<div class="pill" id="plan-pill"></div>
|
||||||
|
</div></div>
|
||||||
|
|
||||||
|
<div class="scene" id="s-store"><div class="cam">
|
||||||
|
<div class="card" id="copy"><div class="ch"><span class="dots"><i></i><i></i><i></i></span><span class="fname"></span></div><div class="rows"></div></div>
|
||||||
|
<div id="shots" class="abs"></div>
|
||||||
|
<div class="pill" id="store-pill"></div>
|
||||||
|
<div id="shotcmd" class="abs"><span class="ps">$</span> <span class="cmd"></span></div>
|
||||||
|
</div></div>
|
||||||
|
|
||||||
|
<div class="scene" id="s-products"><div class="cam">
|
||||||
|
<div class="card term" id="prodterm"><div class="ch"><span class="dots"><i></i><i></i><i></i></span>Terminal<span class="sub">App Store Connect · Google Play</span></div><div class="body"></div></div>
|
||||||
|
<div class="pill green" id="prod-pill"></div>
|
||||||
|
</div></div>
|
||||||
|
|
||||||
|
<div class="scene" id="s-forms"><div class="cam">
|
||||||
|
<div class="card" id="prop"><div class="ch"><span class="dots"><i></i><i></i><i></i></span>storebound scan<span class="sub">declarations proposal</span></div><div class="body"></div></div>
|
||||||
<div class="card" id="form"><div class="ch">Data safety<span class="sub">Google Play</span></div><div class="body"></div></div>
|
<div class="card" id="form"><div class="ch">Data safety<span class="sub">Google Play</span></div><div class="body"></div></div>
|
||||||
<div class="pill abs" id="declcount"><span class="num">0</span> answers</div>
|
<div class="pill green" id="forms-pill"></div>
|
||||||
</div>
|
</div></div>
|
||||||
|
|
||||||
<div class="scene" id="s-desk1"></div>
|
<div class="scene" id="s-rejections"><div class="cam">
|
||||||
<div class="scene" id="s-desk2"></div>
|
<div class="card term" id="scanterm"><div class="ch"><span class="dots"><i></i><i></i><i></i></span>Terminal</div><div class="body"></div></div>
|
||||||
<div class="scene" id="s-desk3"></div>
|
</div></div>
|
||||||
|
|
||||||
<div class="scene" id="s-more"></div>
|
<div class="scene" id="s-desktop"><div class="cam"></div></div>
|
||||||
|
|
||||||
<div class="scene" id="s-submit">
|
<div class="scene" id="s-submit"><div class="cam">
|
||||||
<div id="sbtn"><span class="pi i-send"></span>Submit for Review<span class="hov"></span></div>
|
<div id="sbtn"><span class="pi i-send"></span>Submit for Review<span class="hov"></span></div>
|
||||||
</div>
|
<div id="brand" class="abs">
|
||||||
|
|
||||||
<div class="scene" id="s-brand"><div class="wrap">
|
|
||||||
<img class="mark" src="brand/logo-mark-256.png" alt="">
|
<img class="mark" src="brand/logo-mark-256.png" alt="">
|
||||||
<div class="word">storebound</div>
|
<div class="word">storebound</div>
|
||||||
<div class="url">storebound.dev</div>
|
<div class="url"></div>
|
||||||
<div class="plat">Open source · macOS · Windows · Linux</div>
|
<div class="plat"></div>
|
||||||
|
</div>
|
||||||
</div></div>
|
</div></div>
|
||||||
|
|
||||||
|
<div id="capband"></div>
|
||||||
<div id="cap"></div>
|
<div id="cap"></div>
|
||||||
<span id="click"></span>
|
|
||||||
<span id="cursor" aria-hidden="true"><span class="pi i-cursor"></span></span>
|
<span id="cursor" aria-hidden="true"><span class="pi i-cursor"></span></span>
|
||||||
<div id="vig"></div>
|
<div id="vig"></div>
|
||||||
<div id="black"></div>
|
|
||||||
<div id="flash"></div>
|
|
||||||
</div>
|
</div>
|
||||||
<script type="module" src="teaser.js"></script>
|
<script type="module" src="teaser.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
// Original teaser music and sound design, synthesized from nothing with the Web Audio API (OfflineAudioContext): no
|
// Original teaser music and sound design (v4, calm), synthesized from nothing with the Web Audio API
|
||||||
// samples, no downloaded audio. 128 BPM, F minor: a tense intro under the inbox, a hard cut to near silence for the
|
// (OfflineAudioContext): no samples, no downloaded audio. D major, one chord per scene: warm pads that cross-fade on the
|
||||||
// typed command, the groove from the Enter key on, a calm bar under the Submit button, the hit on the logo. On top:
|
// scene changes, a slow, soft plucked arpeggio, a quiet sub, and only soft accents on the scene changes (a bell and a
|
||||||
// mail blips, key clicks, a whoosh into every whip / mask / zoom and a hit on every cut (script.js CUTS), ticks on
|
// short airy swell into each one). On top, quiet UI sounds from script.js: key clicks for typed text, ticks for lines
|
||||||
// every finding, rising chimes on every fix, ticks for the screenshot wall and the Data safety rows. Deterministic.
|
// and rows, a low tone per finding, rising chimes for the fixes, a warm swell under the end card. Deterministic.
|
||||||
// renderWav() returns a 32-bit float stereo WAV (48 kHz) as base64; render.ts masters it with ffmpeg loudnorm.
|
// renderWav() returns a 32-bit float stereo WAV (48 kHz) as base64; render.ts masters it with ffmpeg loudnorm.
|
||||||
import { B, BAR, BEAT, CUTS, DESKTOP, DURATION, ENTER_AT, keyTimes, scene, TICKS } from './script.js';
|
import { CUTS, DURATION, keyTimes, SCENES, scene, SUBMIT, ticks } from './script.js';
|
||||||
|
|
||||||
const SR = 48000;
|
const SR = 48000;
|
||||||
const midi = m => 440 * Math.pow(2, (m - 69) / 12);
|
const midi = m => 440 * Math.pow(2, (m - 69) / 12);
|
||||||
|
|
@ -13,270 +13,138 @@ function rng(seed) { // mulberry32
|
||||||
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; };
|
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; };
|
||||||
}
|
}
|
||||||
|
|
||||||
// chords per bar (root midi in octave 3, intervals)
|
// chords (root midi in octave 3, intervals): one per scene, in scene order
|
||||||
const CH = { Fm: [53, [0, 3, 7]], Db: [49, [0, 4, 7]], Ab: [56, [0, 4, 7]], Eb: [51, [0, 4, 7]] };
|
const CH = {
|
||||||
// 20 bars (the video ends half way into the last): hook (0-1) · command + scan (1-5) · fixed, shots, decl (6-10) ·
|
Bm: [47, [0, 3, 7, 14]], G: [43, [0, 4, 7, 14]], D: [50, [0, 4, 7, 11]], A: [45, [0, 4, 7, 14]], Em: [52, [0, 3, 7, 10]], Dadd9: [50, [0, 4, 7, 14]],
|
||||||
// desktop (10-14) · the CLI montage (15-16) · submit (16-17) · brand (18-19)
|
};
|
||||||
const BARS = ['Fm', 'Db', 'Fm', 'Db', 'Ab', 'Eb', 'Fm', 'Db', 'Ab', 'Eb', 'Fm', 'Db', 'Ab', 'Eb', 'Fm', 'Ab', 'Db', 'Eb', 'Fm', 'Fm'];
|
const SCENE_CHORD = { hook: 'Bm', init: 'G', plan: 'D', store: 'A', products: 'Bm', forms: 'G', rejections: 'Em', desktop: 'A', submit: 'D' };
|
||||||
const ARP = [0, 2, 4, 3, 5, 4, 2, 3, 0, 2, 4, 6, 5, 4, 3, 2];
|
const ARP = [0, 1, 2, 3, 2, 1, 2, 3];
|
||||||
|
const STEP = 0.5; // one soft note every half second
|
||||||
|
|
||||||
export async function renderMusic() {
|
export async function renderMusic() {
|
||||||
const ctx = new OfflineAudioContext({ numberOfChannels: 2, length: Math.ceil(DURATION * SR) + SR, sampleRate: SR });
|
const ctx = new OfflineAudioContext({ numberOfChannels: 2, length: Math.ceil(DURATION * SR) + SR * 2, sampleRate: SR });
|
||||||
const R = rng(20261010);
|
const R = rng(20261012);
|
||||||
|
|
||||||
// shared noise
|
|
||||||
const noise = ctx.createBuffer(2, SR * 3, SR);
|
const noise = ctx.createBuffer(2, SR * 3, SR);
|
||||||
for (let c = 0; c < 2; c++) { const d = noise.getChannelData(c); for (let i = 0; i < d.length; i++) d[i] = R() * 2 - 1; }
|
for (let c = 0; c < 2; c++) { const d = noise.getChannelData(c); for (let i = 0; i < d.length; i++) d[i] = R() * 2 - 1; }
|
||||||
|
const ir = ctx.createBuffer(2, Math.floor(SR * 3.2), SR);
|
||||||
|
for (let c = 0; c < 2; c++) { const d = ir.getChannelData(c); for (let i = 0; i < d.length; i++) d[i] = (R() * 2 - 1) * Math.pow(1 - i / d.length, 3.6); }
|
||||||
|
|
||||||
// reverb impulse
|
// buses: a gentle compressor, a long room
|
||||||
const ir = ctx.createBuffer(2, Math.floor(SR * 2.6), SR);
|
|
||||||
for (let c = 0; c < 2; c++) { const d = ir.getChannelData(c); for (let i = 0; i < d.length; i++) d[i] = (R() * 2 - 1) * Math.pow(1 - i / d.length, 3.2); }
|
|
||||||
|
|
||||||
// buses
|
|
||||||
const comp = ctx.createDynamicsCompressor();
|
const comp = ctx.createDynamicsCompressor();
|
||||||
comp.threshold.value = -14; comp.knee.value = 6; comp.ratio.value = 3.5; comp.attack.value = 0.004; comp.release.value = 0.16;
|
comp.threshold.value = -18; comp.knee.value = 10; comp.ratio.value = 2.5; comp.attack.value = 0.02; comp.release.value = 0.4;
|
||||||
const master = ctx.createGain(); master.gain.value = 0.7;
|
const master = ctx.createGain(); master.gain.value = 0.7;
|
||||||
master.connect(comp); comp.connect(ctx.destination);
|
master.connect(comp); comp.connect(ctx.destination);
|
||||||
const verb = ctx.createConvolver(); verb.buffer = ir;
|
const verb = ctx.createConvolver(); verb.buffer = ir;
|
||||||
const verbIn = ctx.createGain(); verbIn.gain.value = 0.5; verbIn.connect(verb); verb.connect(master);
|
const verbIn = ctx.createGain(); verbIn.gain.value = 0.55; verbIn.connect(verb); verb.connect(master);
|
||||||
const duck = ctx.createGain(); duck.connect(master); // sidechained group: pad, bass, arp
|
const sfx = ctx.createGain(); sfx.gain.value = 0.7; sfx.connect(master);
|
||||||
const drums = ctx.createGain(); drums.gain.value = 0.9; drums.connect(master);
|
const sfxVerb = ctx.createGain(); sfxVerb.gain.value = 0.3; sfxVerb.connect(verbIn);
|
||||||
|
|
||||||
const arpBus = ctx.createGain(); arpBus.gain.value = 0.55;
|
const env = (g, t, a, peak, d, end = 0.0003) => {
|
||||||
const arpLP = ctx.createBiquadFilter(); arpLP.type = 'lowpass'; arpLP.Q.value = 6;
|
|
||||||
arpBus.connect(arpLP); arpLP.connect(duck);
|
|
||||||
// stereo echo on the arp
|
|
||||||
for (const [time, pan] of [[BEAT * 0.75, -0.6], [BEAT * 1.5, 0.6]]) {
|
|
||||||
const dl = ctx.createDelay(2); dl.delayTime.value = time;
|
|
||||||
const fb = ctx.createGain(); fb.gain.value = 0.28;
|
|
||||||
const lp = ctx.createBiquadFilter(); lp.type = 'lowpass'; lp.frequency.value = 2600;
|
|
||||||
const p = ctx.createStereoPanner(); p.pan.value = pan;
|
|
||||||
const wet = ctx.createGain(); wet.gain.value = 0.32;
|
|
||||||
arpLP.connect(dl); dl.connect(lp); lp.connect(fb); fb.connect(dl); lp.connect(wet); wet.connect(p); p.connect(duck);
|
|
||||||
}
|
|
||||||
const arpVerb = ctx.createGain(); arpVerb.gain.value = 0.18; arpLP.connect(arpVerb); arpVerb.connect(verbIn);
|
|
||||||
|
|
||||||
// arp filter: closed under the inbox, open from the Enter key, wide into the Submit card, dark under it, bright on the logo
|
|
||||||
const f = arpLP.frequency;
|
|
||||||
const sub = scene('submit').start, brand = scene('brand').start;
|
|
||||||
f.setValueAtTime(380, 0);
|
|
||||||
f.exponentialRampToValueAtTime(900, B(7) - 0.01);
|
|
||||||
f.setValueAtTime(2600, ENTER_AT);
|
|
||||||
f.linearRampToValueAtTime(3400, sub - BAR);
|
|
||||||
f.exponentialRampToValueAtTime(7000, sub - 0.01);
|
|
||||||
f.setValueAtTime(900, sub);
|
|
||||||
f.exponentialRampToValueAtTime(1800, brand - 0.01);
|
|
||||||
f.setValueAtTime(4200, brand);
|
|
||||||
f.exponentialRampToValueAtTime(900, DURATION);
|
|
||||||
|
|
||||||
const env = (g, t, a, peak, d, end = 0.0005) => {
|
|
||||||
g.gain.setValueAtTime(0, t); g.gain.linearRampToValueAtTime(peak, t + a); g.gain.exponentialRampToValueAtTime(end, t + a + d);
|
g.gain.setValueAtTime(0, t); g.gain.linearRampToValueAtTime(peak, t + a); g.gain.exponentialRampToValueAtTime(end, t + a + d);
|
||||||
};
|
};
|
||||||
const noiseSrc = (t, dur, off = R() * 1.5) => { const s = ctx.createBufferSource(); s.buffer = noise; s.start(t, off, dur); return s; };
|
const noiseSrc = (t, dur, off = R() * 1.5) => { const s = ctx.createBufferSource(); s.buffer = noise; s.start(t, off, dur); return s; };
|
||||||
|
|
||||||
// sound effects bus (balanced under the music, before the master compressor)
|
/** A warm pad: detuned saws through a soft low-pass, slow attack and release (cross-fades with the next one). */
|
||||||
const sfx = ctx.createGain(); sfx.gain.value = 0.85; sfx.connect(master);
|
function pad(t0, t1, notes, g = 0.035, cutoff = 1100) {
|
||||||
const sfxVerb = ctx.createGain(); sfxVerb.gain.value = 0.35; sfxVerb.connect(verbIn);
|
const lp = ctx.createBiquadFilter(); lp.type = 'lowpass'; lp.frequency.value = cutoff; lp.Q.value = 0.5;
|
||||||
function blip(t, m, g, len = 0.18, type = 'sine', pan = 0) {
|
const v = ctx.createGain();
|
||||||
|
v.gain.setValueAtTime(0, t0); v.gain.linearRampToValueAtTime(g, t0 + 1.2); v.gain.setValueAtTime(g, t1 - 0.2); v.gain.linearRampToValueAtTime(0, t1 + 1.0);
|
||||||
|
lp.connect(v); v.connect(master);
|
||||||
|
const s = ctx.createGain(); s.gain.value = 0.7; v.connect(s); s.connect(verbIn);
|
||||||
|
for (const m of notes) for (const det of [-7, 7]) {
|
||||||
|
const o = ctx.createOscillator(); o.type = 'sawtooth'; o.frequency.value = midi(m); o.detune.value = det;
|
||||||
|
const p = ctx.createStereoPanner(); p.pan.value = det < 0 ? -0.35 : 0.35;
|
||||||
|
o.connect(p); p.connect(lp); o.start(t0); o.stop(t1 + 1.1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/** A soft pluck (sine + a little triangle), the arpeggio voice. */
|
||||||
|
function pluck(t, m, g = 0.05, pan = 0) {
|
||||||
|
const v = ctx.createGain(); env(v, t, 0.006, g, 1.1);
|
||||||
|
const p = ctx.createStereoPanner(); p.pan.value = pan;
|
||||||
|
v.connect(p); p.connect(master);
|
||||||
|
const s = ctx.createGain(); s.gain.value = 0.6; p.connect(s); s.connect(verbIn);
|
||||||
|
for (const [type, k, mul] of [['sine', 1, 1], ['triangle', 2, 0.18]]) {
|
||||||
|
const o = ctx.createOscillator(); o.type = type; o.frequency.value = midi(m) * k;
|
||||||
|
const og = ctx.createGain(); og.gain.value = mul; o.connect(og); og.connect(v); o.start(t); o.stop(t + 1.3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/** A quiet sub under each scene. */
|
||||||
|
function sub(t0, t1, m, g = 0.07) {
|
||||||
|
const o = ctx.createOscillator(); o.type = 'sine'; o.frequency.value = midi(m - 12);
|
||||||
|
const v = ctx.createGain(); v.gain.setValueAtTime(0, t0); v.gain.linearRampToValueAtTime(g, t0 + 0.8); v.gain.setValueAtTime(g, t1 - 0.3); v.gain.linearRampToValueAtTime(0, t1 + 0.4);
|
||||||
|
o.connect(v); v.connect(master); o.start(t0); o.stop(t1 + 0.5);
|
||||||
|
}
|
||||||
|
/** The soft accent on a scene change: a bell an octave or two up, with a long tail. */
|
||||||
|
function bell(t, m, g = 0.05, pan = 0) {
|
||||||
|
const p = ctx.createStereoPanner(); p.pan.value = pan; p.connect(sfx); p.connect(sfxVerb);
|
||||||
|
for (const [k, mul, d] of [[1, 1, 2.2], [2.01, 0.25, 1.2], [3.0, 0.08, 0.7]]) {
|
||||||
|
const o = ctx.createOscillator(); o.type = 'sine'; o.frequency.value = midi(m) * k;
|
||||||
|
const v = ctx.createGain(); env(v, t, 0.004, g * mul, d); o.connect(v); v.connect(p); o.start(t); o.stop(t + d + 0.1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/** A short airy swell into a scene change (very quiet). */
|
||||||
|
function swell(t, dur = 0.9, g = 0.03) {
|
||||||
|
const n = noiseSrc(t - dur, dur + 0.1); const bp = ctx.createBiquadFilter(); bp.type = 'bandpass'; bp.Q.value = 0.8;
|
||||||
|
bp.frequency.setValueAtTime(600, t - dur); bp.frequency.exponentialRampToValueAtTime(3200, t);
|
||||||
|
const v = ctx.createGain(); v.gain.setValueAtTime(0.0001, t - dur); v.gain.exponentialRampToValueAtTime(g, t - 0.05); v.gain.linearRampToValueAtTime(0, t + 0.1);
|
||||||
|
n.connect(bp); bp.connect(v); v.connect(sfx); v.connect(sfxVerb);
|
||||||
|
}
|
||||||
|
function tone(t, m, g, len = 0.25, type = 'sine', pan = 0) {
|
||||||
const o = ctx.createOscillator(); o.type = type; o.frequency.value = midi(m);
|
const o = ctx.createOscillator(); o.type = type; o.frequency.value = midi(m);
|
||||||
const p = ctx.createStereoPanner(); p.pan.value = pan;
|
const p = ctx.createStereoPanner(); p.pan.value = pan;
|
||||||
const v = ctx.createGain(); env(v, t, 0.003, g, len); o.connect(v); v.connect(p); p.connect(sfx); p.connect(sfxVerb);
|
const v = ctx.createGain(); env(v, t, 0.004, g, len); o.connect(v); v.connect(p); p.connect(sfx); p.connect(sfxVerb);
|
||||||
o.start(t); o.stop(t + len + 0.05);
|
o.start(t); o.stop(t + len + 0.05);
|
||||||
}
|
}
|
||||||
/** A mail arriving: a soft two-tone notification blip and a short swish. */
|
function tick(t, g = 0.03, f0 = 3000) {
|
||||||
function mail(t) { blip(t, 84, 0.12, 0.16); blip(t + 0.075, 91, 0.1, 0.3); whoosh(t - 0.12, 0.14, 0.08, 1200, 6000); }
|
const n = noiseSrc(t, 0.015); const bp = ctx.createBiquadFilter(); bp.type = 'bandpass'; bp.frequency.value = f0; bp.Q.value = 3;
|
||||||
/** A finding landing: a low, slightly sour thud with a click on top. */
|
const v = ctx.createGain(); env(v, t, 0.0006, g, 0.014); n.connect(bp); bp.connect(v); v.connect(sfx);
|
||||||
function bad(t) {
|
|
||||||
blip(t, 41, 0.3, 0.28, 'triangle'); blip(t, 47, 0.12, 0.2, 'square');
|
|
||||||
const n = noiseSrc(t, 0.03); const hp = ctx.createBiquadFilter(); hp.type = 'highpass'; hp.frequency.value = 2500;
|
|
||||||
const v = ctx.createGain(); env(v, t, 0.001, 0.25, 0.03); n.connect(hp); hp.connect(v); v.connect(sfx);
|
|
||||||
}
|
}
|
||||||
/** A fix: rising bell chimes (Ab major pentatonic), the fifth one brighter. */
|
function key(t) {
|
||||||
const GOOD = [68, 70, 72, 75, 80];
|
const n = noiseSrc(t, 0.02); const bp = ctx.createBiquadFilter(); bp.type = 'bandpass'; bp.frequency.value = 2400 + R() * 1800; bp.Q.value = 2.5;
|
||||||
function good(t, i) { blip(t, GOOD[i], 0.13, 0.5, 'sine', -0.3 + i * 0.15); blip(t, GOOD[i] + 12, 0.05, 0.35, 'triangle', 0.2); if (i === 4) { blip(t + 0.09, 84, 0.1, 0.8); blip(t + 0.09, 87, 0.07, 0.8); } }
|
const p = ctx.createStereoPanner(); p.pan.value = R() * 0.4 - 0.2;
|
||||||
/** A small UI pop (callouts). */
|
const v = ctx.createGain(); env(v, t, 0.0008, 0.05 * (0.7 + R() * 0.6), 0.016); n.connect(bp); bp.connect(v); v.connect(p); p.connect(sfx);
|
||||||
function pop(t) { const o = ctx.createOscillator(); o.type = 'sine'; o.frequency.setValueAtTime(520, t); o.frequency.exponentialRampToValueAtTime(1300, t + 0.07);
|
|
||||||
const v = ctx.createGain(); env(v, t, 0.002, 0.14, 0.09); o.connect(v); v.connect(sfx); o.start(t); o.stop(t + 0.15); }
|
|
||||||
/** A tick (screenshot tiles, checkboxes). */
|
|
||||||
function tick(t, g = 0.08, f0 = 3200) { const n = noiseSrc(t, 0.015); const bp = ctx.createBiquadFilter(); bp.type = 'bandpass'; bp.frequency.value = f0; bp.Q.value = 4;
|
|
||||||
const v = ctx.createGain(); env(v, t, 0.0006, g, 0.012); n.connect(bp); bp.connect(v); v.connect(sfx); }
|
|
||||||
/** A mouse click. */
|
|
||||||
function click(t) { tick(t, 0.22, 2400); tick(t + 0.055, 0.12, 1800); }
|
|
||||||
/** A sub drop for the hard cut. */
|
|
||||||
function thud(t, g = 0.7) { const o = ctx.createOscillator(); o.type = 'sine'; o.frequency.setValueAtTime(70, t); o.frequency.exponentialRampToValueAtTime(30, t + 0.6);
|
|
||||||
const v = ctx.createGain(); env(v, t, 0.004, g, 0.7); o.connect(v); v.connect(master); o.start(t); o.stop(t + 0.8); }
|
|
||||||
|
|
||||||
// ---- voices ----
|
|
||||||
function kick(t, g = 1) {
|
|
||||||
const o = ctx.createOscillator(); o.type = 'sine';
|
|
||||||
o.frequency.setValueAtTime(155, t); o.frequency.exponentialRampToValueAtTime(44, t + 0.11);
|
|
||||||
const v = ctx.createGain(); env(v, t, 0.002, 1.0 * g, 0.42);
|
|
||||||
o.connect(v); v.connect(drums); o.start(t); o.stop(t + 0.5);
|
|
||||||
const n = noiseSrc(t, 0.01); const hp = ctx.createBiquadFilter(); hp.type = 'highpass'; hp.frequency.value = 3500;
|
|
||||||
const nv = ctx.createGain(); env(nv, t, 0.001, 0.22 * g, 0.012); n.connect(hp); hp.connect(nv); nv.connect(drums);
|
|
||||||
duck.gain.setValueAtTime(0.28, t); duck.gain.linearRampToValueAtTime(1, t + 0.22);
|
|
||||||
}
|
|
||||||
function hat(t, g, pan) {
|
|
||||||
const n = noiseSrc(t, 0.06); const hp = ctx.createBiquadFilter(); hp.type = 'highpass'; hp.frequency.value = 7500;
|
|
||||||
const p = ctx.createStereoPanner(); p.pan.value = pan;
|
|
||||||
const v = ctx.createGain(); env(v, t, 0.001, g, 0.04); n.connect(hp); hp.connect(v); v.connect(p); p.connect(drums);
|
|
||||||
}
|
|
||||||
function clap(t, g = 0.4) {
|
|
||||||
const bp = ctx.createBiquadFilter(); bp.type = 'bandpass'; bp.frequency.value = 1300; bp.Q.value = 0.9;
|
|
||||||
const v = ctx.createGain(); v.gain.setValueAtTime(0, t);
|
|
||||||
for (let i = 0; i < 3; i++) { v.gain.setValueAtTime(g, t + i * 0.011); v.gain.exponentialRampToValueAtTime(g * 0.2, t + i * 0.011 + 0.009); }
|
|
||||||
v.gain.setValueAtTime(g * 0.8, t + 0.034); v.gain.exponentialRampToValueAtTime(0.0005, t + 0.2);
|
|
||||||
const n = noiseSrc(t, 0.25); n.connect(bp); bp.connect(v); v.connect(drums);
|
|
||||||
const s = ctx.createGain(); s.gain.value = 0.5; v.connect(s); s.connect(verbIn);
|
|
||||||
}
|
|
||||||
function snare(t, g) {
|
|
||||||
const n = noiseSrc(t, 0.12); const bp = ctx.createBiquadFilter(); bp.type = 'bandpass'; bp.frequency.value = 1900; bp.Q.value = 0.7;
|
|
||||||
const v = ctx.createGain(); env(v, t, 0.001, g, 0.09); n.connect(bp); bp.connect(v); v.connect(drums);
|
|
||||||
const o = ctx.createOscillator(); o.type = 'triangle'; o.frequency.setValueAtTime(240, t); o.frequency.exponentialRampToValueAtTime(160, t + 0.05);
|
|
||||||
const ov = ctx.createGain(); env(ov, t, 0.001, g * 0.5, 0.06); o.connect(ov); ov.connect(drums); o.start(t); o.stop(t + 0.12);
|
|
||||||
}
|
|
||||||
function arpNote(t, m, g = 0.12, len = 0.17) {
|
|
||||||
const v = ctx.createGain(); env(v, t, 0.003, g, len); v.connect(arpBus);
|
|
||||||
for (const [type, det] of [['sawtooth', -7], ['square', 7]]) {
|
|
||||||
const o = ctx.createOscillator(); o.type = type; o.frequency.value = midi(m); o.detune.value = det;
|
|
||||||
const og = ctx.createGain(); og.gain.value = type === 'square' ? 0.5 : 0.8;
|
|
||||||
o.connect(og); og.connect(v); o.start(t); o.stop(t + len + 0.05);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function bass(t, m, g = 0.32, len = BEAT * 0.45) {
|
|
||||||
const lp = ctx.createBiquadFilter(); lp.type = 'lowpass'; lp.frequency.setValueAtTime(900, t); lp.frequency.exponentialRampToValueAtTime(220, t + len); lp.Q.value = 4;
|
|
||||||
const v = ctx.createGain(); v.gain.setValueAtTime(0, t); v.gain.linearRampToValueAtTime(g, t + 0.004); v.gain.setValueAtTime(g, t + len * 0.7); v.gain.linearRampToValueAtTime(0, t + len);
|
|
||||||
lp.connect(v); v.connect(duck);
|
|
||||||
const o = ctx.createOscillator(); o.type = 'sawtooth'; o.frequency.value = midi(m); o.connect(lp); o.start(t); o.stop(t + len + 0.02);
|
|
||||||
const sub = ctx.createOscillator(); sub.type = 'sine'; sub.frequency.value = midi(m - 12);
|
|
||||||
const sg = ctx.createGain(); sg.gain.value = 0.9; sub.connect(sg); sg.connect(v); sub.start(t); sub.stop(t + len + 0.02);
|
|
||||||
}
|
|
||||||
function pad(t, dur, notes, g = 0.05, cutoff = 1500) {
|
|
||||||
const lp = ctx.createBiquadFilter(); lp.type = 'lowpass'; lp.frequency.value = cutoff; lp.Q.value = 0.7;
|
|
||||||
const v = ctx.createGain(); v.gain.setValueAtTime(0, t); v.gain.linearRampToValueAtTime(g, t + 0.25); v.gain.setValueAtTime(g, t + dur - 0.1); v.gain.linearRampToValueAtTime(0, t + dur + 0.25);
|
|
||||||
lp.connect(v); v.connect(duck);
|
|
||||||
const s = ctx.createGain(); s.gain.value = 0.6; v.connect(s); s.connect(verbIn);
|
|
||||||
for (const m of notes) for (const det of [-9, 9]) {
|
|
||||||
const o = ctx.createOscillator(); o.type = 'sawtooth'; o.frequency.value = midi(m); o.detune.value = det;
|
|
||||||
const p = ctx.createStereoPanner(); p.pan.value = det < 0 ? -0.4 : 0.4;
|
|
||||||
o.connect(p); p.connect(lp); o.start(t); o.stop(t + dur + 0.3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function impact(t, big = false) {
|
|
||||||
const o = ctx.createOscillator(); o.type = 'sine';
|
|
||||||
o.frequency.setValueAtTime(big ? 120 : 100, t); o.frequency.exponentialRampToValueAtTime(32, t + (big ? 0.9 : 0.5));
|
|
||||||
const v = ctx.createGain(); env(v, t, 0.003, big ? 0.95 : 0.6, big ? 1.3 : 0.6); o.connect(v); v.connect(master); o.start(t); o.stop(t + 1.6);
|
|
||||||
const n = noiseSrc(t, 2.0); const hp = ctx.createBiquadFilter(); hp.type = 'highpass'; hp.frequency.value = big ? 1800 : 3200;
|
|
||||||
const nv = ctx.createGain(); env(nv, t, 0.002, big ? 0.32 : 0.16, big ? 1.8 : 0.9); n.connect(hp); hp.connect(nv); nv.connect(master);
|
|
||||||
const s = ctx.createGain(); s.gain.value = big ? 0.7 : 0.4; nv.connect(s); s.connect(verbIn);
|
|
||||||
}
|
|
||||||
function stab(t, name, g = 0.09) {
|
|
||||||
const [root, iv] = CH[name];
|
|
||||||
const notes = [root - 12, ...iv.map(i => root + i), ...iv.map(i => root + 12 + i)];
|
|
||||||
const lp = ctx.createBiquadFilter(); lp.type = 'lowpass'; lp.frequency.setValueAtTime(5000, t); lp.frequency.exponentialRampToValueAtTime(600, t + 1.4);
|
|
||||||
const v = ctx.createGain(); env(v, t, 0.004, g, 1.6); lp.connect(v); v.connect(master);
|
|
||||||
const s = ctx.createGain(); s.gain.value = 0.8; v.connect(s); s.connect(verbIn);
|
|
||||||
for (const m of notes) for (const det of [-11, 0, 11]) {
|
|
||||||
const o = ctx.createOscillator(); o.type = 'sawtooth'; o.frequency.value = midi(m); o.detune.value = det;
|
|
||||||
o.connect(lp); o.start(t); o.stop(t + 1.8);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function whoosh(t, dur, g = 0.22, from = 500, to = 7000) {
|
|
||||||
const n = noiseSrc(t, dur + 0.05); const bp = ctx.createBiquadFilter(); bp.type = 'bandpass'; bp.Q.value = 2.2;
|
|
||||||
bp.frequency.setValueAtTime(from, t); bp.frequency.exponentialRampToValueAtTime(to, t + dur);
|
|
||||||
const v = ctx.createGain(); v.gain.setValueAtTime(0.0001, t); v.gain.exponentialRampToValueAtTime(g, t + dur * 0.95); v.gain.linearRampToValueAtTime(0, t + dur);
|
|
||||||
n.connect(bp); bp.connect(v); v.connect(master);
|
|
||||||
}
|
|
||||||
function riser(t, dur, g = 0.07) {
|
|
||||||
whoosh(t, dur, 0.3, 300, 9000);
|
|
||||||
const o = ctx.createOscillator(); o.type = 'sawtooth'; o.frequency.setValueAtTime(midi(53), t); o.frequency.exponentialRampToValueAtTime(midi(77), t + dur);
|
|
||||||
const lp = ctx.createBiquadFilter(); lp.type = 'lowpass'; lp.frequency.setValueAtTime(800, t); lp.frequency.exponentialRampToValueAtTime(6000, t + dur);
|
|
||||||
const v = ctx.createGain(); v.gain.setValueAtTime(0, t); v.gain.linearRampToValueAtTime(g, t + dur); v.gain.linearRampToValueAtTime(0, t + dur + 0.02);
|
|
||||||
o.connect(lp); lp.connect(v); v.connect(master); o.start(t); o.stop(t + dur + 0.05);
|
|
||||||
}
|
|
||||||
function key(t, g) {
|
|
||||||
const n = noiseSrc(t, 0.02); const bp = ctx.createBiquadFilter(); bp.type = 'bandpass'; bp.frequency.value = 2600 + R() * 2600; bp.Q.value = 3;
|
|
||||||
const p = ctx.createStereoPanner(); p.pan.value = R() * 0.5 - 0.25;
|
|
||||||
const v = ctx.createGain(); env(v, t, 0.0008, g * (0.7 + R() * 0.6), 0.012); n.connect(bp); bp.connect(v); v.connect(p); p.connect(master);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---- arrangement ----
|
// ---- the bed: one chord per scene ----
|
||||||
const cut = scene('scan').start; // the hook's hard cut to black
|
SCENES.forEach((s, i) => {
|
||||||
const drop = ENTER_AT; // the Enter key: the groove starts
|
const [root, iv] = CH[SCENE_CHORD[s.id]];
|
||||||
const roll = sub - BAR; // the bar before the Submit card
|
const last = i === SCENES.length - 1;
|
||||||
const music = ctx.createGain(); music.gain.value = 1; // the arrangement's gain: silent for the typed command
|
const t0 = Math.max(0, s.start - 0.4), t1 = last ? DURATION + 0.6 : s.end;
|
||||||
duck.disconnect(); duck.connect(music); drums.disconnect(); drums.connect(music); music.connect(master);
|
const notes = [root, root + iv[1], root + iv[2], root + 12];
|
||||||
music.gain.setValueAtTime(1, 0); music.gain.setValueAtTime(1, cut - 0.01); music.gain.linearRampToValueAtTime(0.0, cut + 0.005);
|
pad(t0, last ? scene('submit').start + SUBMIT.logoAt : t1, notes, s.id === 'hook' ? 0.03 : 0.034, s.id === 'hook' ? 800 : 1100);
|
||||||
music.gain.setValueAtTime(0.0, drop - 0.02); music.gain.linearRampToValueAtTime(1, drop);
|
sub(t0, t1, root, s.id === 'hook' ? 0.05 : 0.065);
|
||||||
duck.gain.setValueAtTime(1, 0);
|
// the arpeggio: quiet under the hook, then a steady, soft pulse
|
||||||
const last = BARS.length - 1;
|
const tones = iv.map(x => root + 12 + x).concat(iv.map(x => root + 24 + x));
|
||||||
for (let b = 0; b <= last; b++) {
|
for (let t = Math.max(0.5, s.start), k = 0; t < (last ? s.start + SUBMIT.logoAt : s.end) - 0.05; t += STEP, k++) {
|
||||||
const t0 = b * BAR, name = BARS[b], [root, iv] = CH[name];
|
const m = tones[ARP[k % ARP.length] + (k % 16 >= 8 ? 1 : 0)] ?? tones[0];
|
||||||
const tones = [0, iv[1], iv[2], 12, 12 + iv[1], 12 + iv[2], 24].map(x => root + 12 + x);
|
pluck(t, m, s.id === 'hook' ? 0.028 : 0.04, (k % 2 ? 0.25 : -0.25));
|
||||||
const calmBar = t0 >= sub && t0 < brand, end = b === last, intro = t0 < cut;
|
|
||||||
if (!end) pad(t0, BAR, [root, root + iv[1], root + iv[2], root + 12], calmBar ? 0.06 : intro ? 0.05 : 0.035, calmBar ? 1100 : intro ? 900 : 1500);
|
|
||||||
else pad(t0, BAR * 0.9, [root, root + iv[1], root + iv[2], root + 12], 0.05, 1600);
|
|
||||||
for (let s = 0; s < 16; s++) {
|
|
||||||
const t = t0 + s * BEAT / 4;
|
|
||||||
const beat = s % 4 === 0, off = s % 4 === 2, calm = t >= sub && t < brand;
|
|
||||||
const groove = t >= drop - 0.001 && t < sub && !(t >= roll + BAR / 2);
|
|
||||||
if (!end) {
|
|
||||||
if (calm) { if (s % 2 === 0) arpNote(t, tones[ARP[s]] ?? root, 0.08, 0.3); }
|
|
||||||
else if (t < cut) arpNote(t, tones[ARP[s]] ?? root, 0.07, 0.14);
|
|
||||||
else if (t >= drop) arpNote(t, tones[ARP[s]] ?? root, 0.1, 0.16);
|
|
||||||
}
|
}
|
||||||
if (intro && s % 2 === 0) hat(t, s % 4 === 0 ? 0.05 : 0.025, 0.1);
|
});
|
||||||
if (intro && beat) { const o = ctx.createOscillator(); o.type = 'sine'; o.frequency.setValueAtTime(58, t); o.frequency.exponentialRampToValueAtTime(40, t + 0.2);
|
// the end card: a warm, open chord swell and one bell
|
||||||
const v = ctx.createGain(); env(v, t, 0.004, 0.35, 0.3); o.connect(v); v.connect(drums); o.start(t); o.stop(t + 0.4); }
|
const end = scene('submit').start + SUBMIT.logoAt;
|
||||||
if (groove) {
|
const [er, eiv] = CH.Dadd9;
|
||||||
if (beat) kick(t);
|
pad(end - 0.3, DURATION + 0.6, [er - 12, er, er + eiv[1], er + eiv[2], er + eiv[3]], 0.045, 1500);
|
||||||
if (off) { hat(t, 0.13, 0.2); bass(t, root - 12); } else if (!beat) hat(t, 0.04, -0.2);
|
bell(end + 0.2, er + 24, 0.06);
|
||||||
if (t >= drop + BAR && (s === 4 || s === 12)) clap(t, 0.32);
|
bell(end + 0.55, er + 24 + 7, 0.04, 0.2);
|
||||||
}
|
|
||||||
if (calm && off) hat(t, 0.045, 0.15);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// snare roll + riser into the Submit card
|
|
||||||
for (let i = 0; i < 8; i++) snare(roll + i * BEAT / 4, 0.04 + 0.09 * i / 7);
|
|
||||||
for (let i = 0; i < 16; i++) snare(roll + BAR / 2 + i * BEAT / 8, 0.12 + 0.16 * i / 15);
|
|
||||||
riser(roll, BAR, 0.06);
|
|
||||||
riser(brand - BAR / 2, BAR / 2, 0.045);
|
|
||||||
|
|
||||||
// ---- sound design on the cuts ----
|
// ---- soft accents on the scene changes ----
|
||||||
// the hook: mails, then the two slams; the hard cut drops to silence with a sub thud
|
|
||||||
for (const t of TICKS.filter(x => x.kind === 'mail').map(x => x.t)) mail(t);
|
|
||||||
impact(B(3), true); stab(B(3), 'Db', 0.07); snare(B(3), 0.3);
|
|
||||||
impact(B(4), true); stab(B(4), 'Fm', 0.09); kick(B(4), 1); clap(B(4), 0.4);
|
|
||||||
riser(B(5), B(2) - 0.02, 0.035);
|
|
||||||
thud(cut, 0.55);
|
|
||||||
// the Enter key
|
|
||||||
click(drop - 0.01); impact(drop, true); stab(drop, 'Fm', 0.07);
|
|
||||||
// every later cut: a whoosh into it and a hit on it
|
|
||||||
for (const c of CUTS) {
|
for (const c of CUTS) {
|
||||||
if (c.kind === 'hard' || c.t === drop) continue;
|
const [root, iv] = CH[SCENE_CHORD[c.id]];
|
||||||
const big = c.id === 'submit' || c.id === 'brand';
|
swell(c.t, 0.9, 0.025);
|
||||||
if (c.kind.startsWith('whip')) whoosh(c.t - 0.3, 0.32, 0.2, 700, 7500);
|
bell(c.t + 0.02, root + 24 + iv[2], 0.045, (c.t * 7) % 2 - 1 > 0 ? 0.15 : -0.15);
|
||||||
else if (c.kind === 'iris' || c.kind === 'wipe') whoosh(c.t - 0.22, 0.42, 0.14, 300, 3500);
|
|
||||||
else if (c.kind === 'zoom') whoosh(c.t - 0.36, 0.36, 0.22, 400, 9000);
|
|
||||||
impact(c.t, big);
|
|
||||||
}
|
}
|
||||||
stab(sub, 'Db', 0.09);
|
|
||||||
stab(brand, 'Fm', 0.1); kick(brand, 1);
|
// ---- UI sounds ----
|
||||||
// ticks: SDKs and the risks line (soft), findings (bad), fixes (good), callouts (pop)
|
for (const x of ticks()) {
|
||||||
for (const x of TICKS) {
|
if (x.kind === 'tiny') tick(x.t, 0.022, 2800);
|
||||||
if (x.kind === 'soft') tick(x.t, 0.12, 2600);
|
else if (x.kind === 'soft') { tick(x.t, 0.03, 2400); tone(x.t, 86, 0.012, 0.18); }
|
||||||
else if (x.kind === 'bad') bad(x.t);
|
else if (x.kind === 'mail') { tone(x.t, 81, 0.04, 0.2); tone(x.t + 0.09, 88, 0.035, 0.4); }
|
||||||
else if (x.kind === 'good') good(x.t, x.step);
|
else if (x.kind === 'low') { tone(x.t, 50, 0.07, 0.5, 'triangle'); tone(x.t, 57, 0.02, 0.3); }
|
||||||
else if (x.kind === 'pop') pop(x.t);
|
else if (x.kind === 'ask') { tone(x.t, 83, 0.035, 0.3); tone(x.t + 0.14, 81, 0.03, 0.45); }
|
||||||
|
else if (x.kind === 'good') { const m = [74, 78, 81][x.step] ?? 81; tone(x.t, m, 0.04, 0.6, 'sine', -0.2 + 0.2 * x.step); tone(x.t, m + 12, 0.012, 0.4); }
|
||||||
}
|
}
|
||||||
// the screenshot wall (tiles pop for 1.5 s) and the Data safety rows
|
for (const t of keyTimes()) key(t);
|
||||||
const shots = scene('shots').start, decl = scene('decl').start;
|
|
||||||
for (let i = 0; i < 26; i++) tick(shots + 0.14 + i * 0.058, 0.05 + 0.03 * Math.sin(i), 2800 + (i % 5) * 300);
|
|
||||||
for (let i = 0; i < 7; i++) { tick(decl + 0.95 + i * 0.16, 0.12, 2000); blip(decl + 0.95 + i * 0.16, 79 + (i % 3) * 2, 0.035, 0.08); }
|
|
||||||
// the mouse click on "Scan again" in the desktop Checks tab
|
|
||||||
click(scene('desk3').start + DESKTOP.desk3.cursor[1][0] + 0.02);
|
|
||||||
// key clicks: the typed command loud (the only sound there), the re-scan softer
|
|
||||||
for (const t of keyTimes()) key(t, t < drop ? 0.24 : 0.08);
|
|
||||||
|
|
||||||
const buf = await ctx.startRendering();
|
const buf = await ctx.startRendering();
|
||||||
const n = Math.round(DURATION * SR);
|
const n = Math.round(DURATION * SR);
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
#!/usr/bin/env bun
|
#!/usr/bin/env bun
|
||||||
// Renders the storebound teaser: frames from index.html (Playwright, headless Chrome) piped into ffmpeg, plus the
|
// Renders the storebound teaser (16:9 only): frames from index.html (Playwright, headless Chrome) piped into ffmpeg,
|
||||||
// original music and sound design (music.js, OfflineAudioContext in the same browser), mastered to about -14 LUFS.
|
// plus the original music and sound design (music.js, OfflineAudioContext in the same browser), mastered to about
|
||||||
// Frames are captured at 60 fps and blended in pairs down to 30 fps (a 180° shutter), so fast moves get real motion blur.
|
// -16 LUFS. Frames are captured at 60 fps and blended in pairs down to 30 fps (a 180° shutter): slow moves stay smooth.
|
||||||
// bun media/teaser/render.ts both formats, sound, posters, web version -> media/teaser/out/
|
// bun media/teaser/render.ts master 1920x1080, sound, poster, 1280x720 web version -> media/teaser/out/
|
||||||
// bun media/teaser/render.ts --only v vertical only (v = 1080x1920, h = 1920x1080; the web version needs h)
|
|
||||||
// bun media/teaser/render.ts --stills 1,9.5,30 PNG stills only (out/stills/), quick layout check
|
// bun media/teaser/render.ts --stills 1,9.5,30 PNG stills only (out/stills/), quick layout check
|
||||||
// bun media/teaser/render.ts --desktop capture the desktop app frames again first (desktop.ts)
|
// bun media/teaser/render.ts --desktop capture the desktop app frames again first (desktop.ts)
|
||||||
// bun media/teaser/render.ts --serve preview server: open /index.html?w=1080&h=1920&play=1
|
// bun media/teaser/render.ts --serve preview server: open /index.html?play=1 (or ?t=12.5)
|
||||||
// Needs ffmpeg and Playwright (devDependency; Playwright's Chromium or an installed Google Chrome).
|
// Needs ffmpeg and Playwright (devDependency; Playwright's Chromium or an installed Google Chrome), and the demo game's
|
||||||
|
// store renders (examples/demo-game: `shots capture`, `shots fonts`, `shots render`, see its README).
|
||||||
import { existsSync, mkdirSync, readdirSync, rmSync, statSync, writeFileSync } from 'node:fs';
|
import { existsSync, mkdirSync, readdirSync, rmSync, statSync, writeFileSync } from 'node:fs';
|
||||||
import { join } from 'node:path';
|
import { join } from 'node:path';
|
||||||
import { launch } from '../../cli/shots/browser';
|
import { launch } from '../../cli/shots/browser';
|
||||||
|
|
@ -19,7 +19,10 @@ const OUT = join(DIR, 'out');
|
||||||
const ASSETS = join(OUT, 'assets');
|
const ASSETS = join(OUT, 'assets');
|
||||||
const args = process.argv.slice(2);
|
const args = process.argv.slice(2);
|
||||||
const opt = (k: string): string | undefined => { const i = args.indexOf(`--${k}`); return i >= 0 ? args[i + 1] : undefined; };
|
const opt = (k: string): string | undefined => { const i = args.indexOf(`--${k}`); return i >= 0 ? args[i + 1] : undefined; };
|
||||||
const FORMATS = [{ id: 'v', w: 1080, h: 1920 }, { id: 'h', w: 1920, h: 1080 }].filter(f => !opt('only') || opt('only') === f.id);
|
/** 16:9 only. */
|
||||||
|
const FORMAT = { w: 1920, h: 1080 };
|
||||||
|
/** The web version: 1280x720 H.264, two-pass to about this many bytes. */
|
||||||
|
const WEB_BYTES = 4.5e6;
|
||||||
const CAPTURE_FPS = 60;
|
const CAPTURE_FPS = 60;
|
||||||
const log = (m: string): void => console.log(`${new Date().toISOString().slice(11, 19)} [teaser] ${m}`);
|
const log = (m: string): void => console.log(`${new Date().toISOString().slice(11, 19)} [teaser] ${m}`);
|
||||||
|
|
||||||
|
|
@ -30,28 +33,22 @@ function sh(cmd: string[], input?: Uint8Array): string {
|
||||||
}
|
}
|
||||||
const ff = (...a: string[]): string => sh(['ffmpeg', '-hide_banner', '-loglevel', 'error', '-y', ...a]);
|
const ff = (...a: string[]): string => sh(['ffmpeg', '-hide_banner', '-loglevel', 'error', '-y', ...a]);
|
||||||
|
|
||||||
/** The screenshot wall: the demo game's real store renders (4 languages, two sets), or crops of docs/img/showcase.jpg. */
|
/** The screenshot grid: the demo game's real store renders, the first image of every size in every language. */
|
||||||
function prepAssets(): void {
|
function prepAssets(): void {
|
||||||
const dir = join(ASSETS, 'grid');
|
const dir = join(ASSETS, 'shots');
|
||||||
rmSync(dir, { recursive: true, force: true });
|
rmSync(dir, { recursive: true, force: true });
|
||||||
mkdirSync(dir, { recursive: true });
|
mkdirSync(dir, { recursive: true });
|
||||||
const renders = join(ROOT, 'examples/demo-game/store/renders');
|
const renders = join(ROOT, 'examples/demo-game/store/renders');
|
||||||
const files: string[] = [];
|
const missing: string[] = [];
|
||||||
for (const set of ['', 'b/']) for (const lang of ['en', 'tr', 'ja', 'ar']) for (const n of ['01', '02', '03', '04']) {
|
let n = 0;
|
||||||
const src = join(renders, `${set}${lang}`, 'play', `${n}.png`);
|
for (const lang of ['en', 'tr', 'ja', 'ar']) for (const size of ['ios69', 'ios65', 'ipad13', 'play', 'tab7', 'tab10', 'feature']) {
|
||||||
if (!existsSync(src)) continue;
|
const src = join(renders, lang, size, size === 'feature' ? '1024x500.png' : '01.png');
|
||||||
const name = `${set ? 'b-' : ''}${lang}-${n}.jpg`;
|
if (!existsSync(src)) { missing.push(`${lang}/${size}`); continue; }
|
||||||
ff('-i', src, '-vf', 'scale=360:640:flags=lanczos', '-q:v', '3', join(dir, name));
|
ff('-i', src, '-vf', size === 'feature' ? 'scale=600:-2:flags=lanczos' : 'scale=-2:360:flags=lanczos', '-q:v', '3', join(dir, `${lang}-${size}.jpg`));
|
||||||
files.push(name);
|
n++;
|
||||||
}
|
}
|
||||||
if (files.length) log(`assets: ${files.length} demo game renders (examples/demo-game/store/renders)`);
|
if (missing.length) throw new Error(`demo game renders missing (${missing.slice(0, 4).join(', ')}${missing.length > 4 ? ', ...' : ''}): run its shots capture, fonts and render first (examples/demo-game/README.md)`);
|
||||||
else {
|
log(`assets: ${n} demo game renders (examples/demo-game/store/renders)`);
|
||||||
// showcase.jpg: 7 panes (en 01-04, tr, ja, ar hero), 263 x 571 each, 283 px apart, from (20, 20)
|
|
||||||
const show = join(ROOT, 'docs/img/showcase.jpg');
|
|
||||||
for (let i = 0; i < 7; i++) { const name = `show-${i}.jpg`; ff('-i', show, '-vf', `crop=263:468:${20 + i * 283}:20,scale=360:640:flags=lanczos`, '-q:v', '3', join(dir, name)); files.push(name); }
|
|
||||||
log('assets: demo renders not found, using crops of docs/img/showcase.jpg (run the demo\'s `shots render` for the real wall)');
|
|
||||||
}
|
|
||||||
writeFileSync(join(ASSETS, 'grid.json'), `${JSON.stringify(files)}\n`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function serve(): ReturnType<typeof Bun.serve> {
|
function serve(): ReturnType<typeof Bun.serve> {
|
||||||
|
|
@ -60,8 +57,8 @@ function serve(): ReturnType<typeof Bun.serve> {
|
||||||
fetch(req) {
|
fetch(req) {
|
||||||
const p = decodeURIComponent(new URL(req.url).pathname).replace(/^\/+/, '') || 'index.html';
|
const p = decodeURIComponent(new URL(req.url).pathname).replace(/^\/+/, '') || 'index.html';
|
||||||
if (p.includes('..')) return new Response('no', { status: 400 });
|
if (p.includes('..')) return new Response('no', { status: 400 });
|
||||||
// the logo comes from the repo's brand/ folder (tools/brand-assets.py), not a copy
|
// the logo comes from the repo's brand/ folder (tools/brand-assets.py) and the app icon from the demo game, not copies
|
||||||
const f = Bun.file(p.startsWith('brand/') ? join(ROOT, p) : join(DIR, p));
|
const f = Bun.file(p.startsWith('brand/') || p.startsWith('examples/demo-game/store/icon/') ? join(ROOT, p) : join(DIR, p));
|
||||||
return f.size ? new Response(f) : new Response('not found', { status: 404 });
|
return f.size ? new Response(f) : new Response('not found', { status: 404 });
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
@ -73,17 +70,18 @@ async function main(): Promise<void> {
|
||||||
if (args.includes('--desktop') || !existsSync(join(OUT, 'desktop/boxes.json'))) await captureDesktop();
|
if (args.includes('--desktop') || !existsSync(join(OUT, 'desktop/boxes.json'))) await captureDesktop();
|
||||||
const server = serve();
|
const server = serve();
|
||||||
const base = `http://127.0.0.1:${server.port}/index.html`;
|
const base = `http://127.0.0.1:${server.port}/index.html`;
|
||||||
if (args.includes('--serve')) { log(`preview: ${base}?w=1080&h=1920&play=1`); return; }
|
if (args.includes('--serve')) { log(`preview: ${base}?play=1`); return; }
|
||||||
|
|
||||||
const browser = await launch(ROOT, { headless: true });
|
const browser = await launch(ROOT, { headless: true });
|
||||||
try {
|
try {
|
||||||
const stills = opt('stills');
|
const stills = opt('stills');
|
||||||
for (const f of FORMATS) {
|
{
|
||||||
|
const f = FORMAT;
|
||||||
const page = await browser.newPage({ viewport: { width: f.w, height: f.h }, deviceScaleFactor: 1 });
|
const page = await browser.newPage({ viewport: { width: f.w, height: f.h }, deviceScaleFactor: 1 });
|
||||||
const errors: string[] = [];
|
const errors: string[] = [];
|
||||||
page.on('pageerror', (e: Error) => errors.push(e.message));
|
page.on('pageerror', (e: Error) => errors.push(e.message));
|
||||||
page.on('response', (r: any) => { if (r.status() >= 400 && !r.url().endsWith('/favicon.ico')) errors.push(`${r.status()} ${r.url()}`); });
|
page.on('response', (r: any) => { if (r.status() >= 400 && !r.url().endsWith('/favicon.ico')) errors.push(`${r.status()} ${r.url()}`); });
|
||||||
await page.goto(`${base}?w=${f.w}&h=${f.h}`);
|
await page.goto(base);
|
||||||
await page.waitForFunction('window.teaser', null, { timeout: 30_000 });
|
await page.waitForFunction('window.teaser', null, { timeout: 30_000 });
|
||||||
await page.evaluate('window.teaser.ready');
|
await page.evaluate('window.teaser.ready');
|
||||||
const { DURATION, FPS } = await page.evaluate('({ DURATION: teaser.DURATION, FPS: teaser.FPS })') as { DURATION: number; FPS: number };
|
const { DURATION, FPS } = await page.evaluate('({ DURATION: teaser.DURATION, FPS: teaser.FPS })') as { DURATION: number; FPS: number };
|
||||||
|
|
@ -93,11 +91,11 @@ async function main(): Promise<void> {
|
||||||
};
|
};
|
||||||
if (stills) {
|
if (stills) {
|
||||||
mkdirSync(join(OUT, 'stills'), { recursive: true });
|
mkdirSync(join(OUT, 'stills'), { recursive: true });
|
||||||
for (const t of stills.split(',').map(Number)) await Bun.write(join(OUT, 'stills', `${f.id}-${t.toFixed(2)}.png`), await shot(t));
|
for (const t of stills.split(',').map(Number)) await Bun.write(join(OUT, 'stills', `${t.toFixed(2)}.png`), await shot(t));
|
||||||
log(`${f.id}: ${stills.split(',').length} stills in out/stills`);
|
log(`${stills.split(',').length} stills in out/stills`);
|
||||||
if (errors.length) throw new Error(`page errors:\n ${errors.join('\n ')}`);
|
if (errors.length) throw new Error(`page errors:\n ${errors.join('\n ')}`);
|
||||||
await page.close();
|
await page.close();
|
||||||
continue;
|
return;
|
||||||
}
|
}
|
||||||
// 60 fps capture, then each pair of frames is averaged into one 30 fps frame (motion blur on fast moves)
|
// 60 fps capture, then each pair of frames is averaged into one 30 fps frame (motion blur on fast moves)
|
||||||
const frames = Math.round(DURATION * CAPTURE_FPS);
|
const frames = Math.round(DURATION * CAPTURE_FPS);
|
||||||
|
|
@ -112,17 +110,17 @@ async function main(): Promise<void> {
|
||||||
enc.stdin.write(await shot(i / CAPTURE_FPS));
|
enc.stdin.write(await shot(i / CAPTURE_FPS));
|
||||||
if (i % 120 === 0 || i === frames - 1) {
|
if (i % 120 === 0 || i === frames - 1) {
|
||||||
const el = (Date.now() - t0) / 1000;
|
const el = (Date.now() - t0) / 1000;
|
||||||
log(`${f.id}: frame ${i + 1}/${frames} · ${el.toFixed(0)}s · eta ${((frames - i - 1) * el / (i + 1)).toFixed(0)}s`);
|
log(`frame ${i + 1}/${frames} · ${el.toFixed(0)}s · eta ${((frames - i - 1) * el / (i + 1)).toFixed(0)}s`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await enc.stdin.end();
|
await enc.stdin.end();
|
||||||
if (await enc.exited !== 0) throw new Error('ffmpeg encode failed');
|
if (await enc.exited !== 0) throw new Error('ffmpeg encode failed');
|
||||||
if (errors.length) throw new Error(`page errors:\n ${[...new Set(errors)].join('\n ')}`);
|
if (errors.length) throw new Error(`page errors:\n ${[...new Set(errors)].join('\n ')}`);
|
||||||
ff('-ss', String(DURATION - 0.5), '-i', silent, '-frames:v', '1', '-q:v', '3', join(OUT, `poster-${f.w}x${f.h}.jpg`));
|
ff('-ss', String(DURATION - 0.5), '-i', silent, '-frames:v', '1', '-q:v', '3', join(OUT, `poster-${f.w}x${f.h}.jpg`));
|
||||||
log(`${f.id}: ${silent} (${(statSync(silent).size / 1e6).toFixed(1)} MB)`);
|
log(`${silent} (${(statSync(silent).size / 1e6).toFixed(1)} MB)`);
|
||||||
await page.close();
|
await page.close();
|
||||||
}
|
}
|
||||||
if (stills || args.includes('--no-audio')) return;
|
if (args.includes('--no-audio')) return;
|
||||||
|
|
||||||
// music + sound design
|
// music + sound design
|
||||||
const page = await browser.newPage();
|
const page = await browser.newPage();
|
||||||
|
|
@ -133,23 +131,23 @@ async function main(): Promise<void> {
|
||||||
const raw = join(OUT, 'music-raw.wav'), music = join(OUT, 'music.wav');
|
const raw = join(OUT, 'music-raw.wav'), music = join(OUT, 'music.wav');
|
||||||
await Bun.write(raw, Buffer.from(wav.base64, 'base64'));
|
await Bun.write(raw, Buffer.from(wav.base64, 'base64'));
|
||||||
const dur = wav.seconds;
|
const dur = wav.seconds;
|
||||||
// two-pass loudnorm to -14 LUFS / -1.5 dBTP, then a short fade out
|
// two-pass loudnorm to -16 LUFS / -1.5 dBTP (calm music), then a short fade out
|
||||||
const m = Bun.spawnSync(['ffmpeg', '-hide_banner', '-i', raw, '-af', 'loudnorm=I=-14:TP=-1.5:LRA=11:print_format=json', '-f', 'null', '-'], { stderr: 'pipe' });
|
const m = Bun.spawnSync(['ffmpeg', '-hide_banner', '-i', raw, '-af', 'loudnorm=I=-16:TP=-1.5:LRA=11:print_format=json', '-f', 'null', '-'], { stderr: 'pipe' });
|
||||||
const j = JSON.parse(m.stderr.toString().match(/\{[\s\S]*?\}/)![0]) as Record<string, string>;
|
const j = JSON.parse(m.stderr.toString().match(/\{[\s\S]*?\}/)![0]) as Record<string, string>;
|
||||||
ff('-i', raw, '-af', `loudnorm=I=-14:TP=-1.5:LRA=11:measured_I=${j.input_i}:measured_TP=${j.input_tp}:measured_LRA=${j.input_lra}:measured_thresh=${j.input_thresh}:offset=${j.target_offset}:linear=true,afade=t=out:st=${(dur - 1.2).toFixed(2)}:d=1.2,aresample=48000`,
|
ff('-i', raw, '-af', `loudnorm=I=-16:TP=-1.5:LRA=11:measured_I=${j.input_i}:measured_TP=${j.input_tp}:measured_LRA=${j.input_lra}:measured_thresh=${j.input_thresh}:offset=${j.target_offset}:linear=true,afade=t=out:st=${(dur - 1.5).toFixed(2)}:d=1.5,aresample=48000`,
|
||||||
'-c:a', 'pcm_s16le', '-ar', '48000', '-ac', '2', music);
|
'-c:a', 'pcm_s16le', '-ar', '48000', '-ac', '2', music);
|
||||||
for (const f of FORMATS) {
|
{
|
||||||
const silent = join(OUT, `teaser-${f.w}x${f.h}-silent.mp4`), out = join(OUT, `teaser-${f.w}x${f.h}.mp4`);
|
const silent = join(OUT, `teaser-${FORMAT.w}x${FORMAT.h}-silent.mp4`), out = join(OUT, `teaser-${FORMAT.w}x${FORMAT.h}.mp4`);
|
||||||
if (!existsSync(silent)) continue;
|
if (!existsSync(silent)) throw new Error(`${silent} missing`);
|
||||||
ff('-i', silent, '-i', music, '-map', '0:v', '-map', '1:a', '-c:v', 'copy', '-c:a', 'aac', '-b:a', '192k', '-ar', '48000', '-ac', '2', '-shortest', '-movflags', '+faststart', out);
|
ff('-i', silent, '-i', music, '-map', '0:v', '-map', '1:a', '-c:v', 'copy', '-c:a', 'aac', '-b:a', '192k', '-ar', '48000', '-ac', '2', '-shortest', '-movflags', '+faststart', out);
|
||||||
log(`${out} (${(statSync(out).size / 1e6).toFixed(1)} MB)`);
|
log(`${out} (${(statSync(out).size / 1e6).toFixed(1)} MB)`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// web version for the site: 1280x720 H.264, about 3.5 MB (two-pass), plus its poster
|
// web version: 1280x720 H.264, about 4.5 MB (two-pass), plus its poster
|
||||||
const h = join(OUT, 'teaser-1920x1080.mp4');
|
const h = join(OUT, 'teaser-1920x1080.mp4');
|
||||||
if (existsSync(h)) {
|
if (existsSync(h)) {
|
||||||
const web = join(OUT, 'teaser-web.mp4'), pass = join(OUT, 'web-pass');
|
const web = join(OUT, 'teaser-web.mp4'), pass = join(OUT, 'web-pass');
|
||||||
const kbps = Math.floor((3.5e6 * 8) / dur / 1000) - 96;
|
const kbps = Math.floor((WEB_BYTES * 8) / dur / 1000) - 96;
|
||||||
const common = ['-vf', 'scale=1280:720:flags=lanczos', '-c:v', 'libx264', '-profile:v', 'high', '-preset', 'slow', '-b:v', `${kbps}k`, '-maxrate', `${Math.round(kbps * 1.8)}k`, '-bufsize', `${kbps * 3}k`, '-pix_fmt', 'yuv420p', '-g', '60', '-passlogfile', pass];
|
const common = ['-vf', 'scale=1280:720:flags=lanczos', '-c:v', 'libx264', '-profile:v', 'high', '-preset', 'slow', '-b:v', `${kbps}k`, '-maxrate', `${Math.round(kbps * 1.8)}k`, '-bufsize', `${kbps * 3}k`, '-pix_fmt', 'yuv420p', '-g', '60', '-passlogfile', pass];
|
||||||
ff('-i', h, ...common, '-pass', '1', '-an', '-f', 'mp4', '/dev/null');
|
ff('-i', h, ...common, '-pass', '1', '-an', '-f', 'mp4', '/dev/null');
|
||||||
ff('-i', h, ...common, '-pass', '2', '-c:a', 'aac', '-b:a', '96k', '-ac', '2', '-movflags', '+faststart', web);
|
ff('-i', h, ...common, '-pass', '2', '-c:a', 'aac', '-b:a', '96k', '-ac', '2', '-movflags', '+faststart', web);
|
||||||
|
|
|
||||||
|
|
@ -1,207 +1,253 @@
|
||||||
// Teaser timeline: the single source of truth for the picture (teaser.js) and the sound (music.js).
|
// Teaser timeline (v4): the single source of truth for the picture (teaser.js) and the sound (music.js).
|
||||||
// Every frame is a pure function of time; every cut sits on a beat of the 128 BPM grid, and the sound effects (whoosh,
|
// One idea per scene, 6-7 s each, one slow camera move per scene, soft dissolves between scenes (no whips, no rapid
|
||||||
// tick, hit) are placed from the same numbers, so they land on the cuts.
|
// cuts). Every scene has one plain-English caption at the top that is fully on screen for at least 4 s; the lower part
|
||||||
|
// shows the real product: CLI output and desktop-app frames.
|
||||||
//
|
//
|
||||||
// The scan text is the real `storebound scan` output of tests/fixtures/scan/teaser (before) and teaser-fixed (after
|
// Every CLI line shown here is real output; tests/teaser.test.ts runs each command and checks every line:
|
||||||
// the five fixes); tests/teaser.test.ts runs the scan and checks every line shown here against it.
|
// init `storebound init` in an empty folder (the clock prefix left out)
|
||||||
|
// plan `storebound release plan 1.0.0` in that folder, the stores answered by tests/helpers/teaser-store-mock.ts
|
||||||
|
// (a brand-new app record: nothing on either store yet); the "-> fix" lines left out
|
||||||
|
// products `storebound play products --dry` and `storebound catalog diff` in that folder with two products added
|
||||||
|
// to the config, the same store double (before: nothing on the stores; after: both products on both)
|
||||||
|
// forms the declarations proposal of `storebound scan` (tests/fixtures/scan/teaser) and the Data safety
|
||||||
|
// answer count of `storebound check`
|
||||||
|
// rejections `storebound scan` of tests/fixtures/scan/teaser and, after the fixes, of teaser-fixed
|
||||||
|
// The store text is examples/demo-game/store/shots/copy.json, the screenshots its real renders (render.ts copies
|
||||||
|
// them), the desktop frames the app in fixture mode (desktop.ts). The plain reasons under the findings and the
|
||||||
|
// callouts are annotations, set apart from the terminal text.
|
||||||
|
|
||||||
export const BPM = 128;
|
|
||||||
export const BEAT = 60 / BPM; // 0.46875 s
|
|
||||||
export const BAR = BEAT * 4; // 1.875 s
|
|
||||||
export const FPS = 30;
|
export const FPS = 30;
|
||||||
export const B = n => n * BEAT; // beats -> seconds
|
/** 16:9 only: the master; render.ts also makes the 1280x720 web version from it. */
|
||||||
export const BEATS = 78; // 19.5 bars
|
export const FORMAT = { w: 1920, h: 1080 };
|
||||||
export const DURATION = B(BEATS); // 36.5625 s
|
|
||||||
|
|
||||||
/** Scenes in beats (start, end). Cuts: the hook's hard cut, then whips and masks on the beat. */
|
/** Scenes in seconds. Each holds 6-7 s; the next one dissolves in over DISSOLVE s centred on the cut. */
|
||||||
export const SCENES = [
|
export const SCENES = [
|
||||||
{ id: 'hook', from: 0, to: 7, in: null }, // inbox, rejection mails stack, "Rejected. Again."
|
{ id: 'hook', start: 0, end: 6 },
|
||||||
{ id: 'scan', from: 7, to: 24, in: 'hard' }, // black, the terminal types `storebound scan`, the output
|
{ id: 'init', start: 6, end: 12 },
|
||||||
{ id: 'fixed', from: 24, to: 30, in: 'whip-left' }, // the re-scan after the fixes: reds flip green, 0 blockers
|
{ id: 'plan', start: 12, end: 19 },
|
||||||
{ id: 'shots', from: 30, to: 36, in: 'iris' }, // store screenshots wall
|
{ id: 'store', start: 19, end: 26 },
|
||||||
{ id: 'decl', from: 36, to: 42, in: 'whip-up' }, // declarations proposal -> Data safety answers
|
{ id: 'products', start: 26, end: 33 },
|
||||||
{ id: 'desk1', from: 42, to: 48, in: 'wipe' }, // desktop: Portfolio across studios
|
{ id: 'forms', start: 33, end: 40 },
|
||||||
{ id: 'desk2', from: 48, to: 54, in: 'whip-left' }, // desktop: release timeline, rollout to 20%
|
{ id: 'rejections', start: 40, end: 47 },
|
||||||
{ id: 'desk3', from: 54, to: 60, in: 'whip-left' }, // desktop: Checks, rejection risks turn green
|
{ id: 'desktop', start: 47, end: 54 },
|
||||||
{ id: 'more', from: 60, to: 66, in: 'whip-left' }, // montage: api coverage · play build --dry · console fill --dry
|
{ id: 'submit', start: 54, end: 60 },
|
||||||
{ id: 'submit', from: 66, to: 72, in: 'zoom' }, // "It never presses Submit. You do."
|
|
||||||
{ id: 'brand', from: 72, to: 78, in: 'iris' }, // logo, storebound.dev, platforms
|
|
||||||
].map(s => ({ ...s, start: B(s.from), end: B(s.to) }));
|
|
||||||
export const scene = id => SCENES.find(s => s.id === id);
|
|
||||||
/** Transition length (seconds) per kind; the incoming scene starts at the cut, the outgoing one leaves before it. */
|
|
||||||
export const TRANS = { hard: 0, 'whip-left': 0.34, 'whip-up': 0.34, iris: 0.42, wipe: 0.42, zoom: 0.36 };
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Captions: one display font, at most 7 words. at / to in seconds (absolute). *word* = highlighted.
|
|
||||||
* Every caption holds at least 1.2 s (tests/teaser.test.ts).
|
|
||||||
*/
|
|
||||||
export const CAPTIONS = [
|
|
||||||
{ id: 'rejected', at: B(3), to: B(7), lines: ['*Rejected.*', 'Again.'], hl: 'red', big: true, word: [B(3), B(4)] },
|
|
||||||
{ id: 'reads', at: B(10.5), to: B(16), lines: ['It reads', 'your project.'] },
|
|
||||||
{ id: 'finds', at: B(16), to: B(24), lines: ['Finds the rejections', 'before *Apple* does.'] },
|
|
||||||
{ id: 'fixed', at: B(24), to: B(30), lines: ['Fix it.', 'Scan *again.*'], hl: 'green' },
|
|
||||||
{ id: 'shots', at: B(30), to: B(36), lines: ['*200* store screenshots.', 'One command.'] },
|
|
||||||
{ id: 'decl', at: B(36), to: B(42), lines: ['*764* answers,', 'read from your code.'] },
|
|
||||||
{ id: 'desk1', at: B(42), to: B(48), lines: ['Every app.', 'Every *studio.*'] },
|
|
||||||
{ id: 'desk2', at: B(48), to: B(54), lines: ['Both stores.', 'One *timeline.*'] },
|
|
||||||
{ id: 'desk3', at: B(54), to: B(60), lines: ['Risks turn', '*green.*'], hl: 'green' },
|
|
||||||
{ id: 'more', at: B(60), to: B(66), lines: ['Every *endpoint.*', 'Build, upload, fill the forms.'] },
|
|
||||||
{ id: 'submit', at: B(66.5), to: B(72), lines: ['It never presses *Submit.*', 'You do.'] },
|
|
||||||
];
|
];
|
||||||
|
export const DURATION = SCENES.at(-1).end;
|
||||||
|
export const DISSOLVE = 0.6;
|
||||||
|
export const scene = id => SCENES.find(s => s.id === id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When each caption is fully readable (every word in, before its exit), as teaser.js animates it: words pop in 0.07 s
|
* One slow camera move per scene, over the whole scene: from -> to, eased in and out.
|
||||||
* apart over 0.34 s (the hook's two words slam in over 0.2 s at their beats); the exit fades over the last 0.16 s
|
* z = zoom, x / y = pan in px (applied to the scene's content, never to the caption).
|
||||||
* (the hook ends on a hard cut instead).
|
|
||||||
*/
|
*/
|
||||||
|
export const CAMERA = {
|
||||||
|
hook: { from: { z: 1.0, x: 0, y: 0 }, to: { z: 1.05, x: 0, y: 6 } },
|
||||||
|
init: { from: { z: 1.0, x: 20, y: 0 }, to: { z: 1.06, x: -40, y: 0 } },
|
||||||
|
plan: { from: { z: 1.0, x: 0, y: 0 }, to: { z: 1.05, x: 0, y: -24 } },
|
||||||
|
store: { from: { z: 1.02, x: 40, y: 0 }, to: { z: 1.02, x: -40, y: 0 } },
|
||||||
|
products: { from: { z: 1.0, x: 0, y: 0 }, to: { z: 1.06, x: 0, y: -10 } },
|
||||||
|
forms: { from: { z: 1.02, x: 30, y: 0 }, to: { z: 1.02, x: -30, y: 0 } },
|
||||||
|
rejections: { from: { z: 1.0, x: 0, y: 0 }, to: { z: 1.05, x: 0, y: -12 } },
|
||||||
|
desktop: { from: { z: 1.0, x: 0, y: 0 }, to: { z: 1.0, x: 0, y: 0 } }, // the push happens inside the app window
|
||||||
|
submit: { from: { z: 1.0, x: 0, y: 0 }, to: { z: 1.05, x: 0, y: 0 } },
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Captions: one per scene, at the top. *word* = highlighted. Lines are set as written. */
|
||||||
|
export const CAPTIONS = [
|
||||||
|
{ id: 'hook', lines: ['Your app is done. The stores are *not.*'], hl: 'red' },
|
||||||
|
{ id: 'init', lines: ['storebound takes it from an *empty folder.*'] },
|
||||||
|
{ id: 'plan', lines: ['You ask once. It plans *every step.*'] },
|
||||||
|
{ id: 'store', lines: ['Store text and screenshots.', '*Every language, every size.*'] },
|
||||||
|
{ id: 'products', lines: ['In-app products on both stores,', 'priced in *175 countries.*'] },
|
||||||
|
{ id: 'forms', lines: ['The forms, answered from your code.', 'It asks what it *can\'t know.*'] },
|
||||||
|
{ id: 'rejections', lines: ['It catches rejections *before Apple does.*'], hl: 'green' },
|
||||||
|
{ id: 'desktop', lines: ['Both stores, one view. *Ready for review.*'] },
|
||||||
|
{ id: 'submit', lines: ['You press *Submit.* That\'s it.'] },
|
||||||
|
];
|
||||||
|
/** Caption fade: in over CAP_IN from CAP_DELAY after the scene starts; out over CAP_OUT, ending CAP_END before it ends. */
|
||||||
|
export const CAP_DELAY = 0.15, CAP_IN = 0.4, CAP_OUT = 0.4, CAP_END = 0.1;
|
||||||
|
/** When each caption is fully on screen (tests: at least 4 s). */
|
||||||
export function captionTimes() {
|
export function captionTimes() {
|
||||||
return CAPTIONS.map(c => {
|
return CAPTIONS.map(c => {
|
||||||
const words = c.lines.join(' ').replace(/\*/g, '');
|
const s = scene(c.id);
|
||||||
const from = c.big ? c.word[c.word.length - 1] + 0.2 : c.at + 0.34 + 0.07 * (words.split(' ').length - 1);
|
const at = s.start + CAP_DELAY, from = at + CAP_IN, to = s.end - CAP_END - CAP_OUT, gone = s.end - CAP_END;
|
||||||
const to = c.big ? c.to : c.to - 0.16;
|
return { id: c.id, text: c.lines.join(' ').replace(/\*/g, ''), at, from, to, gone, hold: to - from };
|
||||||
return { id: c.id, words, count: words.split(' ').length, at: c.at, from, to, hold: to - from };
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------- hook: a generic, made-up inbox (no real product, no real names or addresses) ----------
|
// ---------- 1 hook: the app is done, the stores' to-do list, one rejection mail ----------
|
||||||
export const MAIL_SUBJECT = "There's an issue with your Prism Puddle submission";
|
export const APP_NAME = 'Prism Puddle';
|
||||||
export const MAILS = [
|
/** The stores' to-do list (line by line at reading speed). at = seconds into the scene. */
|
||||||
{ at: B(0.5), date: 'Mon', guideline: 'Guideline 2.1 · Information Needed' },
|
export const TODO = [
|
||||||
{ at: B(1.25), date: 'Wed', guideline: 'Guideline 5.1.1(v) · Data Collection and Storage' },
|
{ at: 0.6, text: '2 store consoles' },
|
||||||
{ at: B(2), date: '9:41 AM', guideline: 'Guideline 4.8 · Login Services' },
|
{ at: 1.25, text: 'dozens of forms' },
|
||||||
|
{ at: 1.9, text: '7 screenshot sizes × 14 languages' },
|
||||||
|
{ at: 2.6, text: 'prices in 175 countries' },
|
||||||
];
|
];
|
||||||
/** Earlier, unrelated mails under the rejections (generic, fictional). */
|
/** A generic, made-up inbox row (no mail-app branding, no real names or addresses): fades in over MAIL_IN from `at`,
|
||||||
export const OLD_MAILS = [
|
* then holds to the cut. */
|
||||||
{ from: 'Team Calendar', subject: 'Sprint review moved to Thursday', preview: 'The demo slot is now 3 pm. Bring the build.', date: 'Sun' },
|
export const MAIL_IN = 0.5;
|
||||||
{ from: 'Build Server', subject: 'Prism Puddle 1.0 (12) uploaded', preview: 'Processing finished. The build is ready to submit.', date: 'Sat' },
|
export const MAIL = { at: 3.3, from: 'App Store Connect', date: '9:41 AM', subject: "There's an issue with your Prism Puddle submission", guideline: 'Guideline 2.1 · Information Needed' };
|
||||||
{ from: 'Design', subject: 'Final icon + screenshots', preview: 'All sizes exported, see the shared folder.', date: 'Fri' },
|
|
||||||
|
// ---------- 2 init: an empty folder, `storebound init` ----------
|
||||||
|
export const FOLDER = 'my-app';
|
||||||
|
export const INIT_CMD = 'bunx storebound init';
|
||||||
|
export const INIT_TYPE_AT = 0.5, INIT_CPS = 13, INIT_OUT_AT = 2.5, INIT_STEP = 0.22;
|
||||||
|
/** Real output of `storebound init` (clock prefix left out). file = the file the line creates (the folder list). */
|
||||||
|
export const INIT_LINES = [
|
||||||
|
'[init] create storebound.config.ts',
|
||||||
|
'[init] create store/listing.md',
|
||||||
|
'[init] create store/appstore.md',
|
||||||
|
'[init] create store/shots/copy.json',
|
||||||
|
'[init] create store/app-privacy.md',
|
||||||
|
'[init] create store/declarations.md',
|
||||||
|
'[init] create store/privacy-policy.html',
|
||||||
|
'[init] create .storebound/credentials.json',
|
||||||
|
'[init] create .storebound/testers.csv',
|
||||||
|
'[init] .gitignore: added .storebound/',
|
||||||
];
|
];
|
||||||
|
|
||||||
// ---------- terminal: `storebound scan` ----------
|
// ---------- 3 plan: the agent prompt, `storebound release plan` ----------
|
||||||
export const CMD = 'storebound scan';
|
export const PROMPT = 'Get my app ready for both stores.';
|
||||||
export const TYPE_AT = B(7.6);
|
export const PROMPT_AT = 0.3, PROMPT_CPS = 26;
|
||||||
export const TYPE_CPS = 15;
|
export const PLAN_CMD = 'storebound release plan 1.0.0';
|
||||||
export const ENTER_AT = B(10);
|
export const PLAN_CMD_AT = 1.9, PLAN_AT = 2.3, PLAN_STEP = 0.2;
|
||||||
|
/** Real lines of the plan (a brand-new app record on both stores); the "-> fix" lines and some steps left out. */
|
||||||
/** Real output lines (tests/teaser.test.ts checks each against the scan of the fixture). at = seconds (absolute). */
|
export const PLAN_LINES = [
|
||||||
export const SCAN_HEAD = [
|
'Example App 1.0.0',
|
||||||
{ at: B(10.15), text: 'storebound scan · storebound.config.ts', kind: 'head' },
|
' both stores (fix first):',
|
||||||
{ at: B(10.4), text: 'stack: iOS (native) · targets: iOS · 11 files', kind: 'dim' },
|
' 1. CONFIG App Review needs a demo account (sign-in required) · add reviewDemoAccount to .storebound/credentials.json · review-access skill',
|
||||||
];
|
' 2. CONFIG missing file: store/icon/icon.png',
|
||||||
export const SDK_AT = B(11);
|
' App Store: not on the store',
|
||||||
export const SDKS = [
|
' 5. STORE 1.0.0 is not on App Store yet: upload a build (Xcode / Transporter), then create the version with its texts',
|
||||||
{ at: B(11.5), name: 'Google AdMob', what: 'ads, tracking-capable', dep: 'CocoaPods Google-Mobile-Ads-SDK 11.10.0', where: 'Podfile.lock:2' },
|
' 6. BLOCKER no App Store version being prepared',
|
||||||
{ at: B(12.25), name: 'Google Sign-In', what: 'auth', dep: 'CocoaPods GoogleSignIn 7.1.0', where: 'Podfile.lock:3' },
|
' 12. BLOCKER no app price schedule',
|
||||||
];
|
' Google Play: not on the store',
|
||||||
export const RISKS_AT = B(13.25);
|
' 16. STORE 1.0.0 is not on Google Play yet: upload the AAB to a testing track',
|
||||||
export const RISKS_LINE = 'Rejection risks: 2 blocker, 3 high, 0 medium, 0 low';
|
' 20. BLOCKER no release on any track',
|
||||||
/** The five findings. fix = a verbatim fragment of the real fix (the full text is in the CLI output). */
|
|
||||||
export const FINDINGS = [
|
|
||||||
{ at: B(14), sev: 'BLOCKER', guideline: '2.1(a)', title: 'Sign-in is required but there is no demo account for App Review',
|
|
||||||
where: 'storebound.config.ts:12', fix: 'Create a demo account that sees every feature', skill: 'review-access', short: 'Demo account for App Review' },
|
|
||||||
{ at: B(16), sev: 'BLOCKER', guideline: '5.1.1(v)', title: 'Accounts can be created but no in-app account deletion was found',
|
|
||||||
where: 'Planner/LoginView.swift:11', fix: 'Add "Delete account" in the app', skill: 'account-deletion', short: 'In-app account deletion' },
|
|
||||||
{ at: B(18), sev: 'HIGH', guideline: '4.8', title: 'Third-party login (Google / Facebook / ...) without Sign in with Apple or another equivalent login option',
|
|
||||||
where: 'Planner/LoginView.swift:9', fix: 'Offer Sign in with Apple', skill: 'review-rejections', short: 'Sign in with Apple' },
|
|
||||||
{ at: B(20), sev: 'HIGH', guideline: '3.1.1', title: 'Restorable purchases (non-consumables or subscriptions) but no Restore Purchases path was found',
|
|
||||||
where: 'storebound.config.ts:16', fix: 'Add a visible "Restore Purchases" button', skill: 'store-iap-setup', short: 'Restore Purchases' },
|
|
||||||
{ at: B(22), sev: 'HIGH', guideline: '5.1.2(i)', title: 'Tracking-capable code without App Tracking Transparency (Google AdMob, IDFA)',
|
|
||||||
where: 'Planner/Ads.swift:7', fix: 'add NSUserTrackingUsageDescription and request ATT before the SDKs start', skill: 'ads-mediation-checks', short: 'App Tracking Transparency' },
|
|
||||||
];
|
];
|
||||||
|
/** Steps in the whole plan (the numbered lines of the real output). */
|
||||||
|
export const PLAN_STEPS = 25;
|
||||||
|
export const PLAN_PILL = `*${PLAN_STEPS}* steps · both stores · in fix order`;
|
||||||
|
|
||||||
// ---------- fixed: the re-scan of the fixed copy (tests/fixtures/scan/teaser-fixed) ----------
|
// ---------- 4 store: listing text in every language, screenshots in every size ----------
|
||||||
export const RESCAN_CMD = 'storebound scan';
|
/** examples/demo-game/store/shots/copy.json, the hero title per language. */
|
||||||
export const RESCAN_TYPE_AT = B(24.3);
|
export const COPY_FILE = 'store/shots/copy.json';
|
||||||
export const FLIP_AT = [B(25.5), B(26), B(26.5), B(27), B(27.5)]; // each red row turns green
|
export const COPY = [
|
||||||
export const RESCAN_LINE = 'Rejection risks: 0 blocker, 0 high, 0 medium, 0 low';
|
{ lang: 'en', title: ['Catch every', 'color drop!'] },
|
||||||
export const RESCAN_NONE = 'none found in the project files and config';
|
{ lang: 'tr', title: ['Renkli damlaları', 'yakala!'] },
|
||||||
export const RESCAN_LINE_AT = B(28);
|
{ lang: 'ja', title: ['カラフルなしずくを', 'キャッチ!'] },
|
||||||
|
{ lang: 'ar', title: ['التقط كل', 'قطرة ملوّنة!'], rtl: true },
|
||||||
// ---------- payoff ----------
|
];
|
||||||
export const SHOTS_TOTAL = 200; // examples/demo-game: 4 languages x 2 sets x 25 store images (+ 8 extra)
|
export const COPY_AT = 0.5, COPY_STEP = 0.5;
|
||||||
|
/** The demo game's renders, one column per store size (cli/shots/lib.ts SIZES), one row per language. */
|
||||||
|
export const SHOT_SIZES = [
|
||||||
|
{ id: 'ios69', label: 'iPhone\n6.9″' },
|
||||||
|
{ id: 'ios65', label: 'iPhone\n6.5″' },
|
||||||
|
{ id: 'ipad13', label: 'iPad\n13″' },
|
||||||
|
{ id: 'play', label: 'Play\nphone' },
|
||||||
|
{ id: 'tab7', label: 'Play\n7″ tab' },
|
||||||
|
{ id: 'tab10', label: 'Play\n10″ tab' },
|
||||||
|
{ id: 'feature', label: 'Play\nfeature graphic' },
|
||||||
|
];
|
||||||
|
export const SHOT_LANGS = COPY.map(c => c.lang);
|
||||||
|
export const SHOTS_AT = 0.9, SHOTS_STEP = 0.38;
|
||||||
export const SHOTS_CMD = 'storebound shots render';
|
export const SHOTS_CMD = 'storebound shots render';
|
||||||
export const DECL_TOTAL = 764; // Play Data safety CSV rows built from the config (`storebound check`)
|
export const SHOTS_PILL = `*${SHOT_SIZES.length}* sizes × *${COPY.length}* languages`;
|
||||||
/** Real lines of the declarations proposal (scan of the teaser fixture). */
|
|
||||||
export const DECL_LINES = [
|
|
||||||
{ area: 'Data safety', what: 'PSL_DEVICE_ID', value: 'collect: advertising, analytics, fraud', where: 'Podfile.lock:2' },
|
|
||||||
{ area: 'Data safety', what: 'PSL_APPROX_LOCATION', value: 'collect: advertising, analytics, fraud', where: 'Podfile.lock:2' },
|
|
||||||
{ area: 'Data safety', what: 'PSL_EMAIL', value: 'collect: account, functionality', where: 'Podfile.lock:3' },
|
|
||||||
{ area: 'Data safety', what: 'PSL_USER_ACCOUNT', value: 'collect: account, functionality', where: 'Podfile.lock:3' },
|
|
||||||
];
|
|
||||||
export const DECL_ASK = 'ask owner encryptedInTransit';
|
|
||||||
export const DATA_SAFETY_ROWS = [
|
|
||||||
'Device or other IDs', 'Approximate location', 'App interactions', 'Diagnostics', 'Name', 'Email address', 'User IDs',
|
|
||||||
];
|
|
||||||
|
|
||||||
// ---------- desktop: real frames (desktop.ts), camera from -> to (focus as fractions of the 1280 x 800 frame) ----------
|
// ---------- 5 products: `play products --dry`, then `catalog diff` ----------
|
||||||
|
/** Real output (clock prefix and the "(0s)" timer left out). at = seconds into the scene. */
|
||||||
|
export const PRODUCT_LINES = [
|
||||||
|
{ at: 0.4, text: '$ storebound play products --dry', cmd: true },
|
||||||
|
{ at: 0.9, text: '[play] 1/2 com.example.app.no_ads: would create · 174 regions · 2 listings (dry)' },
|
||||||
|
{ at: 1.2, text: '[play] 2/2 com.example.app.gems_100: would create · 174 regions · 2 listings (dry)' },
|
||||||
|
{ at: 1.5, text: '[play] products checked (dry run, nothing written)' },
|
||||||
|
{ at: 2.2, text: '$ storebound catalog diff', cmd: true },
|
||||||
|
{ at: 2.7, text: 'ok [apple] com.example.app.gems_100: consumable, 175 region prices, READY_TO_SUBMIT' },
|
||||||
|
{ at: 3.0, text: 'ok [play] com.example.app.gems_100: consumable, 174 region prices, ACTIVE' },
|
||||||
|
{ at: 3.3, text: 'ok [apple] com.example.app.no_ads: non_consumable, 175 region prices, READY_TO_SUBMIT' },
|
||||||
|
{ at: 3.6, text: 'ok [play] com.example.app.no_ads: non_consumable, 174 region prices, ACTIVE' },
|
||||||
|
{ at: 4.0, text: '[catalog] 2 catalog items: 0 mismatch(es), 0 warning(s), 0 price difference(s) between the stores' },
|
||||||
|
];
|
||||||
|
export const PRODUCTS_PILL = { at: 4.5, text: '*175* App Store regions · *174* Google Play regions · parity *✓*' };
|
||||||
|
|
||||||
|
// ---------- 6 forms: the declarations proposal from the scan, then the Data safety answers ----------
|
||||||
|
/** Real lines of the proposal (scan of the teaser fixture). */
|
||||||
|
export const DECL_LINES = [
|
||||||
|
{ what: 'PSL_DEVICE_ID', value: 'collect: advertising, analytics, fraud', where: 'Podfile.lock:2' },
|
||||||
|
{ what: 'PSL_APPROX_LOCATION', value: 'collect: advertising, analytics, fraud', where: 'Podfile.lock:2' },
|
||||||
|
{ what: 'PSL_EMAIL', value: 'collect: account, functionality', where: 'Podfile.lock:3' },
|
||||||
|
{ what: 'PSL_USER_ACCOUNT', value: 'collect: account, functionality', where: 'Podfile.lock:3' },
|
||||||
|
];
|
||||||
|
export const DECL_ASK = 'ask owner encryptedInTransit: ? · all traffic over HTTPS / TLS?';
|
||||||
|
export const DECL_AT = 0.5, DECL_STEP = 0.4, ASK_AT = 2.3;
|
||||||
|
/** Play Data safety form rows the detected answers fill (Play's own labels for the PSL_* types above and the rest). */
|
||||||
|
export const DATA_SAFETY_ROWS = ['Device or other IDs', 'Approximate location', 'App interactions', 'Diagnostics', 'Name', 'Email address', 'User IDs'];
|
||||||
|
export const FORM_AT = 2.9, FORM_STEP = 0.2;
|
||||||
|
/** Data safety CSV rows `storebound check` builds from the config. */
|
||||||
|
export const DECL_TOTAL = 764;
|
||||||
|
export const FORMS_PILL = { at: 4.5, text: 'Data safety answers' };
|
||||||
|
|
||||||
|
// ---------- 7 rejections: three findings with a plain reason each, then fixed ----------
|
||||||
|
export const SCAN_CMD = 'storebound scan';
|
||||||
|
export const RISKS_LINE = 'Rejection risks: 2 blocker, 3 high, 0 medium, 0 low';
|
||||||
|
/** Three of the five findings (real text); why = a plain-English annotation, not CLI output. */
|
||||||
|
export const FINDINGS = [
|
||||||
|
{ at: 1.1, sev: 'BLOCKER', guideline: '2.1(a)', title: 'Sign-in is required but there is no demo account for App Review', where: 'storebound.config.ts:12',
|
||||||
|
why: 'Apple rejects sign-in apps without a demo account.' },
|
||||||
|
{ at: 1.9, sev: 'BLOCKER', guideline: '5.1.1(v)', title: 'Accounts can be created but no in-app account deletion was found', where: 'Planner/LoginView.swift:11',
|
||||||
|
why: 'Apps that create accounts must let people delete them.' },
|
||||||
|
{ at: 2.7, sev: 'HIGH', guideline: '5.1.2(i)', title: 'Tracking-capable code without App Tracking Transparency (Google AdMob, IDFA)', where: 'Planner/Ads.swift:7',
|
||||||
|
why: 'Ads that track people must ask permission first.' },
|
||||||
|
];
|
||||||
|
/** Each finding turns green (fixed), then the re-scan of the fixed copy (tests/fixtures/scan/teaser-fixed). */
|
||||||
|
export const FIX_AT = [4.0, 4.35, 4.7];
|
||||||
|
export const RESCAN_AT = 5.2;
|
||||||
|
export const RESCAN_LINE = 'Rejection risks: 0 blocker, 0 high, 0 medium, 0 low';
|
||||||
|
|
||||||
|
// ---------- 8 desktop: the release timeline (both stores), then Store readiness: no blockers ----------
|
||||||
|
/** Real frames (desktop.ts). The camera pushes from the timeline to the readiness card; the frames dissolve between. */
|
||||||
export const DESKTOP = {
|
export const DESKTOP = {
|
||||||
desk1: { frame: 'portfolio', from: { f: [0.5, 0.5], z: 1.0 }, to: { f: [0.62, 0.52], z: 1.12 },
|
frames: ['releases', 'ready'],
|
||||||
cursor: [[0.6, 'off'], [1.25, 'studios']], callout: { at: 1.35, target: 'studios', text: '3 studios · 2 stores' } },
|
swap: [3.1, 3.8],
|
||||||
desk2: { frame: 'releases', empty: 'releases-empty', from: { f: [0.55, 0.5], z: 1.0 }, to: { f: [0.72, 0.62], z: 1.22 },
|
cam: { from: { f: [0.56, 0.42], z: 1.0 }, to: { f: [0.8, 0.4], z: 1.22 } },
|
||||||
cursor: [[0.5, 'off'], [1.15, 'roll']], fill: [1.1, 2.0], callout: { at: 1.3, target: 'roll', text: 'Rollout · 20%' } },
|
callouts: [
|
||||||
desk3: { frame: 'checks', clean: 'checks-clean', from: { f: [0.55, 0.55], z: 1.0 }, to: { f: [0.55, 0.6], z: 1.14 },
|
{ at: 1.1, until: 3.0, target: 'timeline', text: 'App Store + Google Play, one track' },
|
||||||
cursor: [[0.5, 'off'], [1.0, 'scanAgain']], flip: 1.25, callout: { at: 1.55, target: 'scanClean', text: '0 rejection risks' } },
|
{ at: 4.3, until: 7, target: 'readyEmpty', text: 'Validate: 0 blockers on both', green: true },
|
||||||
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
// ---------- more: a montage of real CLI output, three panels, two cuts on the beat ----------
|
// ---------- 9 submit + end card ----------
|
||||||
/**
|
export const SUBMIT = { hover: 1.5, logoAt: 3.0, logoIn: 0.8 };
|
||||||
* Real output, trimmed (tests/teaser.test.ts runs each command and checks every line):
|
|
||||||
* api coverage in the repo; the API revision dates in parentheses are left out
|
|
||||||
* play build --dry in a throwaway Capacitor project (example.com config); the clock and "[build]" prefixes are left out
|
|
||||||
* console fill examples/demo-app; the "(dataSafety.…)" source column is left out
|
|
||||||
* at = the panel's cut (seconds, absolute); stat = the pill under the card.
|
|
||||||
*/
|
|
||||||
export const MORE = [
|
|
||||||
{ at: B(60), cmd: 'storebound api coverage', sub: 'App Store Connect · Google Play',
|
|
||||||
lines: [
|
|
||||||
'App Store Connect API 4.5.1: 1303 operations',
|
|
||||||
'Google Play Android Developer API v3: 145 operations',
|
|
||||||
'Google Play Developer Reporting API v1beta1: 25 operations',
|
|
||||||
],
|
|
||||||
stat: { text: '*1303* App Store Connect + *170* Google Play endpoints' } },
|
|
||||||
{ at: B(62), cmd: 'storebound play build --dry --version-code 12', sub: 'plan',
|
|
||||||
lines: [
|
|
||||||
'capacitor: android :app:bundleRelease, versionCode 12',
|
|
||||||
"signing: the project's own signingConfig",
|
|
||||||
'would run (in android): ./gradlew :app:bundleRelease',
|
|
||||||
'build planned (dry run)',
|
|
||||||
],
|
|
||||||
stat: { text: 'Dry run first. *Always.*' } },
|
|
||||||
{ at: B(64), cmd: 'storebound console fill apple-app-privacy --dry', sub: 'App Privacy',
|
|
||||||
lines: [
|
|
||||||
'[ok] Data type: Contact Info > Email Address: Yes',
|
|
||||||
'[ok] Data type: Identifiers > User ID: Yes',
|
|
||||||
'[ok] Data type: Diagnostics > Crash Data: Yes',
|
|
||||||
'[check] Data type: Usage Data > Advertising Data: (you decide)',
|
|
||||||
],
|
|
||||||
stat: { text: 'Fills it in. *You* press Publish.' } },
|
|
||||||
];
|
|
||||||
/** The two cuts inside the montage (on the beat). */
|
|
||||||
export const MORE_CUTS = MORE.slice(1).map(p => p.at);
|
|
||||||
|
|
||||||
// ---------- end ----------
|
|
||||||
export const SUBMIT_HOVER = B(67.5); // the cursor stops on the button, it never clicks
|
|
||||||
export const URL = 'storebound.dev';
|
export const URL = 'storebound.dev';
|
||||||
export const PLATFORMS = 'Open source · macOS · Windows · Linux';
|
export const TAGLINE = 'Open source · CLI · Desktop app';
|
||||||
|
|
||||||
// ---------- sound cues (music.js) ----------
|
// ---------- sound cues (music.js) ----------
|
||||||
/** Every cut that gets a hit, with the kind of transition (a whoosh leads into whips, masks and zooms). */
|
/** Soft accents: one on every scene change. */
|
||||||
export const CUTS = [...SCENES.slice(1).map(s => ({ t: s.start, kind: s.in, id: s.id })), ...MORE_CUTS.map(t => ({ t, kind: 'cut', id: 'more' }))]
|
export const CUTS = SCENES.slice(1).map(s => ({ t: s.start, id: s.id }));
|
||||||
.sort((a, b) => a.t - b.t);
|
/** Gentle ticks: list items, files, plan lines, products, form rows, findings (low), fixes (bright). */
|
||||||
/** Ticks: mails landing, findings landing, green flips, callouts. */
|
export function ticks() {
|
||||||
export const TICKS = [
|
const at = id => scene(id).start;
|
||||||
...MAILS.map(m => ({ t: m.at, kind: 'mail' })),
|
return [
|
||||||
...SDKS.map(s => ({ t: s.at, kind: 'soft' })),
|
...TODO.map(x => ({ t: at('hook') + x.at, kind: 'soft' })),
|
||||||
{ t: RISKS_AT, kind: 'soft' },
|
{ t: at('hook') + MAIL.at, kind: 'mail' },
|
||||||
...FINDINGS.map(f => ({ t: f.at, kind: 'bad' })),
|
...INIT_LINES.map((_, i) => ({ t: at('init') + INIT_OUT_AT + 0.2 + i * INIT_STEP, kind: 'tiny' })),
|
||||||
...FLIP_AT.map((t, i) => ({ t, kind: 'good', step: i })),
|
...PLAN_LINES.map((_, i) => ({ t: at('plan') + PLAN_AT + i * PLAN_STEP, kind: 'tiny' })),
|
||||||
...Object.entries(DESKTOP).map(([id, d]) => ({ t: scene(id).start + d.callout.at, kind: 'pop' })),
|
...COPY.map((_, i) => ({ t: at('store') + COPY_AT + i * COPY_STEP, kind: 'soft' })),
|
||||||
...MORE.map(p => ({ t: p.at + 0.3, kind: 'pop' })),
|
...PRODUCT_LINES.filter(l => !l.cmd).map(l => ({ t: at('products') + l.at, kind: 'tiny' })),
|
||||||
|
{ t: at('products') + PRODUCTS_PILL.at, kind: 'good', step: 2 },
|
||||||
|
...DECL_LINES.map((_, i) => ({ t: at('forms') + DECL_AT + i * DECL_STEP, kind: 'tiny' })),
|
||||||
|
{ t: at('forms') + ASK_AT, kind: 'ask' },
|
||||||
|
...DATA_SAFETY_ROWS.map((_, i) => ({ t: at('forms') + FORM_AT + i * FORM_STEP, kind: 'tiny' })),
|
||||||
|
...FINDINGS.map(f => ({ t: at('rejections') + f.at, kind: 'low' })),
|
||||||
|
...FIX_AT.map((t, i) => ({ t: at('rejections') + t, kind: 'good', step: i })),
|
||||||
|
...DESKTOP.callouts.map(c => ({ t: at('desktop') + c.at, kind: 'soft' })),
|
||||||
];
|
];
|
||||||
/** Seconds at which each typed character lands (key clicks). */
|
}
|
||||||
|
/** Seconds at which each typed character lands (soft key clicks). */
|
||||||
export function keyTimes() {
|
export function keyTimes() {
|
||||||
const out = [];
|
const out = [];
|
||||||
for (let i = 0; i < CMD.length; i++) out.push(TYPE_AT + i / TYPE_CPS);
|
for (let i = 0; i < INIT_CMD.length; i++) out.push(scene('init').start + INIT_TYPE_AT + i / INIT_CPS);
|
||||||
for (let i = 0; i < RESCAN_CMD.length; i++) out.push(RESCAN_TYPE_AT + i / 24);
|
for (let i = 0; i < PROMPT.length; i++) out.push(scene('plan').start + PROMPT_AT + i / PROMPT_CPS);
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,626 +1,393 @@
|
||||||
// Teaser picture: every element is set from the time t alone (window.teaser.seek(t)), so frames render
|
// Teaser picture (v4): every element is set from the time t alone (window.teaser.seek(t)), so frames render
|
||||||
// deterministically, in any order. URL: ?w=1080&h=1920 (or 1920x1080) · &t=12.5 to hold a frame · &play=1 to preview.
|
// deterministically, in any order. 16:9 only (1920x1080). URL: &t=12.5 holds a frame, &play=1 previews in real time.
|
||||||
import { B, BEAT, CAPTIONS, captionTimes, CMD, DATA_SAFETY_ROWS, DECL_ASK, DECL_LINES, DECL_TOTAL, DESKTOP, DURATION, ENTER_AT, FINDINGS,
|
import { APP_NAME, ASK_AT, CAMERA, CAP_DELAY, CAP_END, CAP_IN, CAP_OUT, CAPTIONS, captionTimes, COPY, COPY_AT, COPY_FILE, COPY_STEP,
|
||||||
FLIP_AT, FPS, MAIL_SUBJECT, MAILS, MORE, MORE_CUTS, OLD_MAILS, PLATFORMS, RESCAN_CMD, RESCAN_LINE, RESCAN_LINE_AT, RESCAN_NONE, RESCAN_TYPE_AT,
|
DATA_SAFETY_ROWS, DECL_ASK, DECL_AT, DECL_LINES, DECL_STEP, DECL_TOTAL, DESKTOP, DISSOLVE, DURATION, FINDINGS, FIX_AT, FOLDER,
|
||||||
RISKS_AT, RISKS_LINE, SCAN_HEAD, SCENES, SDK_AT, SDKS, SHOTS_TOTAL, SUBMIT_HOVER, TRANS, TYPE_AT, TYPE_CPS, URL, scene } from './script.js';
|
FORM_AT, FORM_STEP, FORMAT, FORMS_PILL, FPS, INIT_CMD, INIT_CPS, INIT_LINES, INIT_OUT_AT, INIT_STEP, INIT_TYPE_AT,
|
||||||
|
MAIL, MAIL_IN, PLAN_AT, PLAN_CMD, PLAN_CMD_AT, PLAN_LINES, PLAN_PILL, PLAN_STEP, PRODUCT_LINES, PRODUCTS_PILL, PROMPT, PROMPT_AT, PROMPT_CPS,
|
||||||
|
RESCAN_AT, RESCAN_LINE, RISKS_LINE, SCAN_CMD, SCENES, SHOT_LANGS, SHOT_SIZES, SHOTS_AT, SHOTS_CMD, SHOTS_PILL, SHOTS_STEP,
|
||||||
|
SUBMIT, TAGLINE, TODO, URL, scene } from './script.js';
|
||||||
|
|
||||||
const q = new URLSearchParams(location.search);
|
const q = new URLSearchParams(location.search);
|
||||||
const W = Number(q.get('w') ?? 1080), H = Number(q.get('h') ?? 1920);
|
const W = FORMAT.w, H = FORMAT.h;
|
||||||
const V = H > W;
|
|
||||||
const $ = s => document.querySelector(s);
|
const $ = s => document.querySelector(s);
|
||||||
const stage = $('#stage');
|
const stage = $('#stage');
|
||||||
stage.style.width = `${W}px`; stage.style.height = `${H}px`;
|
stage.style.width = `${W}px`; stage.style.height = `${H}px`;
|
||||||
document.body.classList.add(V ? 'v' : 'h');
|
|
||||||
|
|
||||||
// ---------- easing ----------
|
// ---------- helpers ----------
|
||||||
const clamp = (x, a = 0, b = 1) => Math.min(b, Math.max(a, x));
|
const clamp = (x, a = 0, b = 1) => Math.min(b, Math.max(a, x));
|
||||||
const prog = (t, a, d) => (d <= 0 ? (t >= a ? 1 : 0) : clamp((t - a) / d));
|
const prog = (t, a, d) => (d <= 0 ? (t >= a ? 1 : 0) : clamp((t - a) / d));
|
||||||
const eoc = p => 1 - Math.pow(1 - p, 3);
|
const eoc = p => 1 - Math.pow(1 - p, 3);
|
||||||
const eoq = p => 1 - Math.pow(1 - p, 5);
|
|
||||||
const eic = p => p * p * p;
|
|
||||||
const eio = p => (p < 0.5 ? 4 * p * p * p : 1 - Math.pow(-2 * p + 2, 3) / 2);
|
const eio = p => (p < 0.5 ? 4 * p * p * p : 1 - Math.pow(-2 * p + 2, 3) / 2);
|
||||||
const eob = p => { const c1 = 1.70158, c3 = c1 + 1; return 1 + c3 * Math.pow(p - 1, 3) + c1 * Math.pow(p - 1, 2); };
|
const ess = p => p * p * (3 - 2 * p); // smoothstep: the slow camera moves
|
||||||
const lerp = (a, b, p) => a + (b - a) * p;
|
const lerp = (a, b, p) => a + (b - a) * p;
|
||||||
const esc = s => String(s).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
const esc = s => String(s).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
||||||
const set = (el, k, v) => { if (el.__s?.[k] !== v) { (el.__s ??= {})[k] = v; el.style[k] = v; } };
|
const set = (el, k, v) => { if (el.__s?.[k] !== v) { (el.__s ??= {})[k] = v; el.style[k] = v; } };
|
||||||
const html = (el, v) => { if (el.__h !== v) { el.__h = v; el.innerHTML = v; } };
|
const html = (el, v) => { if (el.__h !== v) { el.__h = v; el.innerHTML = v; } };
|
||||||
const decay = (t, at, d) => (t >= at && t < at + d ? 1 - (t - at) / d : 0);
|
/** *word* -> <b>word</b> (pills) */
|
||||||
|
const bold = s => esc(s).replace(/\*([^*]+)\*/g, '<b>$1</b>');
|
||||||
|
/** A gentle appear: opacity and a small rise. */
|
||||||
|
function appear(el, t, at, d = 0.35, rise = 14) {
|
||||||
|
const p = prog(t, at, d);
|
||||||
|
set(el, 'opacity', String(eoc(p)));
|
||||||
|
set(el, 'transform', `translateY(${((1 - eoc(p)) * rise).toFixed(1)}px)`);
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
function pillAt(el, t, at, base = 'translate(-50%, 0)') {
|
||||||
|
const p = prog(t, at, 0.4);
|
||||||
|
set(el, 'opacity', String(eoc(p)));
|
||||||
|
set(el, 'transform', `${base} translateY(${((1 - eoc(p)) * 16).toFixed(1)}px)`);
|
||||||
|
}
|
||||||
|
|
||||||
/** Layout per format: caption band on top, content below; the bottom ~22% of the vertical frame stays calm. */
|
// ---------- scenes: dissolves and one slow camera move each ----------
|
||||||
const L = V
|
const sceneEls = Object.fromEntries(SCENES.map(s => [s.id, { el: $(`#s-${s.id}`), cam: $(`#s-${s.id} > .cam`) }]));
|
||||||
? { cy: 1010, top: 520, bottom: 1490, margin: 60 }
|
|
||||||
: { cy: 675, top: 300, bottom: 1045, margin: 160 };
|
|
||||||
|
|
||||||
// ---------- scenes and transitions ----------
|
|
||||||
const sceneEls = Object.fromEntries(SCENES.map(s => [s.id, $(`#s-${s.id}`)]));
|
|
||||||
const DIAG = Math.hypot(W, H);
|
|
||||||
/** Visibility, transform, clip and blur of a scene at t, from its own entry and the next scene's entry. */
|
|
||||||
function sceneFx(i, t) {
|
|
||||||
const s = SCENES[i], next = SCENES[i + 1];
|
|
||||||
const enter = s.in, exit = next?.in ?? null;
|
|
||||||
const lead = k => (k && k.startsWith('whip') ? 0.08 : 0);
|
|
||||||
const tail = k => (k === 'iris' || k === 'wipe' ? TRANS[k] : k && k.startsWith('whip') ? 0.08 : 0);
|
|
||||||
if (t < s.start - lead(enter) || t >= s.end + tail(exit)) return null;
|
|
||||||
let tx = 0, ty = 0, sc = 1, blur = 0, op = 1, clip = 'none', dark = 0;
|
|
||||||
// entry
|
|
||||||
if (enter === 'whip-left' || enter === 'whip-up') {
|
|
||||||
const p = prog(t, s.start - 0.08, 0.34), e = eoq(p);
|
|
||||||
if (enter === 'whip-left') tx += (1 - e) * W * 1.05; else ty += (1 - e) * H * 1.05;
|
|
||||||
blur += (1 - eoc(p)) * 26;
|
|
||||||
} else if (enter === 'iris') {
|
|
||||||
const p = prog(t, s.start, TRANS.iris);
|
|
||||||
if (p < 1) clip = `circle(${(eio(p) * DIAG * 0.55).toFixed(1)}px at 50% 50%)`;
|
|
||||||
} else if (enter === 'wipe') {
|
|
||||||
const p = prog(t, s.start, TRANS.wipe);
|
|
||||||
if (p < 1) { const sk = H * 0.35, x = lerp(-sk, W + sk, eio(p)); clip = `polygon(0 0, ${x + sk}px 0, ${x}px 100%, 0 100%)`; }
|
|
||||||
} else if (enter === 'zoom') {
|
|
||||||
const p = prog(t, s.start, TRANS.zoom);
|
|
||||||
sc *= lerp(0.8, 1, eoc(p)); op *= eoc(p); blur += (1 - p) * 12;
|
|
||||||
}
|
|
||||||
// exit
|
|
||||||
if (exit === 'whip-left' || exit === 'whip-up') {
|
|
||||||
const p = prog(t, s.end - 0.22, 0.3), e = eic(p);
|
|
||||||
if (exit === 'whip-left') tx -= e * W * 1.05; else ty -= e * H * 1.05;
|
|
||||||
blur += p * 26;
|
|
||||||
} else if (exit === 'iris' || exit === 'wipe') {
|
|
||||||
const p = prog(t, s.end - 0.1, TRANS[exit] + 0.1);
|
|
||||||
sc *= 1 + 0.07 * eio(p); dark = 0.5 * p;
|
|
||||||
} else if (exit === 'zoom') {
|
|
||||||
const p = prog(t, s.end - 0.26, 0.26);
|
|
||||||
sc *= 1 + 0.8 * eic(p); op *= 1 - eic(p); blur += eic(p) * 16;
|
|
||||||
}
|
|
||||||
return { tx, ty, sc, blur, op, clip, dark };
|
|
||||||
}
|
|
||||||
function scenes(t) {
|
function scenes(t) {
|
||||||
SCENES.forEach((s, i) => {
|
SCENES.forEach((s, i) => {
|
||||||
const el = sceneEls[s.id], fx = sceneFx(i, t);
|
const { el, cam } = sceneEls[s.id];
|
||||||
if (!fx) { set(el, 'opacity', '0'); set(el, 'visibility', 'hidden'); return; }
|
const from = i === 0 ? -1 : s.start - DISSOLVE / 2, until = i === SCENES.length - 1 ? Infinity : s.end + DISSOLVE / 2;
|
||||||
|
if (t < from || t >= until) { set(el, 'visibility', 'hidden'); set(el, 'opacity', '0'); return; }
|
||||||
set(el, 'visibility', 'visible');
|
set(el, 'visibility', 'visible');
|
||||||
set(el, 'opacity', String(fx.op));
|
set(el, 'opacity', String(i === 0 ? 1 : eio(prog(t, from, DISSOLVE))));
|
||||||
set(el, 'transform', `translate(${fx.tx.toFixed(1)}px, ${fx.ty.toFixed(1)}px) scale(${fx.sc.toFixed(4)})`);
|
const c = CAMERA[s.id];
|
||||||
set(el, 'filter', [fx.blur > 0.3 ? `blur(${fx.blur.toFixed(1)}px)` : '', fx.dark > 0.01 ? `brightness(${(1 - fx.dark).toFixed(3)})` : ''].join(' ').trim() || 'none');
|
const p = ess(clamp((t - (s.start - DISSOLVE / 2)) / (s.end - s.start + DISSOLVE)));
|
||||||
set(el, 'clipPath', fx.clip);
|
const z = lerp(c.from.z, c.to.z, p), x = lerp(c.from.x, c.to.x, p), y = lerp(c.from.y, c.to.y, p);
|
||||||
|
set(cam, 'transform', `translate(${x.toFixed(2)}px, ${y.toFixed(2)}px) scale(${z.toFixed(5)})`);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
const active = t => SCENES.find(s => t >= s.start && t < s.end) ?? SCENES[SCENES.length - 1];
|
const active = t => SCENES.find(s => t >= s.start && t < s.end) ?? SCENES[SCENES.length - 1];
|
||||||
|
|
||||||
// ---------- background, flash ----------
|
// ---------- background: a slow drift ----------
|
||||||
const g1 = $('#bg .g1'), g2 = $('#bg .g2'), g3 = $('#bg .g3'), grid = $('#bg .grid'), flash = $('#flash'), bg = $('#bg');
|
const g1 = $('#bg .g1'), g2 = $('#bg .g2'), grid = $('#bg .grid');
|
||||||
const HITS = [
|
|
||||||
{ t: B(3), a: 0.5, c: '#ff3b3b' }, { t: B(4), a: 0.6, c: '#ff3b3b' }, { t: ENTER_AT, a: 0.5, c: '#ffffff' },
|
|
||||||
...SCENES.slice(2).map(s => ({ t: s.start, a: s.id === 'brand' ? 0.55 : 0.28, c: '#ffffff' })),
|
|
||||||
...MORE_CUTS.map(t => ({ t, a: 0.28, c: '#ffffff' })),
|
|
||||||
...FINDINGS.map(f => ({ t: f.at, a: 0.18, c: '#ff3b3b' })),
|
|
||||||
];
|
|
||||||
function background(t) {
|
function background(t) {
|
||||||
set(bg, 'opacity', t >= scene('scan').start ? '1' : '0');
|
set(g1, 'transform', `translate(${(W * 0.25 + Math.sin(t * 0.11) * 160 - 700).toFixed(1)}px, ${(H * 0.35 + Math.cos(t * 0.09) * 120 - 700).toFixed(1)}px)`);
|
||||||
let pulse = 0;
|
set(g2, 'transform', `translate(${(W * 0.8 + Math.cos(t * 0.1) * 160 - 550).toFixed(1)}px, ${(H * 0.75 + Math.sin(t * 0.12) * 110 - 550).toFixed(1)}px)`);
|
||||||
for (const h of HITS) pulse = Math.max(pulse, decay(t, h.t, 0.6) * h.a);
|
set(grid, 'transform', `translate(${((t * 6) % 96).toFixed(2)}px, ${((t * 8) % 96).toFixed(2)}px)`);
|
||||||
g1.style.transform = `translate(${W * 0.2 + Math.sin(t * 0.33) * 160 - 550}px, ${H * 0.3 + Math.cos(t * 0.25) * 140 - 550}px) scale(${1 + pulse * 0.3})`;
|
|
||||||
g2.style.transform = `translate(${W * 0.85 + Math.cos(t * 0.29) * 180 - 450}px, ${H * 0.75 + Math.sin(t * 0.37) * 150 - 450}px)`;
|
|
||||||
const red = t >= scene('scan').start && t < scene('fixed').start + 1.5 ? clamp((t - FINDINGS[0].at) / 1.5) * (1 - prog(t, FLIP_AT[0], 1.5)) : 0;
|
|
||||||
g3.style.background = `radial-gradient(circle, rgba(255,90,95,${(0.22 * red).toFixed(3)}), rgba(255,90,95,0) 62%)`;
|
|
||||||
g3.style.transform = `translate(${W * 0.75 - 400}px, ${H * 0.45 - 400}px)`;
|
|
||||||
grid.style.transform = `translate(${(t * 20) % 96}px, ${(t * 28) % 96}px)`;
|
|
||||||
let f = 0, c = '#fff';
|
|
||||||
for (const h of HITS) { const v = decay(t, h.t, 0.18) * h.a; if (v > f) { f = v; c = h.c; } }
|
|
||||||
set(flash, 'opacity', f.toFixed(3));
|
|
||||||
set(flash, 'background', c);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------- captions ----------
|
// ---------- caption ----------
|
||||||
const capEl = $('#cap');
|
const capEl = $('#cap');
|
||||||
let capId = null, capWords = [];
|
const CT = Object.fromEntries(captionTimes().map(c => [c.id, c]));
|
||||||
|
let capId = null;
|
||||||
function buildCaption(c) {
|
function buildCaption(c) {
|
||||||
capEl.className = [c.big ? 'big' : '', c.hl ?? ''].join(' ');
|
capEl.className = c.hl ?? '';
|
||||||
capEl.style.fontSize = '';
|
capEl.style.fontSize = '';
|
||||||
const one = !V && !c.big && c.lines.join(' ').length <= 30;
|
capEl.innerHTML = c.lines.map(l => `<span class="line">${esc(l).replace(/\*([^*]+)\*/g, '<span class="hl">$1</span>')}</span>`).join('');
|
||||||
const lines = one ? [c.lines.join(' ')] : c.lines;
|
|
||||||
capEl.innerHTML = lines.map(l => `<span class="line">${l.split(' ').map(w => `<span class="w${w.startsWith('*') ? ' hl' : ''}">${esc(w.replace(/\*/g, ''))}</span>`).join(' ')}</span>`).join('');
|
|
||||||
// fit: the widest line stays inside the centre 80% (safe area)
|
|
||||||
const avail = capEl.clientWidth, base = parseFloat(getComputedStyle(capEl).fontSize);
|
const avail = capEl.clientWidth, base = parseFloat(getComputedStyle(capEl).fontSize);
|
||||||
const widest = Math.max(...[...capEl.querySelectorAll('.line')].map(l => l.scrollWidth));
|
const widest = Math.max(...[...capEl.querySelectorAll('.line')].map(l => l.scrollWidth));
|
||||||
if (widest > avail) capEl.style.fontSize = `${Math.floor(base * avail / widest)}px`;
|
if (widest > avail) capEl.style.fontSize = `${Math.floor(base * avail / widest)}px`;
|
||||||
capWords = [];
|
|
||||||
[...capEl.querySelectorAll('.line')].forEach((l, i) => [...l.querySelectorAll('.w')].forEach((w, j) => {
|
|
||||||
const at = c.big ? c.word[i] : c.at + capWords.length * 0.07;
|
|
||||||
capWords.push({ el: w, at });
|
|
||||||
}));
|
|
||||||
}
|
}
|
||||||
function captions(t) {
|
function captions(t) {
|
||||||
const c = CAPTIONS.find(x => t >= x.at && t < x.to);
|
const s = active(t), c = CAPTIONS.find(x => x.id === s.id), ct = CT[s.id];
|
||||||
if (!c) { set(capEl, 'opacity', '0'); return; }
|
if (!c) { set(capEl, 'opacity', '0'); return; }
|
||||||
if (capId !== c.id) { capId = c.id; buildCaption(c); }
|
if (capId !== c.id) { capId = c.id; buildCaption(c); }
|
||||||
const hard = c.id === 'rejected'; // the hook ends on a hard cut
|
const pin = s === SCENES[0] && t < CAP_DELAY ? 0 : eoc(prog(t, ct.at, CAP_IN));
|
||||||
const out = hard ? 0 : prog(t, c.to - 0.16, 0.16);
|
const pout = s === SCENES.at(-1) ? 0 : prog(t, ct.to, CAP_OUT);
|
||||||
set(capEl, 'opacity', String(1 - out));
|
set(capEl, 'opacity', String(pin * (1 - pout)));
|
||||||
let shake = 0;
|
set(capEl, 'transform', `translateY(${((1 - pin) * 12 - pout * 8).toFixed(1)}px)`);
|
||||||
for (const w of capWords) {
|
|
||||||
const p = prog(t, w.at, c.big ? 0.2 : 0.34);
|
|
||||||
if (c.big) {
|
|
||||||
shake = Math.max(shake, decay(t, w.at + 0.05, 0.3));
|
|
||||||
set(w.el, 'opacity', String(clamp(p * 3)));
|
|
||||||
set(w.el, 'transform', `scale(${lerp(2.4, 1, eoc(p)).toFixed(3)})`);
|
|
||||||
set(w.el, 'filter', p < 1 ? `blur(${((1 - p) * 14).toFixed(1)}px)` : 'none');
|
|
||||||
} else {
|
|
||||||
set(w.el, 'opacity', String(clamp(p * 3)));
|
|
||||||
set(w.el, 'transform', `translateY(${((1 - eob(p)) * 0.42).toFixed(3)}em) scale(${(1 + 0.25 * (1 - eoc(p))).toFixed(3)})`);
|
|
||||||
set(w.el, 'filter', p < 1 ? `blur(${((1 - eoc(p)) * 10).toFixed(1)}px)` : 'none');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const sx = c.big ? Math.sin(t * 97) * 14 * shake : 0, sy = c.big ? Math.cos(t * 83) * 10 * shake : 0;
|
|
||||||
set(capEl, 'transform', c.big ? `translate(${sx.toFixed(1)}px, calc(-50% + ${sy.toFixed(1)}px))` : `translateY(${(-40 * eic(out)).toFixed(1)}px)`);
|
|
||||||
}
|
}
|
||||||
|
// keep the constants in use (they define captionTimes, imported above for the timing test)
|
||||||
|
void CAP_DELAY; void CAP_END;
|
||||||
|
|
||||||
// ---------- hook: inbox ----------
|
// ---------- 1 hook ----------
|
||||||
const list = $('#inbox .list'), hookCam = $('#s-hook .cam'), hookDim = $('#s-hook .dim'), unread = $('#inbox .cnt');
|
const todoRows = $('#todo .rows'), mailEl = $('#mail'), appcard = $('#appcard');
|
||||||
const ROW_H = V ? 236 : 168;
|
$('#appcard .nm').textContent = APP_NAME;
|
||||||
const mailRow = (m, rej) => {
|
todoRows.innerHTML = TODO.map(x => `<div class="row"><span class="box"></span>${esc(x.text)}</div>`).join('');
|
||||||
const el = document.createElement('div');
|
const todoEls = [...todoRows.querySelectorAll('.row')];
|
||||||
el.className = `mrow${rej ? '' : ' old'}`;
|
mailEl.querySelector('.from').textContent = MAIL.from;
|
||||||
el.innerHTML = rej
|
mailEl.querySelector('.date').textContent = MAIL.date;
|
||||||
? `<span class="hi"></span><span class="dot"></span><span class="from">App Store Connect</span><span class="date">${esc(m.date)}</span>
|
mailEl.querySelector('.subj').textContent = MAIL.subject;
|
||||||
<span class="subj">${esc(MAIL_SUBJECT)}</span><span class="prev">Hello, Thank you for submitting… <b>${esc(m.guideline)}</b></span>`
|
mailEl.querySelector('.prev').innerHTML = `Hello, Thank you for submitting your app… <b>${esc(MAIL.guideline)}</b>`;
|
||||||
: `<span class="hi"></span><span class="dot"></span><span class="from">${esc(m.from)}</span><span class="date">${esc(m.date)}</span>
|
|
||||||
<span class="subj">${esc(m.subject)}</span><span class="prev">${esc(m.preview)}</span>`;
|
|
||||||
list.appendChild(el);
|
|
||||||
return el;
|
|
||||||
};
|
|
||||||
const oldRows = OLD_MAILS.map(m => ({ el: mailRow(m, false), at: -1 }));
|
|
||||||
const newRows = MAILS.map(m => ({ el: mailRow(m, true), at: m.at }));
|
|
||||||
function hook(t) {
|
function hook(t) {
|
||||||
if (t >= scene('hook').end) return;
|
const s = scene('hook'); if (t > s.end + 1) return;
|
||||||
const slots = r => MAILS.filter(m => m.at > r.at).reduce((n, m) => n + eoc(prog(t, m.at, 0.3)), 0);
|
const r = t - s.start;
|
||||||
for (const r of [...oldRows.map((r, i) => ({ ...r, base: i })), ...newRows.map(r => ({ ...r, base: 0 }))]) {
|
appear(appcard, r, 0.1, 0.5, 20);
|
||||||
const y = (r.base + slots(r)) * ROW_H;
|
appear($('#todo'), r, 0.35, 0.45, 20);
|
||||||
if (r.at < 0) { set(r.el, 'transform', `translateY(${y.toFixed(1)}px)`); continue; }
|
todoEls.forEach((el, i) => appear(el, r, TODO[i].at, 0.4, 10));
|
||||||
const p = prog(t, r.at, 0.3);
|
const p = prog(r, MAIL.at, MAIL_IN);
|
||||||
set(r.el, 'opacity', String(clamp(p * 2.5)));
|
set(mailEl, 'opacity', String(eoc(p)));
|
||||||
set(r.el, 'transform', `translateY(${(y - (1 - eoc(p)) * ROW_H * 0.7).toFixed(1)}px)`);
|
set(mailEl, 'transform', `translateY(${((1 - eoc(p)) * 50).toFixed(1)}px)`);
|
||||||
set(r.el, 'zIndex', String(10 + MAILS.findIndex(m => m.at === r.at)));
|
|
||||||
set(r.el.querySelector('.hi'), 'opacity', (0.95 * (1 - prog(t, r.at + 0.2, 1.0))).toFixed(3));
|
|
||||||
}
|
|
||||||
const n = MAILS.filter(m => t >= m.at).length;
|
|
||||||
html(unread, `${n} new`);
|
|
||||||
let shake = 0;
|
|
||||||
for (const m of MAILS) shake = Math.max(shake, decay(t, m.at + 0.1, 0.22));
|
|
||||||
const slam = eoc(prog(t, B(3), 0.2));
|
|
||||||
const z = 1 + 0.035 * t + 0.06 * slam;
|
|
||||||
set(hookCam, 'transform', `translate(${(Math.sin(t * 90) * 7 * shake).toFixed(1)}px, ${(Math.cos(t * 70) * 5 * shake).toFixed(1)}px) scale(${z.toFixed(4)})`);
|
|
||||||
set(hookCam, 'filter', slam > 0 ? `blur(${(slam * 7).toFixed(1)}px)` : 'none');
|
|
||||||
set(hookDim, 'opacity', (0.74 * slam).toFixed(3));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------- scan: the terminal ----------
|
// ---------- 2 init ----------
|
||||||
const term = $('#term'), scanCam = $('#s-scan .cam');
|
const folderEl = $('#folder'), filesEl = $('#folder .files'), emptyEl = $('#folder .empty'), initBody = $('#initterm .body');
|
||||||
const CW = V ? 840 : 1560;
|
$('#folder .fname').textContent = `${FOLDER}/`;
|
||||||
term.innerHTML = [
|
/** The folder list: one entry per file `init` creates (from the real output lines). */
|
||||||
'<span class="ln" data-k="prompt"></span>',
|
const FILES = INIT_LINES.map((l, i) => ({ i, m: l.match(/^\[init\] create (.+)$/) })).filter(x => x.m).map(x => ({ i: x.i, path: x.m[1] }));
|
||||||
'<span class="ln"> </span>',
|
filesEl.innerHTML = FILES.map(f => {
|
||||||
...SCAN_HEAD.map((l, i) => `<span class="ln ${l.kind === 'head' ? 'head' : 'dimt'}" data-at="${l.at}" data-k="head${i}">${esc(l.text)}</span>`),
|
const k = f.path.lastIndexOf('/');
|
||||||
'<span class="ln"> </span>',
|
return `<div class="f"><span class="ic"></span><span>${k >= 0 ? `<span class="d">${esc(f.path.slice(0, k + 1))}</span>` : ''}${esc(f.path.slice(k + 1))}</span></div>`;
|
||||||
`<span class="ln sec" data-at="${SDK_AT}" data-k="sdks">SDKs</span>`,
|
}).join('');
|
||||||
...SDKS.map((s, i) => `<span class="ln sdk" data-at="${s.at}" data-k="sdk${i}"> <b>${esc(s.name)}</b> · ${esc(s.what)}\n <span class="loc">${esc(s.where)}</span> <span class="dimt">${esc(s.dep)}</span></span>`),
|
const fileEls = [...filesEl.querySelectorAll('.f')];
|
||||||
'<span class="ln"> </span>',
|
const tagged = l => esc(l).replace(/^(\[\w+\])/, '<span class="tag">$1</span>');
|
||||||
`<span class="ln risk" data-at="${RISKS_AT}" data-k="risks">${esc(RISKS_LINE).replace(/(2 blocker, 3 high)/, '<span class="r">$1</span>')}</span>`,
|
initBody.innerHTML = `<span class="ln" data-k="p"></span>${INIT_LINES.map(l => `<span class="ln">${tagged(l).replace(/ (create) /, ' <span class="okk">$1</span> ')}</span>`).join('')}`;
|
||||||
...FINDINGS.map((f, i) => `<span class="fd" data-at="${f.at}" data-k="f${i}"><span class="glow"></span>`
|
const initLns = [...initBody.querySelectorAll('.ln')];
|
||||||
+ `<span>${i + 1}. <span class="sev${f.sev === 'HIGH' ? ' high' : ''}">${f.sev}</span><span class="gl">${esc(f.guideline)}</span> <span class="dimt">· App Store</span></span>`
|
function init(t) {
|
||||||
+ `<span class="ttl">${esc(f.title)}</span>`
|
const s = scene('init'); if (t < s.start - 1 || t > s.end + 1) return;
|
||||||
+ `<span class="loc">at ${esc(f.where)}</span>`
|
const r = t - s.start;
|
||||||
+ `<span class="fx">fix: ${f.fix.match(/^[a-z]/) ? '<i>…</i> ' : ''}${esc(f.fix)} <i>…</i></span></span>`),
|
const n = clamp(Math.floor((r - INIT_TYPE_AT) * INIT_CPS), 0, INIT_CMD.length);
|
||||||
].join('');
|
const caret = r < INIT_OUT_AT && (n < INIT_CMD.length || Math.floor(r * 2.2) % 2 === 0);
|
||||||
const tl = Object.fromEntries([...term.querySelectorAll('[data-k]')].map(e => [e.dataset.k, e]));
|
html(initLns[0], `<span class="tag">~/${esc(FOLDER)}</span> <span class="ps">$</span> <span class="cmd">${esc(INIT_CMD.slice(0, n))}</span>${caret ? '<span class="caret"></span>' : ''}`);
|
||||||
const timed = [...term.querySelectorAll('[data-at]')].map(e => ({ el: e, at: Number(e.dataset.at), fd: e.classList.contains('fd') }));
|
set(initLns[0], 'opacity', '1');
|
||||||
const box = el => ({ y: el.offsetTop, h: el.offsetHeight });
|
initLns.slice(1).forEach((el, i) => appear(el, r, INIT_OUT_AT + 0.2 + i * INIT_STEP, 0.25, 6));
|
||||||
/** Camera keys: [time, element key, zoom]. The camera eases to each key over 0.42 s, starting a little before. */
|
fileEls.forEach((el, k) => {
|
||||||
const ZF = V ? 1.14 : 1.1;
|
const p = prog(r, INIT_OUT_AT + 0.2 + FILES[k].i * INIT_STEP, 0.3);
|
||||||
const SCAN_CAM = [
|
set(el, 'opacity', String(eoc(p)));
|
||||||
[scene('scan').start, 'prompt', V ? 1.9 : 1.7],
|
set(el, 'transform', `translateX(${((1 - eoc(p)) * -16).toFixed(1)}px)`);
|
||||||
[ENTER_AT, 'head0', ZF + 0.04],
|
|
||||||
[SDK_AT, 'sdk0', ZF],
|
|
||||||
[RISKS_AT, 'risks', ZF],
|
|
||||||
...FINDINGS.map((f, i) => [f.at, `f${i}`, ZF]),
|
|
||||||
];
|
|
||||||
let camBoxes = null;
|
|
||||||
function scanCamAt(t) {
|
|
||||||
camBoxes ??= Object.fromEntries(SCAN_CAM.map(([, k]) => [k, box(tl[k])]));
|
|
||||||
const pos = k => { const b = camBoxes[k]; return b.y + b.h / 2; };
|
|
||||||
let y = pos(SCAN_CAM[0][1]), z = SCAN_CAM[0][2], typing = 1;
|
|
||||||
for (let i = 1; i < SCAN_CAM.length; i++) {
|
|
||||||
const [at, k, zz] = SCAN_CAM[i];
|
|
||||||
const p = eio(prog(t, at - 0.12, 0.42));
|
|
||||||
y = lerp(y, pos(k), p); z = lerp(z, zz, p);
|
|
||||||
if (i === 1) typing = 1 - p;
|
|
||||||
}
|
|
||||||
// while typing the command sits centred; afterwards the column is centred
|
|
||||||
const cmdW = (CMD.length + 2) * (V ? 31 : 30) * 0.6;
|
|
||||||
const sx = lerp(W / 2, (W - cmdW * z) / 2, typing), ax = lerp(CW / 2, 0, typing);
|
|
||||||
return { tx: sx - ax * z, ty: L.cy - y * z, z };
|
|
||||||
}
|
|
||||||
function scan(t) {
|
|
||||||
const s = scene('scan');
|
|
||||||
if (t < s.start - 0.1 || t > s.end + 0.2) return;
|
|
||||||
const n = clamp(Math.floor((t - TYPE_AT) * TYPE_CPS), 0, CMD.length);
|
|
||||||
const caret = t < ENTER_AT ? (n < CMD.length || Math.floor(t * 2.4) % 2 === 0) : false;
|
|
||||||
html(tl.prompt, `<span class="ps">$</span> <span class="cmd">${esc(CMD.slice(0, n))}</span>${caret ? '<span class="caret"></span>' : ''}`);
|
|
||||||
set(tl.prompt, 'opacity', '1');
|
|
||||||
let focus = -1;
|
|
||||||
FINDINGS.forEach((f, i) => { if (t >= f.at - 0.1) focus = i; });
|
|
||||||
for (const l of timed) {
|
|
||||||
const p = prog(t, l.at, l.fd ? 0.28 : 0.2);
|
|
||||||
set(l.el, 'opacity', String(clamp(p * 2)));
|
|
||||||
set(l.el, 'transform', `translateX(${((1 - eoc(p)) * (l.fd ? 60 : 30)).toFixed(1)}px)`);
|
|
||||||
if (l.fd) {
|
|
||||||
const i = Number(l.el.dataset.k.slice(1));
|
|
||||||
const g = l.el.querySelector('.glow');
|
|
||||||
set(g, 'opacity', (i === focus ? 1 - 0.4 * prog(t, l.at + 0.3, 0.4) : 0.18 * p).toFixed(3));
|
|
||||||
set(l.el, 'filter', i === focus || focus < 0 ? 'none' : 'brightness(.62)');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const c = scanCamAt(t);
|
|
||||||
// a small push-in on every finding as it lands (about the focus line)
|
|
||||||
let punch = 0;
|
|
||||||
for (const f of FINDINGS) punch = Math.max(punch, Math.sin(Math.PI * prog(t, f.at - 0.05, 0.9)) * 0.035);
|
|
||||||
const k = 1 + punch;
|
|
||||||
set(scanCam, 'transform', `translate(${(c.tx * k - (W / 2) * (k - 1)).toFixed(1)}px, ${(c.ty * k - L.cy * (k - 1)).toFixed(1)}px) scale(${(c.z * k).toFixed(4)})`);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------- fixed: re-scan, reds flip green ----------
|
|
||||||
const frows = $('#frows'), rescan = $('#rescan'), counter = $('#counter'), cN = $('#counter .n'), cLab = $('#counter .lab');
|
|
||||||
const FR = V ? { x: 60, w: 960, top: 690, h: 112, gap: 18 } : { x: 150, w: 920, top: 330, h: 118, gap: 22 };
|
|
||||||
frows.innerHTML = FINDINGS.map((f, i) => `<div class="frow" style="left:${FR.x}px;width:${FR.w}px;top:${FR.top + i * (FR.h + FR.gap)}px;height:${FR.h}px">
|
|
||||||
<span class="tint t-bad" style="background:var(--red-bg)"></span><span class="tint t-good" style="background:var(--green-bg);opacity:0"></span>
|
|
||||||
<span class="ic"><span class="pi i-x bad"></span><span class="pi i-ok good"></span></span>
|
|
||||||
<span><span class="t1">${esc(f.short)}</span><span class="t2" style="display:block">${esc(f.guideline)} · ${esc(f.where)}</span></span>
|
|
||||||
<span class="chip" style="background:${f.sev === 'HIGH' ? '#c2410c' : 'var(--red-2)'}"><span class="c1">${f.sev}</span><span class="c2">FIXED</span></span></div>`).join('');
|
|
||||||
const frowEls = [...frows.querySelectorAll('.frow')];
|
|
||||||
if (V) Object.assign(rescan.style, { left: '60px', top: '560px', width: '960px', fontSize: '29px' });
|
|
||||||
else Object.assign(rescan.style, { left: '1150px', top: '340px', width: '660px', fontSize: '25px' });
|
|
||||||
rescan.innerHTML = `<span class="ln" data-k="p"></span><span class="ln" data-k="r" style="color:var(--green);font-weight:700">${esc(RESCAN_LINE)}</span>`
|
|
||||||
+ (V ? '' : `<span class="ln" data-k="n" style="color:var(--muted)"> ${esc(RESCAN_NONE)}</span>`);
|
|
||||||
if (V) Object.assign(counter.style, { left: '0', width: '100%', top: '1340px' });
|
|
||||||
else Object.assign(counter.style, { left: '1150px', width: '660px', top: '560px' });
|
|
||||||
cN.style.fontSize = V ? '120px' : '230px'; cLab.style.fontSize = V ? '40px' : '50px';
|
|
||||||
if (V) { counter.style.display = 'flex'; counter.style.justifyContent = 'center'; counter.style.alignItems = 'baseline'; counter.style.gap = '24px'; }
|
|
||||||
function fixed(t) {
|
|
||||||
const s = scene('fixed');
|
|
||||||
if (t < s.start - 0.3 || t > s.end + 0.5) return;
|
|
||||||
const n = clamp(Math.floor((t - RESCAN_TYPE_AT) * 24), 0, RESCAN_CMD.length);
|
|
||||||
const p = rescan.querySelector('[data-k="p"]'), r = rescan.querySelector('[data-k="r"]'), none = rescan.querySelector('[data-k="n"]');
|
|
||||||
html(p, `<span class="ps">$</span> <span class="cmd">${esc(RESCAN_CMD.slice(0, n))}</span>${n < RESCAN_CMD.length || t < FLIP_AT[0] - 0.2 ? '<span class="caret"></span>' : ''}`);
|
|
||||||
set(p, 'opacity', '1');
|
|
||||||
const rp = prog(t, RESCAN_LINE_AT, 0.25);
|
|
||||||
set(r, 'opacity', String(rp)); set(r, 'transform', `translateX(${((1 - eoc(rp)) * 30).toFixed(1)}px)`);
|
|
||||||
if (none) { const np = prog(t, RESCAN_LINE_AT + 0.15, 0.25); set(none, 'opacity', String(np)); }
|
|
||||||
let left = FINDINGS.length;
|
|
||||||
frowEls.forEach((el, i) => {
|
|
||||||
const enter = prog(t, s.start + 0.05 + i * 0.06, 0.3);
|
|
||||||
const f = prog(t, FLIP_AT[i], 0.32);
|
|
||||||
if (t >= FLIP_AT[i]) left--;
|
|
||||||
const pop = decay(t, FLIP_AT[i], 0.3);
|
|
||||||
set(el, 'opacity', String(enter));
|
|
||||||
set(el, 'transform', `translateY(${((1 - eoc(enter)) * 40).toFixed(1)}px) scale(${(1 + 0.035 * pop).toFixed(4)})`);
|
|
||||||
set(el, 'borderColor', f > 0.5 ? 'rgba(61,220,132,.55)' : 'rgba(255,90,95,.4)');
|
|
||||||
set(el.querySelector('.t-good'), 'opacity', String(eoc(f)));
|
|
||||||
set(el.querySelector('.t-bad'), 'opacity', String(1 - eoc(f)));
|
|
||||||
set(el.querySelector('.bad'), 'transform', `scale(${(1 - eic(f)).toFixed(3)}) rotate(${(-90 * f).toFixed(1)}deg)`);
|
|
||||||
set(el.querySelector('.good'), 'transform', `scale(${eob(f).toFixed(3)})`);
|
|
||||||
set(el.querySelector('.good'), 'opacity', String(clamp(f * 3)));
|
|
||||||
const c2 = el.querySelector('.c2');
|
|
||||||
set(c2, 'clipPath', `inset(0 ${((1 - eoc(f)) * 100).toFixed(1)}% 0 0)`);
|
|
||||||
});
|
});
|
||||||
const zero = left === 0;
|
set(emptyEl, 'opacity', String(1 - prog(r, INIT_OUT_AT + 0.1, 0.3)));
|
||||||
html(cN, String(left));
|
void folderEl;
|
||||||
html(cLab, zero ? 'blockers' : 'rejection risks');
|
|
||||||
set(cN, 'color', zero ? 'var(--green)' : 'var(--red)');
|
|
||||||
let pop = 0;
|
|
||||||
FLIP_AT.forEach((a, i) => { pop = Math.max(pop, decay(t, a, 0.25) * (i === 4 ? 1.6 : 1)); });
|
|
||||||
const ce = prog(t, s.start + 0.25, 0.35);
|
|
||||||
set(counter, 'opacity', String(ce));
|
|
||||||
set(cN, 'transform', `scale(${(1 + 0.22 * pop).toFixed(3)})`);
|
|
||||||
set(cN, 'display', 'inline-block');
|
|
||||||
set(cN, 'textShadow', zero ? `0 0 ${(40 + 60 * pop).toFixed(0)}px rgba(61,220,132,.6)` : '0 0 40px rgba(255,90,95,.4)');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------- shots: the screenshot wall ----------
|
// ---------- 3 plan ----------
|
||||||
const wall = $('#wall'), shotNum = $('#shotcount .num'), shotCount = $('#shotcount'), shotCmd = $('#shotcmd');
|
const promptEl = $('#prompt'), promptTxt = $('#prompt .txt'), planTerm = $('#planterm'), planBody = $('#planterm .body'), planPill = $('#plan-pill');
|
||||||
const GRID = await fetch('out/assets/grid.json').then(r => { if (!r.ok) throw new Error('out/assets/grid.json missing (bun media/teaser/render.ts prepares it)'); return r.json(); });
|
const planLine = l => {
|
||||||
const WALL = V ? { cols: 7, rows: 7, tw: 210, th: 373, gap: 22 } : { cols: 11, rows: 4, tw: 200, th: 356, gap: 22 };
|
if (/^\S/.test(l)) return `<span class="num">${esc(l)}</span>`;
|
||||||
const tiles = [];
|
if (/^ (both stores|App Store|Google Play)/.test(l)) return `<span class="num">${esc(l)}</span>`;
|
||||||
|
return esc(l).replace(/^(\s+\d+\.) (CONFIG |STORE |BLOCKER)/, (m, a, b) => `<span class="tag">${a}</span> <span class="${b.startsWith('BLOCKER') ? 'bad' : b.startsWith('STORE') ? 'warnk' : 'okk'}">${b}</span>`);
|
||||||
|
};
|
||||||
|
planBody.innerHTML = `<span class="ln" data-k="c"></span>${PLAN_LINES.map(l => `<span class="ln">${planLine(l)}</span>`).join('')}`;
|
||||||
|
const planLns = [...planBody.querySelectorAll('.ln')];
|
||||||
|
planPill.innerHTML = bold(PLAN_PILL);
|
||||||
|
function plan(t) {
|
||||||
|
const s = scene('plan'); if (t < s.start - 1 || t > s.end + 1) return;
|
||||||
|
const r = t - s.start;
|
||||||
|
appear(promptEl, r, 0.05, 0.35, 10);
|
||||||
|
const n = clamp(Math.floor((r - PROMPT_AT) * PROMPT_CPS), 0, PROMPT.length);
|
||||||
|
html(promptTxt, `${esc(PROMPT.slice(0, n))}${n < PROMPT.length || r < PLAN_CMD_AT ? '<span class="caret"></span>' : ''}`);
|
||||||
|
appear(planTerm, r, PLAN_CMD_AT - 0.35, 0.4, 16);
|
||||||
|
html(planLns[0], `<span class="ps">$</span> <span class="cmd">${esc(PLAN_CMD)}</span>`);
|
||||||
|
appear(planLns[0], r, PLAN_CMD_AT, 0.25, 4);
|
||||||
|
planLns.slice(1).forEach((el, i) => appear(el, r, PLAN_AT + i * PLAN_STEP, 0.25, 6));
|
||||||
|
pillAt(planPill, r, PLAN_AT + PLAN_LINES.length * PLAN_STEP + 0.15);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------- 4 store ----------
|
||||||
|
const copyRows = $('#copy .rows'), shotsEl = $('#shots'), storePill = $('#store-pill'), shotCmd = $('#shotcmd');
|
||||||
|
$('#copy .fname').textContent = COPY_FILE;
|
||||||
|
copyRows.innerHTML = COPY.map(c => `<div class="row"><span class="lg">${esc(c.lang)}</span><span class="tt${c.rtl ? ' rtl' : ''}">${esc(c.title.join(' '))}</span></div>`).join('');
|
||||||
|
const copyEls = [...copyRows.querySelectorAll('.row')];
|
||||||
|
storePill.innerHTML = bold(SHOTS_PILL);
|
||||||
|
shotCmd.querySelector('.cmd').textContent = SHOTS_CMD;
|
||||||
|
/** The grid: one column per size (portrait sizes by aspect, the feature graphic last), one row per language. */
|
||||||
|
const DIMS = { ios69: [1320, 2868], ios65: [1284, 2778], ipad13: [2064, 2752], play: [1080, 1920], tab7: [1080, 1920], tab10: [1440, 2560], feature: [1024, 500] };
|
||||||
|
const shotTiles = [], shotLabels = [], langLabels = [];
|
||||||
{
|
{
|
||||||
const ww = WALL.cols * (WALL.tw + WALL.gap), wh = WALL.rows * (WALL.th + WALL.gap);
|
const LAB = 50, LANGW = 52, GAP = 14, AREA_W = 1020, AREA_H = 700;
|
||||||
let k = 0;
|
const RH = (AREA_H - LAB - GAP * (SHOT_LANGS.length - 1)) / SHOT_LANGS.length;
|
||||||
for (let r = 0; r < WALL.rows; r++) for (let c = 0; c < WALL.cols; c++) {
|
const FW = 280, FH = FW * DIMS.feature[1] / DIMS.feature[0];
|
||||||
|
const widths = SHOT_SIZES.map(sz => (sz.id === 'feature' ? FW : RH * DIMS[sz.id][0] / DIMS[sz.id][1]));
|
||||||
|
const total = LANGW + widths.reduce((a, b) => a + b, 0) + GAP * SHOT_SIZES.length;
|
||||||
|
let x = (AREA_W - total) / 2 + LANGW + GAP;
|
||||||
|
SHOT_LANGS.forEach((lang, j) => {
|
||||||
|
const el = document.createElement('div');
|
||||||
|
el.className = 'lang'; el.textContent = lang;
|
||||||
|
Object.assign(el.style, { left: `${(AREA_W - total) / 2}px`, top: `${LAB + j * (RH + GAP) + RH / 2 - 10}px` });
|
||||||
|
shotsEl.appendChild(el); langLabels.push(el);
|
||||||
|
});
|
||||||
|
SHOT_SIZES.forEach((sz, i) => {
|
||||||
|
const w = widths[i], h = sz.id === 'feature' ? FH : RH;
|
||||||
|
const lab = document.createElement('div');
|
||||||
|
lab.className = 'lab'; lab.textContent = sz.label;
|
||||||
|
Object.assign(lab.style, { left: `${x + w / 2}px`, top: '0px', transform: 'translateX(-50%)' });
|
||||||
|
shotsEl.appendChild(lab); shotLabels.push({ el: lab, col: i });
|
||||||
|
SHOT_LANGS.forEach((lang, j) => {
|
||||||
const el = document.createElement('div');
|
const el = document.createElement('div');
|
||||||
el.className = 'tile';
|
el.className = 'tile';
|
||||||
const x = c * (WALL.tw + WALL.gap) - ww / 2 + (r % 2 ? WALL.tw * 0.25 : 0), y = r * (WALL.th + WALL.gap) - wh / 2;
|
Object.assign(el.style, { left: `${x}px`, top: `${LAB + j * (RH + GAP) + (RH - h) / 2}px`, width: `${w}px`, height: `${h}px`,
|
||||||
Object.assign(el.style, { left: `${x}px`, top: `${y}px`, width: `${WALL.tw}px`, height: `${WALL.th}px`, backgroundImage: `url(out/assets/grid/${GRID[(k * 7) % GRID.length]})` });
|
backgroundImage: `url(out/assets/shots/${lang}-${sz.id}.jpg)`, borderRadius: sz.id === 'feature' ? '6px' : '9px' });
|
||||||
wall.appendChild(el);
|
shotsEl.appendChild(el);
|
||||||
const d = Math.hypot(x + WALL.tw / 2, (y + WALL.th / 2) * 0.8);
|
shotTiles.push({ el, col: i, row: j });
|
||||||
tiles.push({ el, d: d + ((k * 37) % 11) * 18 });
|
});
|
||||||
k++;
|
x += w + GAP;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
const order = [...tiles].sort((a, b) => a.d - b.d);
|
function store(t) {
|
||||||
order.forEach((tl2, i) => { tl2.at = 0.12 + (i / order.length) * 1.45; });
|
const s = scene('store'); if (t < s.start - 1 || t > s.end + 1) return;
|
||||||
}
|
|
||||||
if (V) { Object.assign(shotCmd.style, { left: '50%', top: '500px' }); Object.assign(shotCount.style, { left: '50%', top: '1300px', fontSize: '58px' }); }
|
|
||||||
else { Object.assign(shotCmd.style, { left: '50%', top: '290px' }); Object.assign(shotCount.style, { left: '50%', top: '880px', fontSize: '56px' }); }
|
|
||||||
function shots(t) {
|
|
||||||
const s = scene('shots');
|
|
||||||
if (t < s.start - 0.1 || t > s.end + 0.6) return;
|
|
||||||
const r = t - s.start;
|
const r = t - s.start;
|
||||||
let shown = 0;
|
appear($('#copy'), r, 0.0, 0.4, 14);
|
||||||
for (const tile of tiles) {
|
copyEls.forEach((el, i) => appear(el, r, COPY_AT + i * COPY_STEP, 0.4, 10));
|
||||||
const p = prog(r, tile.at, 0.26);
|
langLabels.forEach((el, j) => appear(el, r, SHOTS_AT - 0.2 + j * 0.05, 0.3, 0));
|
||||||
if (p > 0) shown++;
|
shotLabels.forEach(({ el, col }) => { const p = prog(r, SHOTS_AT + col * SHOTS_STEP, 0.35); set(el, 'opacity', String(eoc(p))); });
|
||||||
set(tile.el, 'opacity', String(clamp(p * 2)));
|
for (const { el, col, row } of shotTiles) {
|
||||||
set(tile.el, 'transform', `translateZ(${((1 - eoc(p)) * 260).toFixed(1)}px) scale(${lerp(0.72, 1, eob(p)).toFixed(3)})`);
|
const p = prog(r, SHOTS_AT + col * SHOTS_STEP + row * 0.06, 0.4);
|
||||||
|
set(el, 'opacity', String(eoc(p)));
|
||||||
|
set(el, 'transform', `scale(${lerp(0.9, 1, eoc(p)).toFixed(4)})`);
|
||||||
}
|
}
|
||||||
const z = lerp(1.12, 0.98, eio(prog(r, 0, s.end - s.start + 0.4)));
|
const done = SHOTS_AT + SHOT_SIZES.length * SHOTS_STEP + 0.2;
|
||||||
set(wall, 'transform', `translate(-50%, -50%) translateY(${(-60 * r).toFixed(1)}px) perspective(2200px) rotateX(20deg) rotateZ(-11deg) scale(${z.toFixed(4)})`);
|
pillAt(storePill, r, done);
|
||||||
const frac = shown / tiles.length;
|
pillAt(shotCmd, r, done + 0.2, 'translateX(-50%)');
|
||||||
html(shotNum, String(Math.round(SHOTS_TOTAL * eoc(clamp(r / 1.65)) * (frac > 0 ? 1 : 0))));
|
|
||||||
const cp = prog(r, 0.1, 0.35), np = prog(r, 0.35, 0.35);
|
|
||||||
set(shotCmd, 'opacity', String(cp)); set(shotCmd, 'transform', `translate(-50%, ${((1 - eoc(cp)) * 20).toFixed(1)}px)`);
|
|
||||||
const pop = decay(r, 1.65, 0.3);
|
|
||||||
set(shotCount, 'opacity', String(np)); set(shotCount, 'transform', `translate(-50%, ${((1 - eoc(np)) * 30).toFixed(1)}px) scale(${(1 + 0.12 * pop).toFixed(3)})`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------- declarations ----------
|
// ---------- 5 products ----------
|
||||||
const prop = $('#prop'), form = $('#form'), declNum = $('#declcount .num'), declCount = $('#declcount');
|
const prodBody = $('#prodterm .body'), prodPill = $('#prod-pill');
|
||||||
const PROP_LINES = [...DECL_LINES.map(d => ({ k: 'detected', w: d.what, v: d.value, loc: d.where })), { k: 'ask owner', w: DECL_ASK.replace('ask owner ', ''), v: '?', loc: '', ask: true }];
|
const prodLine = l => (l.cmd ? `<span class="ps">$</span> <span class="cmd">${esc(l.text.replace(/^\$ /, ''))}</span>`
|
||||||
prop.querySelector('.body').innerHTML = PROP_LINES.map(l => `<span class="ln${l.ask ? ' ask' : ''}"><span class="k">${esc(l.k)}</span> <span class="w">${esc(l.w)}</span>${l.loc ? ` <span class="loc">${esc(l.loc)}</span>` : ` ${esc(l.v)}`}</span>`).join('');
|
: tagged(l.text).replace(/^ok {4}/, '<span class="okk">ok</span> ').replace(/(\d+ regions?|\d+ region prices)/, '<span class="num">$1</span>')
|
||||||
const ROW = V ? 54 : 62;
|
.replace(/(0 mismatch\(es\))/, '<span class="okk">$1</span>'));
|
||||||
form.querySelector('.body').innerHTML = DATA_SAFETY_ROWS.map(r => `<div class="row" style="height:${ROW}px"><span class="box"><span class="fill"></span><span class="pi i-check"></span></span>${esc(r)}<span class="tag">detected</span></div>`).join('');
|
prodBody.innerHTML = PRODUCT_LINES.map((l, i) => `${i && l.cmd ? '<span class="ln" style="opacity:1"> </span>' : ''}<span class="ln">${prodLine(l)}</span>`).join('');
|
||||||
if (V) {
|
const prodLns = [...prodBody.querySelectorAll('.ln')].filter(el => el.style.opacity !== '1');
|
||||||
Object.assign(prop.style, { left: '60px', width: '960px', top: '540px' });
|
prodPill.innerHTML = bold(PRODUCTS_PILL.text);
|
||||||
Object.assign(form.style, { left: '60px', width: '960px', top: '890px' });
|
function products(t) {
|
||||||
Object.assign(declCount.style, { left: '50%', top: '1372px', fontSize: '50px' });
|
const s = scene('products'); if (t < s.start - 1 || t > s.end + 1) return;
|
||||||
} else {
|
|
||||||
Object.assign(prop.style, { left: '130px', width: '860px', top: '320px' });
|
|
||||||
Object.assign(form.style, { left: '1040px', width: '750px', top: '300px' });
|
|
||||||
Object.assign(declCount.style, { left: '560px', top: '820px', fontSize: '56px' });
|
|
||||||
}
|
|
||||||
const propLns = [...prop.querySelectorAll('.ln')], formRows = [...form.querySelectorAll('.row')];
|
|
||||||
function decl(t) {
|
|
||||||
const s = scene('decl');
|
|
||||||
if (t < s.start - 0.4 || t > s.end + 0.5) return;
|
|
||||||
const r = t - s.start;
|
const r = t - s.start;
|
||||||
const ce = eoc(prog(r, 0, 0.4));
|
appear($('#prodterm'), r, 0.0, 0.4, 14);
|
||||||
set(prop, 'transform', `translateY(${((1 - ce) * 40).toFixed(1)}px)`); set(prop, 'opacity', String(ce));
|
prodLns.forEach((el, i) => appear(el, r, PRODUCT_LINES[i].at, 0.3, 6));
|
||||||
const fe = eoc(prog(r, 0.35, 0.4));
|
pillAt(prodPill, r, PRODUCTS_PILL.at);
|
||||||
set(form, 'transform', `translateY(${((1 - fe) * 40).toFixed(1)}px)`); set(form, 'opacity', String(fe));
|
}
|
||||||
propLns.forEach((el, i) => { const p = prog(r, 0.2 + i * 0.16, 0.22); set(el, 'opacity', String(p)); set(el, 'transform', `translateX(${((1 - eoc(p)) * 30).toFixed(1)}px)`); });
|
|
||||||
|
// ---------- 6 forms ----------
|
||||||
|
const propBody = $('#prop .body'), formBody = $('#form .body'), formsPill = $('#forms-pill');
|
||||||
|
propBody.innerHTML = DECL_LINES.map(d => `<span class="ln"><span class="v1"><span class="k">detected</span> <span class="w">${esc(d.what)}</span>:<span class="loc">(${esc(d.where)})</span></span><span class="v2">${esc(d.value)}</span></span>`).join('')
|
||||||
|
+ `<span class="ln ask"><span class="glow"></span><span class="k">ask owner</span> <span class="w">${esc(DECL_ASK.replace(/^ask owner /, '').split(':')[0])}</span>:${esc(DECL_ASK.replace(/^ask owner [^:]+:/, ''))}</span>`
|
||||||
|
+ '<span class="askn">Only you know this one: storebound asks.</span>';
|
||||||
|
const propLns = [...propBody.querySelectorAll('.ln')], askGlow = $('#prop .ask .glow'), askNote = $('#prop .askn');
|
||||||
|
formBody.innerHTML = DATA_SAFETY_ROWS.map(r => `<div class="row"><span class="box"><span class="fill"></span><span class="pi i-check"></span></span>${esc(r)}<span class="tg">detected</span></div>`).join('');
|
||||||
|
const formRows = [...formBody.querySelectorAll('.row')];
|
||||||
|
function forms(t) {
|
||||||
|
const s = scene('forms'); if (t < s.start - 1 || t > s.end + 1) return;
|
||||||
|
const r = t - s.start;
|
||||||
|
appear($('#prop'), r, 0.0, 0.4, 14);
|
||||||
|
appear($('#form'), r, 0.25, 0.4, 14);
|
||||||
|
propLns.forEach((el, i) => appear(el, r, i < DECL_LINES.length ? DECL_AT + i * DECL_STEP : ASK_AT, 0.3, 6));
|
||||||
|
const g = prog(r, ASK_AT + 0.15, 0.4);
|
||||||
|
set(askGlow, 'opacity', String(eoc(g)));
|
||||||
|
appear(askNote, r, ASK_AT + 0.4, 0.4, 6);
|
||||||
formRows.forEach((el, i) => {
|
formRows.forEach((el, i) => {
|
||||||
const p = prog(r, 0.95 + i * 0.16, 0.24);
|
const p = prog(r, FORM_AT + i * FORM_STEP, 0.25);
|
||||||
set(el.querySelector('.fill'), 'opacity', String(eoc(p)));
|
set(el.querySelector('.fill'), 'opacity', String(eoc(p)));
|
||||||
set(el.querySelector('.pi'), 'transform', `scale(${eob(p).toFixed(3)})`);
|
set(el.querySelector('.pi'), 'opacity', String(eoc(p)));
|
||||||
set(el.querySelector('.box'), 'borderColor', p > 0 ? 'var(--green)' : 'var(--line-2)');
|
set(el.querySelector('.box'), 'borderColor', p > 0 ? 'var(--green)' : 'var(--line-2)');
|
||||||
set(el.querySelector('.tag'), 'opacity', String(p));
|
set(el.querySelector('.tg'), 'opacity', String(p));
|
||||||
set(el, 'color', p > 0.5 ? '#fff' : 'var(--ink-2)');
|
set(el, 'color', p > 0.5 ? '#fff' : 'var(--ink-2)');
|
||||||
});
|
});
|
||||||
const np = prog(r, 0.95, 1.3);
|
const np = prog(r, FORMS_PILL.at, 1.0);
|
||||||
html(declNum, String(Math.round(DECL_TOTAL * eoc(np))));
|
html(formsPill, `<b>${Math.round(DECL_TOTAL * eoc(np))}</b> ${esc(FORMS_PILL.text)}`);
|
||||||
const dp = prog(r, 0.8, 0.3), pop = decay(r, 2.25, 0.3);
|
pillAt(formsPill, r, FORMS_PILL.at);
|
||||||
set(declCount, 'opacity', String(dp));
|
|
||||||
set(declCount, 'transform', `translate(${V ? '-50%' : '0'}, ${((1 - eoc(dp)) * 30).toFixed(1)}px) scale(${(1 + 0.12 * pop).toFixed(3)})`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------- desktop: real frames in a window, slow camera, one callout ----------
|
// ---------- 7 rejections ----------
|
||||||
const BOXES = await fetch('out/desktop/boxes.json').then(r => { if (!r.ok) throw new Error('out/desktop/boxes.json missing (bun media/teaser/desktop.ts)'); return r.json(); });
|
const scanBody = $('#scanterm .body');
|
||||||
const WIN = V ? { x: 40, y: 520, w: 1000, h: 950 } : { x: 210, y: 285, w: 1500, h: 760 };
|
scanBody.innerHTML = `<span class="ln"><span class="ps">$</span> <span class="cmd">${esc(SCAN_CMD)}</span></span>`
|
||||||
const VIEW = { w: WIN.w, h: WIN.h - 44 };
|
+ `<span class="ln num risk">${esc(RISKS_LINE).replace(/(2 blocker, 3 high)/, '<span class="bad">$1</span>')}</span>`
|
||||||
const S0 = Math.max(VIEW.w / 1280, VIEW.h / 800);
|
+ FINDINGS.map((f, i) => `<div class="fd"><span class="tint b"></span><span class="tint g"></span>
|
||||||
const desk = {};
|
<div class="l1"><span class="tag">${i + 1}.</span><span class="sev${f.sev === 'HIGH' ? ' high' : ''}">${f.sev}</span><span class="gl">${esc(f.guideline)}</span><span class="ttl">${esc(f.title)}</span></div>
|
||||||
for (const [id, d] of Object.entries(DESKTOP)) {
|
<div class="why"><span class="pi i-stop"></span>${esc(f.why)}<span class="loc at">at ${esc(f.where)}</span><span class="fixed">FIXED</span></div></div>`).join('')
|
||||||
const el = $(`#s-${id}`);
|
+ `<span class="ln" id="rescan-c" style="margin-top:14px"><span class="ps">$</span> <span class="cmd">${esc(SCAN_CMD)}</span> <span class="tag">(after the fixes)</span></span>`
|
||||||
const img = f => `<img src="out/desktop/${f}.jpg" alt="">`;
|
+ `<span class="ln okk" id="rescan-r">${esc(RESCAN_LINE)}</span>`;
|
||||||
el.innerHTML = `<div class="win" style="left:${WIN.x}px;top:${WIN.y}px;width:${WIN.w}px;height:${WIN.h}px">
|
const scanLns = [...scanBody.querySelectorAll(':scope > .ln')], fdEls = [...scanBody.querySelectorAll('.fd')];
|
||||||
<div class="bar"><i></i><i></i><i></i><span class="tt">storebound</span></div>
|
function rejections(t) {
|
||||||
<div class="view"><div class="cam" style="position:absolute;left:0;top:0;width:1280px;height:800px;transform-origin:0 0">
|
const s = scene('rejections'); if (t < s.start - 1 || t > s.end + 1) return;
|
||||||
${img(d.empty ?? d.frame)}
|
const r = t - s.start;
|
||||||
${d.empty ? `<div class="clip c1">${img(d.frame)}</div><div class="clip c2">${img(d.frame)}</div>` : ''}
|
appear($('#scanterm'), r, 0.0, 0.4, 14);
|
||||||
${d.clean ? `<div class="clip cl">${img(d.clean)}</div><div class="scanline" style="width:1280px"></div>` : ''}
|
appear(scanLns[0], r, 0.25, 0.25, 4);
|
||||||
</div></div></div>
|
appear(scanLns[1], r, 0.6, 0.3, 6);
|
||||||
<div class="ring${d.clean ? ' green' : ''}"></div><div class="callout${d.clean ? ' green' : ''}">${esc(d.callout.text)}</div>`;
|
fdEls.forEach((el, i) => {
|
||||||
desk[id] = { el, d, win: el.querySelector('.win'), cam: el.querySelector('.cam'), c1: el.querySelector('.c1'), c2: el.querySelector('.c2'),
|
appear(el, r, FINDINGS[i].at, 0.4, 10);
|
||||||
cl: el.querySelector('.cl'), line: el.querySelector('.scanline'), ring: el.querySelector('.ring'), callout: el.querySelector('.callout') };
|
const f = prog(r, FIX_AT[i], 0.45);
|
||||||
|
set(el.querySelector('.tint.g'), 'opacity', String(eoc(f)));
|
||||||
|
set(el.querySelector('.tint.b'), 'opacity', String(1 - eoc(f)));
|
||||||
|
set(el.querySelector('.fixed'), 'opacity', String(eoc(f)));
|
||||||
|
set(el.querySelector('.why .pi'), 'color', f > 0.5 ? 'var(--green)' : 'var(--red)');
|
||||||
|
});
|
||||||
|
appear(scanLns[2], r, RESCAN_AT, 0.3, 6);
|
||||||
|
appear(scanLns[3], r, RESCAN_AT + 0.35, 0.3, 6);
|
||||||
}
|
}
|
||||||
const pct = v => `${(v * 100).toFixed(3)}%`;
|
|
||||||
/** Camera of a desktop scene at r seconds: image scale and offset inside the window view. */
|
// ---------- 8 desktop: real frames in a window, the camera pushes from the timeline to the readiness card ----------
|
||||||
function deskCam(d, r, len) {
|
const BOXES = await fetch('out/desktop/boxes.json').then(r => { if (!r.ok) throw new Error('out/desktop/boxes.json missing (bun media/teaser/desktop.ts)'); return r.json(); });
|
||||||
const p = eio(clamp(r / len));
|
const WIN = { x: 370, y: 236, w: 1180, bar: 40 };
|
||||||
// the vertical window shows a portrait crop of the landscape app: a gentler push, and the Checks card kept whole-ish
|
const VIEW = { w: WIN.w, h: WIN.w * 800 / 1280 };
|
||||||
const zk = V ? 0.45 : 1, fxv = V && d.clean ? 0.6 : null;
|
WIN.h = VIEW.h + WIN.bar;
|
||||||
const z = 1 + (lerp(d.from.z, d.to.z, p) - 1) * zk, fx = fxv ?? lerp(d.from.f[0], d.to.f[0], p), fy = lerp(d.from.f[1], d.to.f[1], p);
|
const S0 = VIEW.w / 1280;
|
||||||
const S = S0 * z;
|
const deskCam = $('#s-desktop > .cam');
|
||||||
|
deskCam.innerHTML = `<div class="win" style="left:${WIN.x}px;top:${WIN.y}px;width:${WIN.w}px;height:${WIN.h}px">
|
||||||
|
<div class="bar"><i></i><i></i><i></i><span class="tt">storebound</span></div>
|
||||||
|
<div class="view"><div class="cam2">${DESKTOP.frames.map((f, i) => `<img src="out/desktop/${f}.jpg" alt="" data-i="${i}">`).join('')}</div></div></div>
|
||||||
|
${DESKTOP.callouts.map(c => `<div class="ring${c.green ? ' green' : ''}"></div><div class="callout${c.green ? ' green' : ''}">${esc(c.text)}</div>`).join('')}`;
|
||||||
|
const cam2 = $('#s-desktop .cam2'), frameEls = [...cam2.querySelectorAll('img')];
|
||||||
|
const rings = [...deskCam.querySelectorAll('.ring')], callouts = [...deskCam.querySelectorAll('.callout')];
|
||||||
|
function deskView(r) {
|
||||||
|
const s = scene('desktop'), len = s.end - s.start;
|
||||||
|
const p = ess(clamp((r + DISSOLVE / 2) / (len + DISSOLVE)));
|
||||||
|
const { from, to } = DESKTOP.cam;
|
||||||
|
const S = S0 * lerp(from.z, to.z, p), fx = lerp(from.f[0], to.f[0], p), fy = lerp(from.f[1], to.f[1], p);
|
||||||
const ox = clamp(VIEW.w / 2 - fx * 1280 * S, VIEW.w - 1280 * S, 0), oy = clamp(VIEW.h / 2 - fy * 800 * S, VIEW.h - 800 * S, 0);
|
const ox = clamp(VIEW.w / 2 - fx * 1280 * S, VIEW.w - 1280 * S, 0), oy = clamp(VIEW.h / 2 - fy * 800 * S, VIEW.h - 800 * S, 0);
|
||||||
return { S, ox, oy };
|
return { S, ox, oy };
|
||||||
}
|
}
|
||||||
/** A boxes.json entry in stage pixels for the current camera (plus the window's own transform, applied by the caller). */
|
const stageBox = (b, c) => ({ x: WIN.x + c.ox + b.x * 1280 * c.S, y: WIN.y + WIN.bar + c.oy + b.y * 800 * c.S, w: b.w * 1280 * c.S, h: b.h * 800 * c.S });
|
||||||
const stageBox = (b, c) => ({ x: WIN.x + c.ox + b.x * 1280 * c.S, y: WIN.y + 44 + c.oy + b.y * 800 * c.S, w: b.w * 1280 * c.S, h: b.h * 800 * c.S });
|
|
||||||
const cursorEl = $('#cursor'), clickEl = $('#click');
|
|
||||||
let cursorShown = false;
|
|
||||||
function cursorAt(x, y, op, press = 0) {
|
|
||||||
cursorShown = op > 0;
|
|
||||||
set(cursorEl, 'opacity', String(op));
|
|
||||||
set(cursorEl, 'transform', `translate(${(x - 10).toFixed(1)}px, ${(y - 10).toFixed(1)}px) scale(${(1 - 0.14 * press).toFixed(3)})`);
|
|
||||||
}
|
|
||||||
function desktop(t) {
|
function desktop(t) {
|
||||||
for (const [id, k] of Object.entries(desk)) {
|
const s = scene('desktop'); if (t < s.start - 1 || t > s.end + 1) return;
|
||||||
const s = scene(id), d = k.d, r = t - s.start, len = s.end - s.start;
|
const r = t - s.start;
|
||||||
if (t < s.start - 0.2 || t > s.end + 0.5) continue;
|
const c = deskView(r);
|
||||||
const c = deskCam(d, r, len + 0.3);
|
set(cam2, 'transform', `translate(${c.ox.toFixed(2)}px, ${c.oy.toFixed(2)}px) scale(${c.S.toFixed(5)})`);
|
||||||
set(k.cam, 'transform', `translate(${c.ox.toFixed(2)}px, ${c.oy.toFixed(2)}px) scale(${(c.S).toFixed(5)})`);
|
const sw = eio(prog(r, DESKTOP.swap[0], DESKTOP.swap[1] - DESKTOP.swap[0]));
|
||||||
if (k.c1) {
|
set(frameEls[1], 'opacity', String(sw));
|
||||||
const p = eio(prog(r, d.fill[0], d.fill[1] - d.fill[0]));
|
DESKTOP.callouts.forEach((co, i) => {
|
||||||
for (const [el, b] of [[k.c1, BOXES.roll], [k.c2, BOXES.roll2]]) {
|
const b = stageBox(BOXES[co.target], c);
|
||||||
set(el, 'clipPath', `inset(${pct(b.y)} ${pct(1 - b.x - b.w * p)} ${pct(1 - b.y - b.h)} ${pct(b.x)})`);
|
const op = eoc(prog(r, co.at, 0.4)) * (1 - prog(r, co.until - 0.3, 0.3));
|
||||||
}
|
const ring = rings[i], call = callouts[i];
|
||||||
}
|
const x0 = Math.max(b.x - 10, WIN.x + 8), y0 = Math.max(b.y - 10, WIN.y + WIN.bar + 6);
|
||||||
if (k.cl) {
|
const x1 = Math.min(b.x + b.w + 10, WIN.x + WIN.w - 8), y1 = Math.min(b.y + b.h + 10, WIN.y + WIN.h - 8);
|
||||||
const p = eio(prog(r, d.flip, 0.5));
|
set(ring, 'opacity', String(op));
|
||||||
set(k.cl, 'clipPath', `inset(0 0 ${pct(1 - p)} 0)`);
|
set(ring, 'left', `${x0.toFixed(1)}px`); set(ring, 'top', `${y0.toFixed(1)}px`);
|
||||||
set(k.line, 'opacity', String(p > 0 && p < 1 ? 1 : 0));
|
set(ring, 'width', `${(x1 - x0).toFixed(1)}px`); set(ring, 'height', `${(y1 - y0).toFixed(1)}px`);
|
||||||
set(k.line, 'top', `${(p * 800 - 3).toFixed(1)}px`);
|
const cw = call.offsetWidth;
|
||||||
}
|
const cx = clamp((x0 + x1) / 2, 60 + cw / 2, W - 60 - cw / 2);
|
||||||
// the window itself: a gentle settle
|
const below = y1 + 90 < WIN.y + WIN.h;
|
||||||
const we = eoc(prog(r, 0, 0.6));
|
set(call, 'opacity', String(op));
|
||||||
set(k.win, 'transform', `scale(${lerp(0.97, 1, we).toFixed(4)})`);
|
set(call, 'left', `${cx.toFixed(1)}px`);
|
||||||
// callout + ring on the target
|
set(call, 'top', `${(below ? y1 + 24 : y0 - 24).toFixed(1)}px`);
|
||||||
const b = BOXES[d.callout.target];
|
set(call, 'transform', `translate(-50%, ${below ? '0' : '-100%'}) scale(${lerp(0.92, 1, eoc(prog(r, co.at, 0.4))).toFixed(3)})`);
|
||||||
const sb = stageBox(b, c);
|
|
||||||
const cp = prog(r, d.callout.at, 0.34);
|
|
||||||
const ring = k.ring;
|
|
||||||
set(ring, 'opacity', String(clamp(cp * 2)));
|
|
||||||
// the ring stays inside the window
|
|
||||||
const rx0 = Math.max(sb.x - 10, WIN.x + 8), ry0 = Math.max(sb.y - 10, WIN.y + 52);
|
|
||||||
const rx1 = Math.min(sb.x + sb.w + 10, WIN.x + WIN.w - 8), ry1 = Math.min(sb.y + sb.h + 10, WIN.y + WIN.h - 8);
|
|
||||||
set(ring, 'left', `${rx0.toFixed(1)}px`); set(ring, 'top', `${ry0.toFixed(1)}px`);
|
|
||||||
set(ring, 'width', `${(rx1 - rx0).toFixed(1)}px`); set(ring, 'height', `${(ry1 - ry0).toFixed(1)}px`);
|
|
||||||
set(ring, 'transform', `scale(${lerp(1.15, 1, eoc(cp)).toFixed(3)})`);
|
|
||||||
let text = d.callout.text;
|
|
||||||
if (d.fill) text = `Rollout · ${Math.round(20 * eio(prog(r, d.fill[0], d.fill[1] - d.fill[0])))}%`;
|
|
||||||
html(k.callout, esc(text));
|
|
||||||
const cw = k.callout.offsetWidth;
|
|
||||||
const cx = clamp(sb.x + sb.w / 2, W * 0.1 + cw / 2, W * 0.9 - cw / 2);
|
|
||||||
const above = sb.y - 30 > WIN.y + 90;
|
|
||||||
const cy = above ? sb.y - 26 : sb.y + sb.h + 26 + 70;
|
|
||||||
set(k.callout, 'opacity', String(clamp(cp * 2.5)));
|
|
||||||
set(k.callout, 'left', `${cx.toFixed(1)}px`); set(k.callout, 'top', `${cy.toFixed(1)}px`);
|
|
||||||
set(k.callout, 'transform', `translate(-50%, -100%) scale(${lerp(0.5, 1, eob(cp)).toFixed(3)})`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/** The cursor: in the desktop scenes and over the Submit button. */
|
|
||||||
function cursor(t) {
|
|
||||||
const s = active(t);
|
|
||||||
set(clickEl, 'opacity', '0');
|
|
||||||
if (desk[s.id]) {
|
|
||||||
const k = desk[s.id], d = k.d, r = t - s.start;
|
|
||||||
const c = deskCam(d, r, s.end - s.start + 0.3);
|
|
||||||
const [[a0], [a1, target]] = d.cursor;
|
|
||||||
const b = stageBox(BOXES[target], c);
|
|
||||||
const tx = b.x + b.w * (target === 'roll' ? 0.35 : 0.5), ty = b.y + b.h * 0.6;
|
|
||||||
const sx = W * 0.92, sy = WIN.y + WIN.h * 0.95;
|
|
||||||
const p = eio(prog(r, a0, a1 - a0));
|
|
||||||
const arc = Math.sin(Math.PI * p) * 70;
|
|
||||||
const x = lerp(sx, tx, p) + arc * 0.4, y = lerp(sy, ty, p) - arc;
|
|
||||||
const op = prog(r, a0 - 0.15, 0.15) * (1 - prog(t, s.end - 0.12, 0.12));
|
|
||||||
let press = 0;
|
|
||||||
if (id3(s.id)) {
|
|
||||||
press = decay(r, a1 + 0.02, 0.22);
|
|
||||||
const cp = prog(r, a1 + 0.02, 0.4);
|
|
||||||
if (cp > 0 && cp < 1) {
|
|
||||||
set(clickEl, 'opacity', String(0.9 * (1 - cp)));
|
|
||||||
set(clickEl, 'transform', `translate(${tx.toFixed(1)}px, ${ty.toFixed(1)}px) scale(${lerp(0.3, 1.4, eoc(cp)).toFixed(3)})`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cursorAt(x, y, op, press);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (s.id === 'submit') {
|
|
||||||
const btn = $('#sbtn').getBoundingClientRect();
|
|
||||||
const tx = btn.left + btn.width * 0.62, ty = btn.top + btn.height * 0.62;
|
|
||||||
const a0 = s.start + 0.35;
|
|
||||||
const p = eio(prog(t, a0, SUBMIT_HOVER - a0));
|
|
||||||
const arc = Math.sin(Math.PI * p) * 80;
|
|
||||||
// it stops on the button and waits: no click
|
|
||||||
const hes = Math.sin(Math.max(0, t - SUBMIT_HOVER) * 3.2) * 6 * prog(t, SUBMIT_HOVER, 0.4);
|
|
||||||
cursorAt(lerp(W * 0.9, tx, p) + arc * 0.3 + hes, lerp(H * 0.95, ty, p) - arc, prog(t, a0, 0.15) * (1 - prog(t, s.end - 0.15, 0.15)));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (cursorShown) cursorAt(0, 0, 0);
|
|
||||||
}
|
|
||||||
const id3 = id => id === 'desk3';
|
|
||||||
|
|
||||||
// ---------- more: three panels of real CLI output, a cut on the beat between them ----------
|
|
||||||
const moreEl = $('#s-more');
|
|
||||||
const MC = V ? { x: 60, w: 960, top: 640, stat: 1010 } : { x: 260, w: 1400, top: 370, stat: 740 };
|
|
||||||
/** Colour the real text without changing it: counts white, [ok] green, [check] yellow, the dry-run verdict green. */
|
|
||||||
const moreLine = l => esc(l)
|
|
||||||
.replace(/^(\[ok\])/, '<span class="ok">$1</span>').replace(/^(\[check\])/, '<span class="ask">$1</span>')
|
|
||||||
.replace(/(\d+ operations)/, '<span class="n">$1</span>').replace(/(: )(Yes)$/, '$1<span class="n">$2</span>')
|
|
||||||
.replace(/^(build planned \(dry run\))$/, '<span class="ok">$1</span>');
|
|
||||||
moreEl.innerHTML = MORE.map(p => `<div class="panel">
|
|
||||||
<div class="card" style="left:${MC.x}px;top:${MC.top}px;width:${MC.w}px"><div class="ch"><span><span class="ps">$</span> ${esc(p.cmd)}</span>${V ? '' : `<span class="sub">${esc(p.sub)}</span>`}</div>
|
|
||||||
<div class="body">${p.lines.map(l => `<span class="ln">${moreLine(l)}</span>`).join('')}</div></div>
|
|
||||||
<div class="pill abs stat" style="left:50%;top:${MC.stat}px${V ? ';white-space:normal;width:max-content;max-width:960px;text-align:center;border-radius:30px;font-size:46px;line-height:1.15' : ';font-size:52px'}">${p.stat.text.split(' ').map(w => w.startsWith('*') ? `<b>${esc(w.replace(/\*/g, ''))}</b>` : esc(w)).join(' ')}</div></div>`).join('');
|
|
||||||
const morePanels = [...moreEl.querySelectorAll('.panel')].map((el, i) => ({
|
|
||||||
el, card: el.querySelector('.card'), lines: [...el.querySelectorAll('.ln')], stat: el.querySelector('.stat'), at: MORE[i].at, until: MORE[i + 1]?.at ?? Infinity,
|
|
||||||
}));
|
|
||||||
function more(t) {
|
|
||||||
const s = scene('more');
|
|
||||||
if (t < s.start - 0.2 || t > s.end + 0.5) return;
|
|
||||||
morePanels.forEach((p, i) => {
|
|
||||||
const on = (i === 0 ? t >= s.start - 0.2 : t >= p.at) && t < p.until;
|
|
||||||
set(p.el, 'visibility', on ? 'visible' : 'hidden');
|
|
||||||
if (!on) return;
|
|
||||||
const r = t - p.at;
|
|
||||||
// the first panel arrives with the scene's whip; the next two cut in with a short push
|
|
||||||
const ce = i === 0 ? 1 : eoq(prog(r, 0, 0.22));
|
|
||||||
set(p.card, 'transform', `translateX(${((1 - ce) * 90).toFixed(1)}px) scale(${lerp(1.05, 1, ce).toFixed(4)})`);
|
|
||||||
p.lines.forEach((el, j) => {
|
|
||||||
const lp = prog(r, (i === 0 ? 0.12 : 0.06) + j * 0.07, 0.18);
|
|
||||||
set(el, 'opacity', String(clamp(lp * 2)));
|
|
||||||
set(el, 'transform', `translateX(${((1 - eoc(lp)) * 30).toFixed(1)}px)`);
|
|
||||||
});
|
|
||||||
const sp = prog(r, 0.3, 0.3);
|
|
||||||
set(p.stat, 'opacity', String(clamp(sp * 2.5)));
|
|
||||||
set(p.stat, 'transform', `translate(-50%, ${((1 - eoc(sp)) * 26).toFixed(1)}px) scale(${lerp(0.85, 1, eob(sp)).toFixed(3)})`);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------- submit + brand ----------
|
// ---------- 9 submit + end card ----------
|
||||||
const sbtn = $('#sbtn'), shov = $('#sbtn .hov');
|
const sbtn = $('#sbtn'), shov = $('#sbtn .hov'), brand = $('#brand'), cursorEl = $('#cursor');
|
||||||
if (V) sbtn.style.top = '980px'; else sbtn.style.top = '560px';
|
brand.querySelector('.url').textContent = URL;
|
||||||
const brandWrap = $('#s-brand .wrap');
|
brand.querySelector('.plat').textContent = TAGLINE;
|
||||||
brandWrap.querySelector('.url').textContent = URL;
|
function submit(t) {
|
||||||
brandWrap.querySelector('.plat').textContent = PLATFORMS;
|
|
||||||
if (!V) { brandWrap.querySelector('.mark').style.width = brandWrap.querySelector('.mark').style.height = '200px'; brandWrap.querySelector('.word').style.fontSize = '130px'; }
|
|
||||||
function endCards(t) {
|
|
||||||
const s = scene('submit');
|
const s = scene('submit');
|
||||||
if (t >= s.start - 0.1 && t < s.end + 0.5) {
|
const r = t - s.start;
|
||||||
const r = t - s.start, e = eob(prog(r, 0.05, 0.45));
|
if (t < s.start - 1) { set(cursorEl, 'opacity', '0'); return; }
|
||||||
const hov = prog(t, SUBMIT_HOVER, 0.15);
|
const hov = prog(r, SUBMIT.hover, 0.25);
|
||||||
set(sbtn, 'transform', `translate(-50%, 0) scale(${(lerp(0.7, 1, e) * (1 + 0.03 * hov)).toFixed(4)})`);
|
const out = prog(r, SUBMIT.logoAt, 0.6);
|
||||||
set(sbtn, 'opacity', String(clamp(prog(r, 0.05, 0.2))));
|
set(sbtn, 'opacity', String(eoc(prog(r, 0.0, 0.4)) * (1 - eio(out))));
|
||||||
|
set(sbtn, 'transform', `translate(-50%, 0) scale(${(lerp(0.96, 1, eoc(prog(r, 0, 0.5))) * (1 + 0.02 * hov)).toFixed(4)})`);
|
||||||
set(shov, 'opacity', String(hov));
|
set(shov, 'opacity', String(hov));
|
||||||
}
|
// the cursor glides in and rests on the button: it never clicks
|
||||||
const b = scene('brand');
|
const btn = sbtn.getBoundingClientRect();
|
||||||
if (t >= b.start - 0.1) {
|
const tx = btn.left + btn.width * 0.64, ty = btn.top + btn.height * 0.66;
|
||||||
const r = t - b.start;
|
const p = eio(prog(r, 0.3, SUBMIT.hover - 0.3));
|
||||||
set(brandWrap, 'transform', `translateY(-50%) scale(${lerp(1.0, 1.04, clamp(r / 4)).toFixed(4)})`);
|
set(cursorEl, 'opacity', String(prog(r, 0.3, 0.3) * (1 - eio(out))));
|
||||||
[...brandWrap.children].forEach((el, i) => {
|
set(cursorEl, 'transform', `translate(${(lerp(W * 0.86, tx, p) - 10).toFixed(1)}px, ${(lerp(H * 0.95, ty, p) - 10).toFixed(1)}px)`);
|
||||||
const p = prog(r, 0.08 + i * 0.16, i === 0 ? 0.5 : 0.36);
|
[...brand.children].forEach((el, i) => {
|
||||||
set(el, 'opacity', String(clamp(p * 2)));
|
const q2 = prog(r, SUBMIT.logoAt + 0.2 + i * 0.18, SUBMIT.logoIn);
|
||||||
set(el, 'transform', i === 0 ? `scale(${lerp(0.4, 1, eob(p)).toFixed(3)}) rotate(${((1 - eoc(p)) * -12).toFixed(2)}deg)` : `translateY(${((1 - eoc(p)) * 40).toFixed(1)}px)`);
|
set(el, 'opacity', String(eoc(q2)));
|
||||||
set(el, 'filter', p < 1 ? `blur(${((1 - eoc(p)) * 12).toFixed(1)}px)` : 'none');
|
set(el, 'transform', `translateY(${((1 - eoc(q2)) * 18).toFixed(1)}px)`);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function seek(t) {
|
function seek(t) {
|
||||||
scenes(t);
|
scenes(t);
|
||||||
background(t);
|
background(t);
|
||||||
hook(t);
|
hook(t);
|
||||||
scan(t);
|
init(t);
|
||||||
fixed(t);
|
plan(t);
|
||||||
shots(t);
|
store(t);
|
||||||
decl(t);
|
products(t);
|
||||||
|
forms(t);
|
||||||
|
rejections(t);
|
||||||
desktop(t);
|
desktop(t);
|
||||||
more(t);
|
submit(t);
|
||||||
endCards(t);
|
|
||||||
cursor(t);
|
|
||||||
captions(t);
|
captions(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
const ready = (async () => {
|
const ready = (async () => {
|
||||||
await document.fonts.ready;
|
await document.fonts.ready;
|
||||||
const imgs = [...document.images, ...GRID.map(f => Object.assign(new Image(), { src: `out/assets/grid/${f}` }))];
|
const imgs = [...document.images];
|
||||||
await Promise.all(imgs.map(im => im.decode().catch(() => { throw new Error(`image failed: ${im.src}`); })));
|
const bgs = [...document.querySelectorAll('.tile')].map(el => Object.assign(new Image(), { src: el.style.backgroundImage.replace(/^url\("?|"?\)$/g, '') }));
|
||||||
|
await Promise.all([...imgs, ...bgs].map(im => im.decode().catch(() => { throw new Error(`image failed: ${im.src}`); })));
|
||||||
seek(0);
|
seek(0);
|
||||||
})();
|
})();
|
||||||
window.teaser = { ready, seek, DURATION, FPS, W, H, BEAT, captionTimes };
|
window.teaser = { ready, seek, DURATION, FPS, W, H, captionTimes };
|
||||||
|
|
||||||
if (q.has('t')) ready.then(() => seek(Number(q.get('t'))));
|
if (q.has('t')) ready.then(() => seek(Number(q.get('t'))));
|
||||||
if (q.has('play')) ready.then(() => {
|
if (q.has('play')) ready.then(() => {
|
||||||
|
|
|
||||||
90
tests/helpers/teaser-store-mock.ts
Normal file
90
tests/helpers/teaser-store-mock.ts
Normal file
|
|
@ -0,0 +1,90 @@
|
||||||
|
// Store double for the teaser's CLI scenes (tests/teaser.test.ts): loaded with `preload` from a bunfig.toml in a temp
|
||||||
|
// project, so every `bun cli/index.ts …` started there (and the children `release plan` starts) answers from here and
|
||||||
|
// never reaches the network. It answers in the shapes App Store Connect and Google Play use (sanitized: placeholder
|
||||||
|
// ids only) for a brand-new app record of the placeholder project:
|
||||||
|
// TEASER_STORE=new the app record exists, nothing else: no version, no build, no listings, no products
|
||||||
|
// TEASER_STORE=catalog the two products of the teaser project exist on both stores, priced in every region
|
||||||
|
// Regions: the App Store's 175 storefronts (ALPHA3 in cli/lib/money.ts); Google Play the same list without mainland
|
||||||
|
// China (Play is not offered there), 174 regions, the count Play answered in a recorded read-only run
|
||||||
|
// (tests/play-post-reads.test.ts). Pages under https://example.com/ (the template's privacy policy and
|
||||||
|
// delete-account URLs) answer 200; any other request answers 599 with its URL.
|
||||||
|
import { ALPHA3, toMoney } from '../../cli/lib/money';
|
||||||
|
import { CURRENCY } from '../../cli/lib/ppp';
|
||||||
|
|
||||||
|
const STATE = process.env.TEASER_STORE ?? 'new';
|
||||||
|
const APP = '6400000101';
|
||||||
|
const ASC = 'https://api.appstoreconnect.apple.com';
|
||||||
|
const json = (o: unknown, status = 200): Response => new Response(JSON.stringify(o), { status, headers: { 'content-type': 'application/json' } });
|
||||||
|
const list = (data: unknown[], included: unknown[] = []): Response => json({ data, included, links: {}, meta: { paging: { total: data.length, limit: 200 } } });
|
||||||
|
|
||||||
|
/** The teaser project's products (the config in tests/teaser.test.ts): id, Apple type, US price. */
|
||||||
|
const PRODUCTS = [
|
||||||
|
{ id: 'com.example.app.no_ads', type: 'NON_CONSUMABLE', usd: 2.99 },
|
||||||
|
{ id: 'com.example.app.gems_100', type: 'CONSUMABLE', usd: 0.99 },
|
||||||
|
];
|
||||||
|
const APPLE_REGIONS = Object.keys(ALPHA3);
|
||||||
|
const PLAY_REGIONS = APPLE_REGIONS.filter(r => r !== 'CN');
|
||||||
|
/** One price per product everywhere (the values are not shown; the same price on both stores, so no parity gaps). */
|
||||||
|
const currency = (r: string): string => CURRENCY[r] ?? 'USD';
|
||||||
|
|
||||||
|
function apple(m: string, p: string): Response {
|
||||||
|
if (/^\/v1\/apps\?filter\[bundleId\]=/.test(p)) return list([{ type: 'apps', id: APP, attributes: { name: 'Example App', bundleId: decodeURIComponent(p.split('=')[1]!), primaryLocale: 'en-US', sku: 'EXAMPLE' } }]);
|
||||||
|
if (p.startsWith(`/v1/apps/${APP}/appInfos`)) return list([{ type: 'appInfos', id: 'info-1', attributes: { appStoreState: 'PREPARE_FOR_SUBMISSION', state: 'PREPARE_FOR_SUBMISSION' } }]);
|
||||||
|
if (STATE === 'catalog') {
|
||||||
|
if (p.startsWith(`/v1/apps/${APP}/inAppPurchasesV2`)) return list(PRODUCTS.map((x, i) => ({ type: 'inAppPurchases', id: `iap-${i}`, attributes: { productId: x.id, name: x.id.split('.').pop(), inAppPurchaseType: x.type, state: 'READY_TO_SUBMIT' } })));
|
||||||
|
const loc = p.match(/^\/v2\/inAppPurchases\/iap-\d\/inAppPurchaseLocalizations/);
|
||||||
|
if (loc) return list(['en-US', 'tr'].map((locale, i) => ({ type: 'inAppPurchaseLocalizations', id: `loc-${i}`, attributes: { locale, name: 'Example', description: 'Example.' } })));
|
||||||
|
const sched = p.match(/^\/v2\/inAppPurchases\/(iap-\d)\/iapPriceSchedule/);
|
||||||
|
if (sched) return json({ data: { type: 'inAppPurchasePriceSchedules', id: sched[1] } });
|
||||||
|
const prices = p.match(/^\/v1\/inAppPurchasePriceSchedules\/iap-(\d)\/(manualPrices|automaticPrices)/);
|
||||||
|
if (prices) {
|
||||||
|
const x = PRODUCTS[Number(prices[1])]!;
|
||||||
|
// US is the base territory (manual); every other storefront is equalized by Apple (automatic)
|
||||||
|
const regions = prices[2] === 'manualPrices' ? ['US'] : APPLE_REGIONS.filter(r => r !== 'US');
|
||||||
|
const data = regions.map(r => ({ type: 'inAppPurchasePrices', id: `price-${r}`, attributes: { startDate: null, endDate: null, manual: r === 'US' },
|
||||||
|
relationships: { inAppPurchasePricePoint: { data: { type: 'inAppPurchasePricePoints', id: `point-${r}` } }, territory: { data: { type: 'territories', id: ALPHA3[r] } } } }));
|
||||||
|
const included = regions.flatMap(r => [
|
||||||
|
{ type: 'inAppPurchasePricePoints', id: `point-${r}`, attributes: { customerPrice: String(x.usd), proceeds: String(x.usd * 0.85) } },
|
||||||
|
{ type: 'territories', id: ALPHA3[r], attributes: { currency: currency(r) } },
|
||||||
|
]);
|
||||||
|
return list(data, included);
|
||||||
|
}
|
||||||
|
if (/^\/v1\/inAppPurchasePriceSchedules\/iap-\d\/baseTerritory/.test(p)) return json({ data: { type: 'territories', id: 'USA', attributes: { currency: 'USD' } } });
|
||||||
|
}
|
||||||
|
if (m === 'GET') return list([]);
|
||||||
|
return json({ errors: [{ status: '599', detail: `teaser store double: no route for ${m} ${p}` }] }, 599);
|
||||||
|
}
|
||||||
|
|
||||||
|
function play(m: string, url: string): Response {
|
||||||
|
if (m === 'POST' && /\/edits$/.test(url)) return json({ id: 'edit-1', expiryTimeSeconds: '9999999999' });
|
||||||
|
if (m === 'DELETE') return new Response(null, { status: 204 });
|
||||||
|
if (/\/edits\/edit-1\/tracks$/.test(url)) return json({ kind: 'androidpublisher#tracksListResponse', tracks: [] });
|
||||||
|
if (/\/edits\/edit-1\/listings$/.test(url)) return json({ kind: 'androidpublisher#listingsListResponse' });
|
||||||
|
if (m === 'POST' && /\/pricing:convertRegionPrices$/.test(url)) return json({
|
||||||
|
convertedRegionPrices: Object.fromEntries(PLAY_REGIONS.map(r => [r, { regionCode: r, price: toMoney(currency(r), 1.99), taxAmount: toMoney(currency(r), 0) }])),
|
||||||
|
convertedOtherRegionsPrice: { usdPrice: toMoney('USD', 1.99), eurPrice: toMoney('EUR', 1.99) },
|
||||||
|
regionVersion: { version: '2022/02' },
|
||||||
|
});
|
||||||
|
const product = (x: (typeof PRODUCTS)[number]) => ({
|
||||||
|
packageName: 'com.example.app', productId: x.id,
|
||||||
|
listings: [{ languageCode: 'en-US', title: 'Example', description: 'Example.' }, { languageCode: 'tr-TR', title: 'Example', description: 'Example.' }],
|
||||||
|
purchaseOptions: [{ purchaseOptionId: 'buy', state: 'ACTIVE', buyOption: { legacyCompatible: true },
|
||||||
|
regionalPricingAndAvailabilityConfigs: PLAY_REGIONS.map(r => ({ regionCode: r, availability: 'AVAILABLE', price: toMoney(currency(r), x.usd) })) }],
|
||||||
|
});
|
||||||
|
if (/\/oneTimeProducts\?pageSize=/.test(url)) return json(STATE === 'catalog' ? { oneTimeProducts: PRODUCTS.map(product) } : {});
|
||||||
|
const one = url.match(/\/oneTimeProducts\/([^/?]+)$/);
|
||||||
|
if (one) { const x = PRODUCTS.find(p => p.id === decodeURIComponent(one[1]!)); return x && STATE === 'catalog' ? json(product(x)) : json({ error: { code: 404, message: 'not found', status: 'NOT_FOUND' } }, 404); }
|
||||||
|
if (/\/subscriptions\?pageSize=/.test(url)) return json({});
|
||||||
|
if (m === 'GET') return json({});
|
||||||
|
return json({ error: { code: 599, message: `teaser store double: no route for ${m} ${url}` } }, 599);
|
||||||
|
}
|
||||||
|
|
||||||
|
globalThis.fetch = (async (input: string | URL | Request, init?: RequestInit) => {
|
||||||
|
const url = String(input instanceof Request ? input.url : input);
|
||||||
|
const m = (init?.method ?? (input instanceof Request ? input.method : 'GET')).toUpperCase();
|
||||||
|
if (url.startsWith('https://oauth2.googleapis.com/token')) return json({ access_token: 'ya29.example', expires_in: 3600 });
|
||||||
|
if (url.startsWith(ASC)) return apple(m, url.slice(ASC.length));
|
||||||
|
if (url.startsWith('https://androidpublisher.googleapis.com/')) return play(m, url);
|
||||||
|
if (url.startsWith('https://example.com/')) return new Response('<!doctype html><title>Example</title><p>Example page.</p>', { status: 200, headers: { 'content-type': 'text/html' } });
|
||||||
|
return new Response(`teaser store double: no route for ${m} ${url}`, { status: 599 });
|
||||||
|
}) as typeof fetch;
|
||||||
|
|
@ -1,140 +1,184 @@
|
||||||
// The teaser video (media/teaser): the scan text it shows is the real `storebound scan` output of the teaser fixtures,
|
// The teaser video (media/teaser, v4): every CLI line it shows is real output of the command it names, each scene holds
|
||||||
// every cut sits on the beat grid, every caption is short and stays readable, every scene holds long enough.
|
// 6-7 s, each caption is fully on screen for at least 4 s, the whole cut is 55-65 s, and it is 16:9 only.
|
||||||
import { beforeAll, describe, expect, test } from 'bun:test';
|
import { afterAll, beforeAll, describe, expect, test } from 'bun:test';
|
||||||
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs';
|
import { generateKeyPairSync } from 'node:crypto';
|
||||||
|
import { mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
||||||
import { tmpdir } from 'node:os';
|
import { tmpdir } from 'node:os';
|
||||||
import { join } from 'node:path';
|
import { join } from 'node:path';
|
||||||
|
import { ALPHA3 } from '../cli/lib/money';
|
||||||
|
import { SIZES } from '../cli/shots/lib';
|
||||||
|
|
||||||
const ROOT = join(import.meta.dir, '..');
|
const ROOT = join(import.meta.dir, '..');
|
||||||
const CLI = join(ROOT, 'cli', 'index.ts');
|
const CLI = join(ROOT, 'cli', 'index.ts');
|
||||||
const FX = join(import.meta.dir, 'fixtures', 'scan');
|
const FX = join(import.meta.dir, 'fixtures', 'scan');
|
||||||
|
const MOCK = join(import.meta.dir, 'helpers', 'teaser-store-mock.ts');
|
||||||
|
|
||||||
interface Scene { id: string; from: number; to: number; start: number; end: number; in: string | null }
|
interface Scene { id: string; start: number; end: number }
|
||||||
interface Finding { sev: string; guideline: string; title: string; where: string; fix: string; skill: string }
|
|
||||||
interface Teaser {
|
interface Teaser {
|
||||||
BEAT: number; DURATION: number; SCENES: Scene[];
|
FORMAT: { w: number; h: number }; DURATION: number; SCENES: Scene[]; DISSOLVE: number;
|
||||||
CAPTIONS: { id: string; lines: string[] }[];
|
CAPTIONS: { id: string; lines: string[] }[];
|
||||||
captionTimes(): { id: string; words: string; count: number; at: number; from: number; to: number; hold: number }[];
|
captionTimes(): { id: string; text: string; at: number; from: number; to: number; hold: number }[];
|
||||||
SCAN_HEAD: { text: string }[]; SDKS: { name: string; what: string; dep: string; where: string }[];
|
TODO: { text: string }[]; MAIL: { at: number; subject: string; guideline: string }; MAIL_IN: number;
|
||||||
RISKS_LINE: string; FINDINGS: Finding[]; RESCAN_LINE: string; RESCAN_NONE: string;
|
INIT_CMD: string; INIT_LINES: string[];
|
||||||
DECL_LINES: { what: string; value: string; where: string }[]; DECL_ASK: string; CMD: string;
|
PLAN_CMD: string; PLAN_LINES: string[]; PLAN_STEPS: number; PLAN_PILL: string;
|
||||||
MORE: { at: number; cmd: string; lines: string[]; stat: { text: string } }[]; MORE_CUTS: number[];
|
COPY_FILE: string; COPY: { lang: string; title: string[] }[]; SHOT_SIZES: { id: string }[]; SHOT_LANGS: string[]; SHOTS_PILL: string;
|
||||||
|
PRODUCT_LINES: { text: string; cmd?: boolean }[]; PRODUCTS_PILL: { text: string };
|
||||||
|
DECL_LINES: { what: string; value: string; where: string }[]; DECL_ASK: string; DECL_TOTAL: number;
|
||||||
|
SCAN_CMD: string; RISKS_LINE: string; RESCAN_LINE: string;
|
||||||
|
FINDINGS: { sev: string; guideline: string; title: string; where: string; why: string }[];
|
||||||
}
|
}
|
||||||
const path: string = join(ROOT, 'media/teaser/script.js');
|
const T = (await import(join(ROOT, 'media/teaser/script.js'))) as Teaser;
|
||||||
const T = (await import(path)) as Teaser;
|
|
||||||
|
|
||||||
const scanText = (dir: string, demo: boolean): string => {
|
/** Output lines without the clock prefix and the "(0s)" timer, as the video shows them. */
|
||||||
const env = { ...process.env, NO_COLOR: '1', REVIEW_DEMO_USER: demo ? 'demo@example.com' : '', REVIEW_DEMO_PASSWORD: demo ? 'example' : '' };
|
const lines = (out: string): string[] => out.split('\n').map(l => l.replace(/^\d\d:\d\d:\d\d /, '').replace(/ \(\d+s\)$/, '').trimEnd());
|
||||||
const r = Bun.spawnSync(['bun', CLI, 'scan', '--dir', join(FX, dir)], { env, stdout: 'pipe', stderr: 'pipe' });
|
const run = (argv: string[], cwd: string, env: Record<string, string> = {}): { code: number; out: string } => {
|
||||||
// exit code 1 when blockers are found (the fixture before the fixes), 0 after
|
const r = Bun.spawnSync(['bun', CLI, ...argv], { cwd, env: { ...process.env, NO_COLOR: '1', ASC_KEY_ID: '', ASC_ISSUER_ID: '', ASC_P8: '', PLAY_SERVICE_ACCOUNT: '', ...env }, stdout: 'pipe', stderr: 'pipe' });
|
||||||
expect(r.exitCode).toBe(demo ? 0 : 1);
|
return { code: r.exitCode, out: r.stdout.toString() + r.stderr.toString() };
|
||||||
return r.stdout.toString() + r.stderr.toString();
|
|
||||||
};
|
};
|
||||||
let before = '', after = '';
|
|
||||||
beforeAll(() => { before = scanText('teaser', false); after = scanText('teaser-fixed', true); });
|
|
||||||
|
|
||||||
/** Runs a CLI command as the montage shows it (`storebound …` -> bun cli/index.ts …), offline, no store keys. */
|
// One throwaway project for the init, plan and products scenes: `storebound init` in an empty folder, store answers
|
||||||
const run = (cmd: string, cwd: string): string => {
|
// from the teaser store double (tests/helpers/teaser-store-mock.ts, preloaded through bunfig.toml), placeholder keys.
|
||||||
const env = { ...process.env, NO_COLOR: '1', ASC_KEY_ID: '', ASC_ISSUER_ID: '', ASC_P8: '', PLAY_SERVICE_ACCOUNT: '' };
|
let dir = '', initOut = '', keys: Record<string, string> = {};
|
||||||
const r = Bun.spawnSync(['bun', CLI, ...cmd.replace(/^storebound /, '').split(' ')], { cwd, env, stdout: 'pipe', stderr: 'pipe' });
|
beforeAll(() => {
|
||||||
expect(r.exitCode, cmd).toBe(0);
|
dir = mkdtempSync(join(tmpdir(), 'sb-teaser-'));
|
||||||
return r.stdout.toString() + r.stderr.toString();
|
initOut = run(['init'], dir).out;
|
||||||
};
|
writeFileSync(join(dir, 'bunfig.toml'), `preload = [${JSON.stringify(MOCK)}]\n`);
|
||||||
/** A throwaway Capacitor project with an example.com config (as in tests/build-sign.test.ts) for `play build --dry`. */
|
const ec = generateKeyPairSync('ec', { namedCurve: 'P-256' }).privateKey.export({ type: 'pkcs8', format: 'pem' }).toString();
|
||||||
function buildProject(): string {
|
const rsa = generateKeyPairSync('rsa', { modulusLength: 2048 }).privateKey.export({ type: 'pkcs8', format: 'pem' }).toString();
|
||||||
const d = mkdtempSync(join(tmpdir(), 'sb-teaser-'));
|
writeFileSync(join(dir, 'k.p8'), ec);
|
||||||
const put = (f: string, body = ''): void => { mkdirSync(join(d, f, '..'), { recursive: true }); writeFileSync(join(d, f), body); };
|
writeFileSync(join(dir, 'sa.json'), JSON.stringify({ client_email: 'sb@example.com', private_key: rsa, token_uri: 'https://oauth2.googleapis.com/token' }));
|
||||||
put('storebound.config.ts', `export default { app: { name: 'Example', privacyPolicyUrl: 'https://example.com/p', supportUrl: 'https://example.com', website: 'https://example.com', contactEmail: 'hi@example.com' },
|
keys = { ASC_KEY_ID: 'ABCDE12345', ASC_ISSUER_ID: '00000000-0000-0000-0000-000000000000', ASC_P8: join(dir, 'k.p8'), PLAY_SERVICE_ACCOUNT: join(dir, 'sa.json') };
|
||||||
languages: [{ id: 'en', apple: 'en-US', play: 'en-US' }], apple: { bundleId: 'com.example.game' }, play: { packageName: 'com.example.game' } };\n`);
|
});
|
||||||
put('capacitor.config.ts', 'export default {}');
|
afterAll(() => rmSync(dir, { recursive: true, force: true }));
|
||||||
put('android/settings.gradle'); put('android/gradlew', '#!/bin/sh'); put('android/app/build.gradle');
|
|
||||||
return d;
|
|
||||||
}
|
|
||||||
|
|
||||||
describe('teaser: the CLI montage is real output', () => {
|
describe('teaser: every CLI line is real output', () => {
|
||||||
test('three panels, two cuts on the beat', () => {
|
test('init: `storebound init` in an empty folder', () => {
|
||||||
expect(T.MORE).toHaveLength(3);
|
expect(T.INIT_CMD).toBe('bunx storebound init');
|
||||||
expect(T.MORE_CUTS).toEqual([T.MORE[1]!.at, T.MORE[2]!.at]);
|
const out = lines(initOut);
|
||||||
const s = T.SCENES.find(x => x.id === 'more')!;
|
for (const l of T.INIT_LINES) expect(out, l).toContain(l);
|
||||||
expect(T.MORE[0]!.at).toBe(s.start);
|
|
||||||
for (const t of T.MORE_CUTS) { expect(t).toBeGreaterThan(s.start); expect(t).toBeLessThan(s.end); }
|
|
||||||
});
|
});
|
||||||
test('`storebound api coverage`: the operation counts (revision dates left out)', () => {
|
|
||||||
const p = T.MORE[0]!;
|
test('plan: `storebound release plan 1.0.0` against a brand-new app record on both stores', () => {
|
||||||
expect(p.cmd).toBe('storebound api coverage');
|
expect(T.PLAN_CMD).toBe('storebound release plan 1.0.0');
|
||||||
const out = run(p.cmd, ROOT).replace(/ \(\d{8}\)/g, '');
|
const r = run(T.PLAN_CMD.split(' ').slice(1), dir, { ...keys, TEASER_STORE: 'new' });
|
||||||
for (const l of p.lines) expect(out).toContain(l);
|
const out = lines(r.out);
|
||||||
const ops = (name: string): number => Number(out.match(new RegExp(`${name}[^:\n]*: (\\d+) operations`))![1]);
|
for (const l of T.PLAN_LINES) expect(out, l).toContain(l);
|
||||||
const apple = ops('App Store Connect API'), play = ops('Google Play Android Developer API') + ops('Google Play Developer Reporting API');
|
// the lines keep the order of the real plan
|
||||||
expect(p.stat.text).toBe(`*${apple}* App Store Connect + *${play}* Google Play endpoints`);
|
const idx = T.PLAN_LINES.map(l => out.indexOf(l));
|
||||||
|
expect([...idx].sort((a, b) => a - b)).toEqual(idx);
|
||||||
|
const steps = out.filter(l => /^\s+\d+\. /.test(l)).length;
|
||||||
|
expect(steps).toBe(T.PLAN_STEPS);
|
||||||
|
expect(T.PLAN_PILL).toStartWith(`*${steps}* steps`);
|
||||||
|
expect(r.out).not.toContain('could not be read');
|
||||||
});
|
});
|
||||||
test('`storebound play build --dry`: the plan (clock and [build] prefix left out, the gradle flags trimmed)', () => {
|
|
||||||
const p = T.MORE[1]!;
|
test('products: `play products --dry` before, `catalog diff` after, with two products in the config', () => {
|
||||||
expect(p.cmd).toStartWith('storebound play build --dry');
|
const cfg = join(dir, 'storebound.config.ts');
|
||||||
const d = buildProject();
|
const src = readFileSync(cfg, 'utf8');
|
||||||
|
writeFileSync(cfg, src.replace(' dataSafety: {', ` products: [
|
||||||
|
{ id: 'com.example.app.no_ads', type: 'non_consumable', usd: 2.99, listings: { en: { title: 'No Ads', description: 'Removes every ad.' }, tr: { title: 'Reklamsız', description: 'Tüm reklamları kaldırır.' } } },
|
||||||
|
{ id: 'com.example.app.gems_100', type: 'consumable', usd: 0.99, listings: { en: { title: '100 Gems', description: 'A pouch of 100 gems.' }, tr: { title: '100 Mücevher', description: '100 mücevherlik bir kese.' } } },
|
||||||
|
],
|
||||||
|
dataSafety: {`));
|
||||||
try {
|
try {
|
||||||
const out = run(p.cmd, d).split('\n').map(l => l.replace(/^\d\d:\d\d:\d\d \[build\] /, '').replace(/ \(\d+s\)$/, ''));
|
const cmds = T.PRODUCT_LINES.filter(l => l.cmd).map(l => l.text.replace(/^\$ storebound /, ''));
|
||||||
for (const l of p.lines) expect(out.some(o => o.startsWith(l)), l).toBe(true);
|
expect(cmds).toEqual(['play products --dry', 'catalog diff']);
|
||||||
} finally { rmSync(d, { recursive: true, force: true }); }
|
const before = run(cmds[0]!.split(' '), dir, { ...keys, TEASER_STORE: 'new' });
|
||||||
|
const after = run(cmds[1]!.split(' '), dir, { ...keys, TEASER_STORE: 'catalog' });
|
||||||
|
expect(before.code).toBe(0);
|
||||||
|
expect(after.code).toBe(0);
|
||||||
|
const out = [...lines(before.out), ...lines(after.out)];
|
||||||
|
for (const l of T.PRODUCT_LINES.filter(x => !x.cmd)) expect(out, l.text).toContain(l.text);
|
||||||
|
// the pill's numbers are the region counts above, and the App Store's 175 storefronts
|
||||||
|
expect(Object.keys(ALPHA3)).toHaveLength(175);
|
||||||
|
expect(T.PRODUCTS_PILL.text).toContain('*175* App Store regions');
|
||||||
|
expect(T.PRODUCTS_PILL.text).toContain('*174* Google Play regions');
|
||||||
|
expect(out.join('\n')).toContain('0 mismatch(es), 0 warning(s), 0 price difference(s)');
|
||||||
|
} finally { writeFileSync(cfg, src); }
|
||||||
});
|
});
|
||||||
test('`storebound console fill apple-app-privacy --dry` in examples/demo-app: answer lines (source column left out)', () => {
|
|
||||||
const p = T.MORE[2]!;
|
test('forms: the Data safety answer count of `storebound check`', () => {
|
||||||
expect(p.cmd).toBe('storebound console fill apple-app-privacy --dry');
|
expect(run(['check'], dir).out).toContain(`data safety: ${T.DECL_TOTAL} CSV rows`);
|
||||||
const out = run(p.cmd, join(ROOT, 'examples/demo-app')).split('\n').map(l => l.trim().replace(/\s+\([^()]*\)$/, ''));
|
|
||||||
for (const l of p.lines) expect(out).toContain(l);
|
|
||||||
expect(out.join('\n')).toContain('press Publish yourself');
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('teaser: the scan text is real', () => {
|
describe('teaser: the scan text is real', () => {
|
||||||
test('command, header, SDKs and the risks line come from `storebound scan` of tests/fixtures/scan/teaser', () => {
|
const scanText = (fixture: string, demo: boolean): string => {
|
||||||
expect(T.CMD).toBe('storebound scan');
|
const env = { REVIEW_DEMO_USER: demo ? 'demo@example.com' : '', REVIEW_DEMO_PASSWORD: demo ? 'example' : '' };
|
||||||
for (const l of T.SCAN_HEAD) expect(before).toContain(l.text);
|
const r = run(['scan', '--dir', join(FX, fixture)], ROOT, env);
|
||||||
for (const s of T.SDKS) expect(before).toMatch(new RegExp(`${s.name}\\s+${s.what.replace(/[()]/g, '\\$&')} · ${s.dep} \\(${s.where}\\)`));
|
expect(r.code).toBe(demo ? 0 : 1); // exit 1 on blockers (before the fixes)
|
||||||
|
return r.out;
|
||||||
|
};
|
||||||
|
let before = '', after = '';
|
||||||
|
beforeAll(() => { before = scanText('teaser', false); after = scanText('teaser-fixed', true); });
|
||||||
|
|
||||||
|
test('rejections: the risks line and three findings (severity, guideline, title, file:line)', () => {
|
||||||
|
expect(T.SCAN_CMD).toBe('storebound scan');
|
||||||
expect(before).toContain(T.RISKS_LINE);
|
expect(before).toContain(T.RISKS_LINE);
|
||||||
});
|
|
||||||
test('the five findings: severity, guideline, title, file:line, a verbatim piece of the fix, the skill', () => {
|
|
||||||
expect(T.FINDINGS).toHaveLength(5);
|
|
||||||
const blocks = before.split(/\n\s+\d\. /).slice(1);
|
const blocks = before.split(/\n\s+\d\. /).slice(1);
|
||||||
T.FINDINGS.forEach((f, i) => {
|
for (const f of T.FINDINGS) {
|
||||||
const b = blocks[i]!;
|
const b = blocks.find(x => x.startsWith(`${f.sev.padEnd(7)} ${f.guideline} · App Store · ${f.title}`));
|
||||||
expect(b.startsWith(`${f.sev.padEnd(7)} ${f.guideline} · App Store · ${f.title}`)).toBe(true);
|
expect(b, f.title).toBeDefined();
|
||||||
expect(b).toContain(`at ${f.where}`);
|
expect(b!).toContain(`at ${f.where}`);
|
||||||
expect(b).toContain(`skill: ${f.skill}`);
|
// the plain reason is an annotation, short enough to read
|
||||||
expect(b.match(/fix: (.*)/)![1]).toContain(f.fix);
|
expect(f.why.split(' ').length, f.why).toBeLessThanOrEqual(10);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
test('rejections: the re-scan after the fixes (tests/fixtures/scan/teaser-fixed) is clean', () => {
|
||||||
|
expect(after).toContain(T.RESCAN_LINE);
|
||||||
});
|
});
|
||||||
test('declarations proposal lines', () => {
|
test('forms: the declarations proposal lines and the ask-owner line', () => {
|
||||||
for (const d of T.DECL_LINES) expect(before).toContain(`detected ${d.what}: ${d.value}`);
|
for (const d of T.DECL_LINES) expect(before).toContain(`detected ${d.what}: ${d.value}`);
|
||||||
for (const d of T.DECL_LINES) expect(before).toContain(`(${d.where})`);
|
for (const d of T.DECL_LINES) expect(before).toContain(`(${d.where})`);
|
||||||
expect(before).toContain(T.DECL_ASK);
|
expect(before).toContain(T.DECL_ASK);
|
||||||
});
|
});
|
||||||
test('the re-scan after the fixes (tests/fixtures/scan/teaser-fixed, demo account in the environment) is clean', () => {
|
});
|
||||||
expect(after).toContain(T.RESCAN_LINE);
|
|
||||||
expect(after).toContain(T.RESCAN_NONE);
|
describe('teaser: the store text and screenshots are the demo game\'s', () => {
|
||||||
|
test('copy: the hero title per language from examples/demo-game/store/shots/copy.json', () => {
|
||||||
|
const copy = JSON.parse(readFileSync(join(ROOT, 'examples/demo-game', T.COPY_FILE), 'utf8')) as Record<string, { hero: { title: string[] } }>;
|
||||||
|
for (const c of T.COPY) expect(c.title).toEqual(copy[c.lang]!.hero.title);
|
||||||
|
expect(T.SHOT_LANGS).toEqual(T.COPY.map(c => c.lang));
|
||||||
|
});
|
||||||
|
test('sizes: seven store sizes the demo game renders (iPhone, iPad, Play phone and tablets, feature graphic)', () => {
|
||||||
|
for (const s of T.SHOT_SIZES) expect(SIZES[s.id], s.id).toBeDefined();
|
||||||
|
expect(T.SHOT_SIZES).toHaveLength(7);
|
||||||
|
expect(T.SHOTS_PILL).toBe(`*7* sizes × *${T.COPY.length}* languages`);
|
||||||
|
expect(T.TODO.map(x => x.text)).toContain('7 screenshot sizes × 14 languages');
|
||||||
|
expect(T.TODO.map(x => x.text)).toContain('prices in 175 countries');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('teaser: timing', () => {
|
describe('teaser: timing and format', () => {
|
||||||
const near = (x: number): boolean => Math.abs(x / T.BEAT - Math.round(x / T.BEAT)) < 1e-9;
|
test('16:9 only: the master is 1920x1080; the pipeline has no vertical output', () => {
|
||||||
test('scenes are contiguous, cover the video and cut on the beat', () => {
|
expect(T.FORMAT).toEqual({ w: 1920, h: 1080 });
|
||||||
|
const render = readFileSync(join(ROOT, 'media/teaser/render.ts'), 'utf8');
|
||||||
|
expect(render).not.toMatch(/1080\s*x\s*1920|w: 1080, h: 1920|vertical/i);
|
||||||
|
expect(render).toContain('scale=1280:720');
|
||||||
|
});
|
||||||
|
test('scenes are contiguous, 6-7 s each, 55-65 s in total', () => {
|
||||||
expect(T.SCENES[0]!.start).toBe(0);
|
expect(T.SCENES[0]!.start).toBe(0);
|
||||||
for (let i = 1; i < T.SCENES.length; i++) expect(T.SCENES[i]!.start).toBe(T.SCENES[i - 1]!.end);
|
for (let i = 1; i < T.SCENES.length; i++) expect(T.SCENES[i]!.start).toBe(T.SCENES[i - 1]!.end);
|
||||||
expect(T.SCENES.at(-1)!.end).toBeCloseTo(T.DURATION, 9);
|
for (const s of T.SCENES) {
|
||||||
for (const s of T.SCENES) expect(near(s.start), s.id).toBe(true);
|
expect(s.end - s.start, s.id).toBeGreaterThanOrEqual(6);
|
||||||
expect(T.DURATION).toBeGreaterThan(29);
|
expect(s.end - s.start, s.id).toBeLessThanOrEqual(7);
|
||||||
expect(T.DURATION).toBeLessThan(38);
|
|
||||||
});
|
|
||||||
test('every scene holds at least 2.5 s', () => {
|
|
||||||
for (const s of T.SCENES) expect(s.end - s.start, s.id).toBeGreaterThanOrEqual(2.5);
|
|
||||||
});
|
|
||||||
test('captions: at most 7 words, fully on screen for at least 1.2 s, never overlapping', () => {
|
|
||||||
const c = T.captionTimes();
|
|
||||||
expect(c).toHaveLength(T.CAPTIONS.length);
|
|
||||||
for (const x of c) {
|
|
||||||
expect(x.count, x.words).toBeLessThanOrEqual(7);
|
|
||||||
expect(x.hold, x.words).toBeGreaterThanOrEqual(1.2);
|
|
||||||
}
|
}
|
||||||
for (let i = 1; i < c.length; i++) expect(c[i]!.at).toBeGreaterThanOrEqual(c[i - 1]!.to);
|
expect(T.DURATION).toBe(T.SCENES.at(-1)!.end);
|
||||||
|
expect(T.DURATION).toBeGreaterThanOrEqual(55);
|
||||||
|
expect(T.DURATION).toBeLessThanOrEqual(65);
|
||||||
|
});
|
||||||
|
test('one caption per scene, fully on screen for at least 4 s, inside its scene', () => {
|
||||||
|
const c = T.captionTimes();
|
||||||
|
expect(c.map(x => x.id)).toEqual(T.SCENES.map(s => s.id));
|
||||||
|
for (const x of c) {
|
||||||
|
const s = T.SCENES.find(y => y.id === x.id)!;
|
||||||
|
expect(x.hold, x.text).toBeGreaterThanOrEqual(4);
|
||||||
|
expect(x.at).toBeGreaterThanOrEqual(s.start);
|
||||||
|
expect(x.to).toBeLessThanOrEqual(s.end);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
test('the rejection mail holds at least 2 s before the first cut', () => {
|
||||||
|
expect(T.SCENES[0]!.end - T.MAIL.at - T.MAIL_IN).toBeGreaterThanOrEqual(2);
|
||||||
|
expect(T.MAIL.guideline).toStartWith('Guideline 2.1');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ export const SITE_ICONS = ['caret-right', 'play', 'user', 'squares-four', 'brief
|
||||||
export const STORE_MARKS = ['appstore', 'googleplay'] as const;
|
export const STORE_MARKS = ['appstore', 'googleplay'] as const;
|
||||||
/** Teaser icons: [Phosphor weight, icon name], vendored as <name>-<weight>.svg (the package's own file name). */
|
/** Teaser icons: [Phosphor weight, icon name], vendored as <name>-<weight>.svg (the package's own file name). */
|
||||||
export const TEASER_ICONS = [['fill', 'navigation-arrow'], ['bold', 'check'], ['fill', 'x-circle'], ['fill', 'check-circle'], ['bold', 'tray'],
|
export const TEASER_ICONS = [['fill', 'navigation-arrow'], ['bold', 'check'], ['fill', 'x-circle'], ['fill', 'check-circle'], ['bold', 'tray'],
|
||||||
['bold', 'magnifying-glass'], ['bold', 'pencil-simple'], ['fill', 'warning-octagon'], ['fill', 'paper-plane-tilt'], ['bold', 'terminal-window']] as const;
|
['fill', 'warning-octagon'], ['fill', 'paper-plane-tilt'], ['bold', 'terminal-window']] as const;
|
||||||
|
|
||||||
const root = new URL('..', import.meta.url).pathname;
|
const root = new URL('..', import.meta.url).pathname;
|
||||||
const phosphor = join(root, 'node_modules/@phosphor-icons/core');
|
const phosphor = join(root, 'node_modules/@phosphor-icons/core');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue