Teaser: Phosphor cursor and icons, a desktop app scene, new render for the site

- The mouse cursor and the blocker-list icons are Phosphor files (media/teaser/icons, copied unchanged by
  tools/site-icons.ts) shown as CSS masks; no hand-written SVG left in media/teaser.
- The no-handmade-svg guard now covers media/teaser: no inline SVG, every referenced icon is a vendored Phosphor file,
  byte-equal to the package.
- New 6-bar desktop scene before the Submit card: real frames of apps/desktop in fixture mode (media/teaser/desktop.ts,
  captured headlessly) in a CSS window: portfolio across studios, the release track of both stores, the Growth chart
  with its tooltip, the Cmd+K palette, a price-sheet dry-run diff, the confirm dialog, and Submit for review left to
  the console. Music and timeline follow (26 bars, 48.75 s).
- End card: "Desktop app for macOS, Windows, Linux".
- site/img/teaser.mp4 (1280x720 H.264, about 3 MB) and its poster re-rendered; ?v= bumped, captions say 49 s.
This commit is contained in:
CRTkafa 2026-10-11 02:59:32 +00:00
parent dd8d50d470
commit 6080598bc2
18 changed files with 375 additions and 35 deletions

View file

@ -1,4 +1,4 @@
# storebound teaser (30-40 s social video)
# storebound teaser (about 50 s social video)
A scripted terminal animation, not a screen recording. Every frame is a pure function of time, rendered from an
HTML/CSS/JS timeline in headless Chrome and encoded with ffmpeg. The music is original and synthesized from scratch in
@ -6,14 +6,18 @@ the same browser (Web Audio `OfflineAudioContext`): no samples, no downloaded au
| file | what |
|---|---|
| `script.js` | the timeline: tempo (128 BPM, 20 bars = 37.5 s), scenes, terminal lines, prices, languages, blockers |
| `script.js` | the timeline: tempo (128 BPM, 26 bars = 48.75 s), scenes, terminal lines, prices, languages, blockers, the desktop steps |
| `desktop.ts` | the desktop scene's frames: apps/desktop's Vite dev server in fixture mode (`VITE_FIXTURES=1`, example.com-style data), captured headlessly in dark at 1280x800 @2x, plus `boxes.json` (cursor targets) -> `out/desktop/` |
| `index.html` + `teaser.js` | the picture; `window.teaser.seek(t)` sets every element for time `t` |
| `music.js` | the music: arp, kick, hats, clap, offbeat bass, pad, impacts on the cuts, key clicks, riser |
| `render.ts` | frames -> ffmpeg (H.264 high, yuv420p, 30 fps), music -> loudnorm (-14 LUFS, -1.5 dBTP), mux, posters |
| `icons/` | the mouse cursor and the blocker-list 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 terminal text is modelled on real storebound output for the demo game (`examples/demo-game`, placeholder ids,
dry runs); the price table values are illustrative. The store art is the demo game's real renders.
dry runs); the price table values are illustrative. The store art is the demo game's real renders. The desktop scene
shows real frames of the desktop app on its fixture data in a CSS window; only the confirm dialog is drawn (in the app it
is a native OS dialog), with the app's own wording and the dry run of the diff in the frame behind it.
## Render
@ -23,7 +27,8 @@ Needs Bun, ffmpeg and Playwright (repo devDependency; Playwright's Chromium or a
# optional, for sharp store art: 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
# from the repo root
bun media/teaser/render.ts # both formats + music, about 10 min
bun media/teaser/render.ts # both formats + music, about 12 min (captures out/desktop/ first when missing)
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)
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)

96
media/teaser/desktop.ts Normal file
View file

@ -0,0 +1,96 @@
#!/usr/bin/env bun
// 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.
// Writes media/teaser/out/desktop/*.jpg plus boxes.json (where the cursor goes, as fractions of the frame).
// 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 { join } from 'node:path';
import { launch } from '../../cli/shots/browser';
const DIR = import.meta.dir;
const ROOT = join(DIR, '../..');
const OUT = join(DIR, 'out/desktop');
export const VIEW = { width: 1280, height: 800 };
const log = (m: string): void => console.log(`${new Date().toISOString().slice(11, 19)} [desktop] ${m}`);
type Box = { x: number; y: number; w: number; h: number };
export async function captureDesktop(): Promise<void> {
mkdirSync(OUT, { recursive: true });
const port = 14_300 + Math.floor(Math.random() * 500);
const vite = Bun.spawn(['bunx', 'vite', '--host', '127.0.0.1', '--port', String(port), '--strictPort'], {
cwd: join(ROOT, 'apps/desktop'), env: { ...process.env, VITE_FIXTURES: '1' }, stdout: 'ignore', stderr: 'pipe',
});
const base = `http://127.0.0.1:${port}`;
try {
for (let i = 0; ; i++) {
try { if ((await fetch(base)).ok) break; } catch { /* not up yet */ }
if (i > 120) throw new Error('vite dev server did not start');
await Bun.sleep(250);
}
const browser = await launch(ROOT, { headless: true });
const ctx = await browser.newContext({ viewport: VIEW, deviceScaleFactor: 2, colorScheme: 'dark', reducedMotion: 'reduce' });
const page = await ctx.newPage();
const errors: string[] = [];
page.on('pageerror', (e: unknown) => errors.push(String(e)));
const boxes: Record<string, Box> = {};
const box = async (name: string, loc: any): Promise<void> => {
const b = await loc.first().boundingBox();
if (!b) throw new Error(`no box for ${name}`);
boxes[name] = { x: b.x / VIEW.width, y: b.y / VIEW.height, w: b.width / VIEW.width, h: b.height / VIEW.height };
};
const open = async (start: string): Promise<void> => {
await page.goto(`${base}/?start=${encodeURIComponent(start)}&theme=dark&lang=en`);
await page.waitForLoadState('networkidle');
// the two dev-build markers ("DEV" by the name, the "DEV FIXTURES" pill) are not in a release build
await page.addStyleTag({ content: '.brand small, .dev-pill { display: none !important; }' });
await page.waitForTimeout(900);
};
const shot = async (name: string): Promise<void> => {
await page.mouse.move(VIEW.width - 2, VIEW.height - 2);
await page.waitForTimeout(150);
await page.screenshot({ path: join(OUT, `${name}.jpg`), type: 'jpeg', quality: 92 });
};
await open('portfolio');
await shot('portfolio');
await open('app:releases');
await box('console', page.getByRole('button', { name: /App Store Connect/ }));
await shot('releases');
await open('app:growth');
const chart = page.locator('#tabpanel .lchart-plot').first();
await box('chart', chart);
await shot('growth');
const c = boxes.chart!;
const hx = (c.x + c.w * 0.68) * VIEW.width, hy = (c.y + c.h * 0.5) * VIEW.height;
await page.mouse.move(hx, hy, { steps: 4 });
await page.waitForTimeout(400);
boxes.hover = { x: hx / VIEW.width, y: hy / VIEW.height, w: 0, h: 0 };
await page.screenshot({ path: join(OUT, 'growth-hover.jpg'), type: 'jpeg', quality: 92 });
await open('palette');
await shot('palette');
await open('app:prices');
await page.getByRole('button', { name: /Compare store\/prices.csv/ }).click();
await page.waitForTimeout(5200); // the "compared" result toast closes by itself after 4.5 s
await page.getByText(/against the stores/).first().evaluate((el: HTMLElement) => {
el.scrollIntoView({ block: 'start' });
document.getElementById('content')?.scrollBy({ top: -24 });
});
await page.waitForTimeout(300);
await box('apply', page.getByRole('button', { name: /^Apply \d+ changes/ }));
await shot('prices-diff');
writeFileSync(join(OUT, 'boxes.json'), `${JSON.stringify(boxes, null, 1)}\n`);
await browser.close();
if (errors.length) throw new Error(`page errors:\n ${[...new Set(errors)].join('\n ')}`);
log(`6 frames + boxes.json -> ${OUT}`);
} finally {
vite.kill();
}
}
if (import.meta.main) await captureDesktop();

View file

@ -0,0 +1,25 @@
Icons in this folder, copied unchanged by tools/site-icons.ts:
Phosphor 2.1.1 (https://phosphoricons.com), from the @phosphor-icons/core package.
MIT License
Copyright (c) 2023 Phosphor Icons
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224.49,136.49l-72,72a12,12,0,0,1-17-17L187,140H40a12,12,0,0,1,0-24H187L135.51,64.48a12,12,0,0,1,17-17l72,72A12,12,0,0,1,224.49,136.49Z"/></svg>

After

Width:  |  Height:  |  Size: 235 B

View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z"/></svg>

After

Width:  |  Height:  |  Size: 203 B

View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M248,121.58a15.76,15.76,0,0,1-11.29,15l-.2.06-78,21.84-21.84,78-.06.2a15.77,15.77,0,0,1-15,11.29h-.3a15.77,15.77,0,0,1-15.07-10.67L41,61.41a1,1,0,0,1-.05-.16A16,16,0,0,1,61.25,40.9l.16.05,175.92,65.26A15.78,15.78,0,0,1,248,121.58Z"/></svg>

After

Width:  |  Height:  |  Size: 330 B

View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M234.38,210a123.36,123.36,0,0,0-60.78-53.23,76,76,0,1,0-91.2,0A123.36,123.36,0,0,0,21.62,210a12,12,0,1,0,20.77,12c18.12-31.32,50.12-50,85.61-50s67.49,18.69,85.61,50a12,12,0,0,0,20.77-12ZM76,96a52,52,0,1,1,52,52A52.06,52.06,0,0,1,76,96Z"/></svg>

After

Width:  |  Height:  |  Size: 335 B

View file

@ -101,7 +101,7 @@ html, body { margin: 0; padding: 0; background: var(--bg); overflow: hidden; }
#quest .row { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); opacity: 0; }
#quest .row:first-of-type { border-top: 0; }
#quest .ico { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; }
#quest .ico svg { width: 26px; height: 26px; }
#quest .ico .pi { width: 26px; height: 26px; }
#quest .nm { font: 700 26px/1.15 var(--sans); color: var(--ink); }
#quest .ds { font: 500 18px/1.2 var(--sans); color: var(--muted); margin-top: 3px; }
#quest .pill { margin-left: auto; flex: none; }
@ -116,6 +116,36 @@ html, body { margin: 0; padding: 0; background: var(--bg); overflow: hidden; }
#sizes .sz { font: 700 22px/1 var(--sans); padding: 10px 16px; border-radius: 999px; background: rgba(15,23,42,.92); border: 2px solid var(--line-2); color: #64748b; opacity: 0; }
#sizes .sz.on { color: #0b1120; background: #fcd34d; border-color: #fcd34d; }
/* desktop app: real frames (out/desktop, desktop.ts) in a CSS window; the dialog stands in for the native one */
#desk { inset: 0; z-index: 12; opacity: 0; pointer-events: none; }
#desk .win { position: absolute; border-radius: 14px; overflow: hidden; background: #0b0f19;
box-shadow: 0 50px 120px -30px rgba(0,0,0,.95), 0 0 0 1px rgba(255,255,255,.14), 0 0 90px -20px rgba(79,70,229,.5); transform-origin: 50% 60%; }
#desk .tb { height: 40px; display: flex; align-items: center; gap: 9px; padding: 0 16px; background: linear-gradient(#262a35, #1d212b);
border-bottom: 1px solid rgba(0,0,0,.6); position: relative; }
#desk .tl { width: 13px; height: 13px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); }
#desk .tl.r { background: #ff5f57; } #desk .tl.y { background: #febc2e; } #desk .tl.g { background: #28c840; }
#desk .ttl { position: absolute; left: 0; right: 0; text-align: center; font: 600 15px/40px var(--sans); color: #aab2c3; pointer-events: none; }
#desk .view { position: relative; overflow: hidden; }
#desk .cam { position: absolute; left: 0; top: 0; width: 1280px; height: 800px; transform-origin: 0 0; }
#desk .cam img { position: absolute; inset: 0; width: 1280px; height: 800px; opacity: 0; }
#desk .shade { position: absolute; inset: 0; background: rgba(0,0,0,.42); opacity: 0; }
#desk .dlg { position: absolute; left: 50%; top: 50%; width: 560px; padding: 26px 26px 20px; border-radius: 16px; opacity: 0;
background: rgba(44,46,54,.97); box-shadow: 0 30px 80px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.16); color: #e8eaf0; text-align: center; }
#desk .dlg .ic { width: 64px; height: 64px; display: block; margin: 0 auto 12px; }
#desk .dlg b { display: block; font: 700 21px/1.25 var(--sans); }
#desk .dlg p { margin: 10px 0 0; font: 500 15px/1.4 var(--sans); color: #c9ccd6; }
#desk .dlg pre { margin: 12px 0 0; padding: 10px 12px; text-align: left; font: 500 13.5px/1.5 var(--mono); color: #b6bccb; background: rgba(0,0,0,.28);
border-radius: 8px; white-space: pre; overflow: hidden; }
#desk .dlg .btns { display: flex; gap: 10px; margin-top: 18px; }
#desk .dlg .btns span { flex: 1; padding: 9px 0; border-radius: 8px; font: 600 15px/1 var(--sans); background: rgba(255,255,255,.12); }
#desk .dlg .btns .ok { background: #0a84ff; color: #fff; }
#desk .step { position: absolute; font: 700 30px/1.2 var(--sans); color: var(--ink-2); opacity: 0; white-space: nowrap; }
#desk .step i { font-style: normal; color: var(--accent); margin-right: 14px; font-family: var(--mono); }
#desk .link { position: absolute; display: flex; align-items: center; gap: 12px; padding: 14px 22px; border-radius: 999px; opacity: 0;
font: 800 30px/1 var(--sans); color: #fff; background: linear-gradient(180deg, #6366f1, #4338ca);
box-shadow: 0 20px 60px -10px rgba(79,70,229,.9), 0 0 0 3px rgba(165,180,252,.35); white-space: nowrap; transform-origin: 100% 0; }
#desk .link .pill { font-size: 20px; }
/* end cards */
#submit, #brand { inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; opacity: 0; }
#submit .kick { font: 700 40px/1.2 var(--sans); color: var(--muted); }
@ -124,8 +154,14 @@ html, body { margin: 0; padding: 0; background: var(--bg); overflow: hidden; }
#submit .ring { position: absolute; inset: -16px; border-radius: 999px; border: 4px solid rgba(165,180,252,.6); opacity: 0; }
#submit .yours { font: 900 120px/1 var(--sans); letter-spacing: -0.03em; color: var(--you-ink); }
#submit .yours .pill { font-size: 30px; padding: 10px 20px; vertical-align: 26px; margin-left: 10px; }
/* icons: Phosphor files in icons/ (tools/site-icons.ts), shown as masks in the element's background colour */
.pi { display: block; -webkit-mask: var(--pi) center / contain no-repeat; mask: var(--pi) center / contain no-repeat; }
#submit .fine { margin-top: 34px; font: 600 30px/1.3 var(--sans); color: var(--muted); }
#cursor { z-index: 45; width: 64px; height: 64px; opacity: 0; filter: drop-shadow(0 6px 10px rgba(0,0,0,.6)); }
/* the mask sits on the inner span: a filter on the masked element itself would be cut away by its own mask */
#cursor, #dcur { z-index: 45; width: 64px; height: 64px; opacity: 0;
filter: drop-shadow(0 0 1.5px #0b1120) drop-shadow(0 0 1.5px #0b1120) drop-shadow(0 6px 10px rgba(0,0,0,.6)); }
#dcur { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
#cursor .pi, #dcur .pi { width: 100%; height: 100%; --pi: url(icons/navigation-arrow-fill.svg); background: #fff; }
#brand .mark { width: 220px; height: 220px; display: block; filter: drop-shadow(0 30px 60px rgba(79,70,229,.7)); }
#brand .word { margin-top: 40px; font: 900 150px/1 var(--sans); letter-spacing: -0.045em; }
@ -133,6 +169,7 @@ html, body { margin: 0; padding: 0; background: var(--bg); overflow: hidden; }
#brand .tag b { color: var(--accent); font-weight: 800; }
#brand .url { margin-top: 46px; font: 800 66px/1 var(--sans); color: var(--accent); letter-spacing: -0.01em; }
#brand .meta { margin-top: 24px; font: 700 34px/1 var(--sans); color: var(--muted); letter-spacing: .02em; }
#brand .desk { margin-top: 18px; font: 700 34px/1 var(--sans); color: var(--ink-2); letter-spacing: .01em; }
#brand .inst { margin-top: 40px; font: 700 34px/1 var(--mono); padding: 22px 34px; border-radius: 20px; background: rgba(6,10,20,.92); border: 2px solid var(--line-2); color: var(--ink); }
#brand .inst span { color: var(--green); margin-right: 16px; }
#brand > * { will-change: transform, opacity; }
@ -158,7 +195,8 @@ html, body { margin: 0; padding: 0; background: var(--bg); overflow: hidden; }
.h #brand .mark { width: 190px; height: 190px; }
.h #brand .tag { max-width: 1200px; margin-top: 24px; }
.h #brand .url { margin-top: 36px; }
.h #brand .inst { margin-top: 32px; }
.h #brand .desk { margin-top: 18px; font: 700 34px/1 var(--sans); color: var(--ink-2); letter-spacing: .01em; }
#brand .inst { margin-top: 32px; }
</style>
</head>
<body>
@ -195,13 +233,30 @@ html, body { margin: 0; padding: 0; background: var(--bg); overflow: hidden; }
<div id="caption"></div>
<div id="desk">
<div class="win"><div class="tb"><span class="tl r"></span><span class="tl y"></span><span class="tl g"></span><span class="ttl">storebound</span></div>
<div class="view"><div class="cam"></div><div class="shade"></div>
<div class="dlg"><img class="ic" src="brand/logo-mark-256.png" width="64" height="64" alt="">
<b>Owner action: Apply the price sheet</b>
<p>Apply the price sheet · Prism Puddle</p>
<p>This is your decision: it changes what users get on the store right away. storebound does it only because you press the button below.</p>
<pre></pre>
<div class="btns"><span>Cancel</span><span class="ok">Yes: Apply the price sheet</span></div>
</div>
</div>
</div>
<div class="step"></div>
<div class="link">Submit for review<span class="pill p-you">YOUR CLICK</span></div>
<span id="dcur" aria-hidden="true"><span class="pi"></span></span>
</div>
<div id="submit">
<div class="kick">storebound never presses Submit.</div>
<div class="btn"><span class="ring"></span>Submit for review</div>
<div class="yours">your click.<span class="pill p-you">YOU</span></div>
<div class="fine">Play: Send changes for review · App Store: Submit for Review</div>
</div>
<svg id="cursor" viewBox="0 0 32 32" aria-hidden="true"><path d="M6 3 L6 25 L11.5 20 L15.5 29 L19.5 27.2 L15.6 18.6 L23 18.2 Z" fill="#fff" stroke="#0b1120" stroke-width="2" stroke-linejoin="round"/></svg>
<span id="cursor" aria-hidden="true"><span class="pi"></span></span>
<div id="brand">
<img class="mark" src="brand/logo-mark-256.png" width="256" height="256" alt="storebound logo">
@ -209,6 +264,7 @@ html, body { margin: 0; padding: 0; background: var(--bg); overflow: hidden; }
<div class="tag">From zero to <b>“Submit for review”</b><br>on Google Play and the App Store.</div>
<div class="url">storebound.dev</div>
<div class="meta">open source · MIT</div>
<div class="desk">Desktop app for macOS, Windows, Linux</div>
<div class="inst"><span>$</span>bunx storebound init</div>
</div>

View file

@ -13,7 +13,9 @@ function rng(seed) { // mulberry32
// chords per bar (root midi in octave 3, intervals)
const CH = { Fm: [53, [0, 3, 7]], Db: [49, [0, 4, 7]], Ab: [56, [0, 4, 7]], Eb: [51, [0, 4, 7]] };
const BARS = ['Ab', 'Eb', 'Fm', 'Db', 'Ab', 'Eb', 'Fm', 'Db', 'Ab', 'Eb', 'Fm', 'Db', 'Ab', 'Eb', 'Eb', 'Db', 'Eb', 'Fm', 'Eb', 'Fm'];
// prompt · config · prices · languages · questionnaires · shots · validate · desktop · submit · brand (script.js SCENES)
const BARS = ['Ab', 'Eb', 'Fm', 'Db', 'Ab', 'Eb', 'Fm', 'Db', 'Ab', 'Eb', 'Fm', 'Db', 'Ab', 'Eb', 'Fm',
'Db', 'Ab', 'Eb', 'Fm', 'Eb', 'Eb', 'Db', 'Eb', 'Fm', 'Eb', 'Fm'];
const ARP = [0, 2, 4, 3, 5, 4, 2, 3, 0, 2, 4, 6, 5, 4, 3, 2];
export async function renderMusic() {
@ -167,12 +169,13 @@ export async function renderMusic() {
// ---- arrangement ----
const sub = scene('submit').start, brand = scene('brand').start, drop = scene('config').start;
const rollBar = scene('validate').end - BAR; // last bar before the Submit card
const rollBar = scene('submit').start - BAR; // last bar before the Submit card
duck.gain.setValueAtTime(1, 0);
for (let b = 0; b < 20; b++) {
const last = BARS.length - 1;
for (let b = 0; b <= last; b++) {
const t0 = b * BAR, name = BARS[b], [root, iv] = CH[name];
const tones = [0, iv[1], iv[2], 12, 12 + iv[1], 12 + iv[2], 24].map(x => root + 12 + x);
const main = t0 >= drop && t0 < sub, end = b === 19, calm = t0 >= sub && t0 < brand;
const main = t0 >= drop && t0 < sub, end = b === last, calm = t0 >= sub && t0 < brand;
const groove = main || (t0 >= brand && !end);
// pad
if (!end) pad(t0, BAR, [root, root + iv[1], root + iv[2], root + 12], calm ? 0.06 : t0 < drop ? 0.045 : 0.035, calm ? 1100 : 1500);
@ -210,9 +213,9 @@ export async function renderMusic() {
stab(drop, 'Fm', 0.06);
stab(sub, 'Db', 0.1);
stab(brand, 'Fm', 0.1);
stab(19 * BAR, 'Fm', 0.11);
impact(19 * BAR, true);
kick(19 * BAR, 1);
stab(last * BAR, 'Fm', 0.11);
impact(last * BAR, true);
kick(last * BAR, 1);
// key clicks
for (const t of keyTimes()) key(t, t < drop ? 0.16 : 0.07);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 61 KiB

Before After
Before After

View file

@ -4,11 +4,13 @@
// bun media/teaser/render.ts both formats, music, posters -> media/teaser/out/
// bun media/teaser/render.ts --only v vertical only (v = 1080x1920, h = 1920x1080)
// 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 --serve preview server: open /index.html?w=1080&h=1920&play=1
// Needs ffmpeg and Playwright (devDependency; Playwright's Chromium or an installed Google Chrome).
import { existsSync, mkdirSync, statSync } from 'node:fs';
import { join } from 'node:path';
import { launch } from '../../cli/shots/browser';
import { captureDesktop } from './desktop';
const DIR = import.meta.dir;
const ROOT = join(DIR, '../..');
@ -58,6 +60,8 @@ function serve(): ReturnType<typeof Bun.serve> {
async function main(): Promise<void> {
mkdirSync(OUT, { recursive: true });
prepAssets();
// the desktop scene's frames: the real app in fixture mode (desktop.ts); --desktop captures them again
if (args.includes('--desktop') || !existsSync(join(OUT, 'desktop/boxes.json'))) await captureDesktop();
const server = serve();
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; }
@ -69,6 +73,7 @@ async function main(): Promise<void> {
const page = await browser.newPage({ viewport: { width: f.w, height: f.h }, deviceScaleFactor: 1 });
page.on('pageerror', (e: Error) => console.error('page error:', e.message));
await page.goto(`${base}?w=${f.w}&h=${f.h}`);
await page.waitForFunction('window.teaser'); // teaser.js loads out/desktop/boxes.json first
await page.evaluate('window.teaser.ready');
const { DURATION, FPS } = await page.evaluate('({ DURATION: teaser.DURATION, FPS: teaser.FPS })') as { DURATION: number; FPS: number };
const shot = async (t: number): Promise<Buffer> => {

View file

@ -7,8 +7,8 @@ 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 BARS = 20;
export const DURATION = BARS * BAR; // 37.5 s
export const BARS = 26;
export const DURATION = BARS * BAR; // 48.75 s
/** Scenes in bars; start/end in seconds are derived below. */
const SCENE_BARS = [
@ -19,6 +19,7 @@ const SCENE_BARS = [
['questionnaires', 2],
['shots', 3],
['validate', 2],
['desktop', 6], // the desktop app: real UI frames (desktop.ts), see DESKTOP below
['submit', 2],
['brand', 3],
];
@ -127,6 +128,29 @@ const T = {
};
export const TERMINAL = T;
/**
* The desktop scene, in seconds after its start: which captured frame (out/desktop/<frame>.jpg, desktop.ts) shows,
* the camera zoom toward a point of the frame (fractions of the 1280 x 800 window), and the step label.
* The frames are the real app in fixture mode; the confirm dialog is drawn on top (the app's is a native OS dialog).
*/
export const DESKTOP = [
{ at: 0.0, frame: 'portfolio', focus: [0.42, 0.42], zoom: 1.12, step: 'Every app of every studio' },
{ at: 1.875, frame: 'releases', focus: [0.6, 0.38], zoom: 1.45, step: 'Both stores on one release track' },
{ at: 3.75, frame: 'growth', focus: 'hover', zoom: 1.5, step: 'Growth and health, charted' },
{ at: 5.625, frame: 'palette', focus: [0.25, 0.45], zoom: 1.35, step: '⌘K: jump anywhere' },
{ at: 6.8, frame: 'prices-diff', focus: 'apply', zoom: 1.4, step: 'Every write: dry run first' },
{ at: 7.95, frame: 'prices-diff', focus: 'apply', zoom: 1.4, dialog: true, step: 'Then your Apply, in a system dialog' },
{ at: 9.375, frame: 'releases', focus: [0.58, 0.22], zoom: 1.3, step: 'Submit for review stays in the console' },
];
/** Cursor waypoints of the desktop scene: [at, target, click]; targets name a boxes.json entry or a dialog button. */
export const DESK_CURSOR = [
[3.95, 'off'], [4.55, 'hover'], [6.9, 'hover'], [7.55, 'apply', true], [8.5, 'dialog-ok'], [8.75, 'dialog-ok', true],
[9.5, 'dialog-ok'], [10.25, 'console'],
];
export const DESK_HOVER_AT = 4.6; // the chart tooltip shows (growth -> growth-hover)
export const DESK_DIALOG = [7.95, 9.0]; // the dialog is up (after the Apply click, until the Yes click)
export const DESK_LINK_AT = 10.35; // "Submit for review · your click" by the console button
/** Seconds at which each typed character lands (for key clicks in the music). */
export function keyTimes() {
const out = [];

View file

@ -1,7 +1,7 @@
// Teaser picture: 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.
import { BAR, BEAT, BLOCKERS, BLOCKERS_AT, BLOCKER_GAP, CMD_CPS, CUTS, DURATION, FIX_AT, FIX_GAP, FPS, LANGS, PRICES,
PROMPT, PROMPT_AT, PROMPT_CPS, SCENES, TERMINAL, scene } from './script.js';
import { BAR, BEAT, BLOCKERS, BLOCKERS_AT, BLOCKER_GAP, CMD_CPS, CUTS, DESK_CURSOR, DESK_DIALOG, DESK_HOVER_AT, DESK_LINK_AT,
DESKTOP, DURATION, FIX_AT, FIX_GAP, FPS, LANGS, PRICES, PROMPT, PROMPT_AT, PROMPT_CPS, SCENES, TERMINAL, scene } from './script.js';
const q = new URLSearchParams(location.search);
const W = Number(q.get('w') ?? 1080), H = Number(q.get('h') ?? 1920);
@ -47,6 +47,7 @@ const CAPS = [
{ id: 'questionnaires', lines: [['Every', 0.05], ['*questionnaire.*', 0.3]], sub: ['Data safety · age rating · App Privacy', 0.9] },
{ id: 'shots', lines: [['Store art,', 0.05], ['*rendered.*', 0.4]], sub: ['real renders · Prism Puddle demo', 1.0] },
{ id: 'validate', lines: [['Blockers', 0.05], ['#count', 0.3]], sub: ['read-only check · in fix order', 0.8] },
{ id: 'desktop', lines: [['And a', 0.05], ['*desktop* app.', 0.3]], sub: ['macOS · Windows · Linux', 0.9] },
];
const capEl = $('#caption');
let capId = null, capWords = [], capSub = null, capCount = null;
@ -189,10 +190,11 @@ const QUEST = [
['App Privacy labels + Publish', 'the skill walks your agent through it', 'ui'],
['The answers themselves', 'your statements · the agent asks', 'you'],
];
// Phosphor icons (icons/, copied unchanged by tools/site-icons.ts), shown as CSS masks in the pill colour
const ICON = {
api: '<svg viewBox="0 0 24 24"><path d="M5 12.5l4.5 4.5L19 7.5" fill="none" stroke="#86efac" stroke-width="3.2" stroke-linecap="round" stroke-linejoin="round"/></svg>',
ui: '<svg viewBox="0 0 24 24"><path d="M5 12h12M12.5 6.5 18 12l-5.5 5.5" fill="none" stroke="#fcd34d" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/></svg>',
you: '<svg viewBox="0 0 24 24"><circle cx="12" cy="8.5" r="3.6" fill="none" stroke="#f9a8d4" stroke-width="2.6"/><path d="M5 19.5c1.2-3.6 4-5 7-5s5.8 1.4 7 5" fill="none" stroke="#f9a8d4" stroke-width="2.6" stroke-linecap="round"/></svg>',
api: '<span class="pi" style="--pi:url(icons/check-bold.svg);background:#86efac"></span>',
ui: '<span class="pi" style="--pi:url(icons/arrow-right-bold.svg);background:#fcd34d"></span>',
you: '<span class="pi" style="--pi:url(icons/user-bold.svg);background:#f9a8d4"></span>',
};
const BG = { api: 'var(--api-bg)', ui: 'var(--ui-bg)', you: 'var(--you-bg)' };
questEl.querySelector('.rows').innerHTML = QUEST.map(([nm, ds, k]) =>
@ -303,6 +305,105 @@ function shots(t) {
});
}
// ---------- desktop app ----------
// Real frames of apps/desktop in fixture mode (out/desktop/*.jpg, 1280 x 800 at 2x, desktop.ts) in a CSS window, with
// a camera that zooms toward the step's point, the Phosphor cursor, and the confirm dialog drawn on top.
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 FW = 1280, FH = 800;
const DW = V ? { x: 40, y: 640, w: 1000 } : { x: 880, y: 226, w: 940 };
const TB = 40, VW = DW.w, VH = DW.w * FH / FW;
const deskEl = $('#desk'), win = $('#desk .win'), viewEl = $('#desk .view'), cam = $('#desk .cam'), shade = $('#desk .shade'),
dlg = $('#desk .dlg'), stepEl = $('#desk .step'), linkEl = $('#desk .link'), dcur = $('#dcur');
win.style.left = `${DW.x}px`; win.style.top = `${DW.y}px`; win.style.width = `${VW}px`;
viewEl.style.width = `${VW}px`; viewEl.style.height = `${VH}px`;
const FRAMES = ['portfolio', 'releases', 'growth', 'growth-hover', 'palette', 'prices-diff'];
cam.innerHTML = FRAMES.map(f => `<img data-f="${f}" src="out/desktop/${f}.jpg" alt="">`).join('');
const frameEls = Object.fromEntries([...cam.querySelectorAll('img')].map(im => [im.dataset.f, im]));
// the dialog's dry run restates the diff rows of the prices-diff frame (fixture data)
dlg.querySelector('pre').textContent = [
'Dry run (storebound prices import --dry):',
'coins_small Google Play TR TRY 21.99 -> 24.99',
'coins_small Google Play BR R$3.99 -> R$4.49',
'coins_small App Store TR TRY 29.99 -> 24.99',
'no_ads App Store BR R$14.90 -> R$12.90',
].join('\n');
if (V) { stepEl.style.left = '0'; stepEl.style.right = '0'; stepEl.style.textAlign = 'center'; stepEl.style.top = `${DW.y + TB + VH + 56}px`; }
else { stepEl.style.left = '120px'; stepEl.style.top = '790px'; }
const focusOf = f => (typeof f === 'string' ? (b => [b.x + b.w / 2, b.y + b.h / 2])(BOXES[f]) : f);
/** Camera for a step: scale and offset of the frame inside the view, the focus kept on screen, no empty edge. */
function camFor(st, p) {
const z = lerp(1, st.zoom, p), S = (VW / FW) * z;
const [fx, fy] = focusOf(st.focus);
const ox = clamp(VW / 2 - fx * FW * S, VW - FW * S, 0), oy = clamp(VH / 2 - fy * FH * S, VH - FH * S, 0);
return { S, ox, oy };
}
let deskCam = { S: VW / FW, ox: 0, oy: 0 };
/** A point of the frame (fractions) in stage pixels, through the current camera. */
const framePt = (fx, fy) => [DW.x + deskCam.ox + fx * FW * deskCam.S, DW.y + TB + deskCam.oy + fy * FH * deskCam.S];
function deskTarget(name) {
if (name === 'off') return [DW.x + VW + 120, DW.y + TB + VH + 160];
if (name === 'dialog-ok') { const b = dlg.querySelector('.ok').getBoundingClientRect(); return [b.left + b.width * 0.9, b.top + b.height * 0.7]; }
const b = BOXES[name];
return framePt(b.x + b.w * (b.w ? 0.9 : 1), b.y + b.h * (b.h ? 0.75 : 1));
}
function desktop(t) {
const s = sceneAt(t), r = t - s.start;
if (s.id !== 'desktop') { deskEl.style.opacity = '0'; deskEl.style.display = 'none'; return; }
deskEl.style.display = ''; deskEl.style.opacity = '1';
// window in, a punch on every step
const ip = prog(r, 0.0, 0.45);
const si = DESKTOP.findLastIndex(x => r >= x.at), st = DESKTOP[Math.max(0, si)];
const punch = si > 0 && !st.dialog ? 1 - eoc(prog(r, st.at, 0.25)) : 0;
win.style.opacity = String(clamp(ip * 2.5));
win.style.transform = `translateY(${(1 - eob(ip)) * 120}px) scale(${(0.9 + 0.1 * eoc(ip)) * (1 + 0.02 * punch)})`;
// frames: a quick crossfade on each cut; the chart tooltip fades in when the cursor gets there
const prev = DESKTOP[si - 1];
const fade = prev && prev.frame !== st.frame ? prog(r, st.at, 0.16) : 1;
const frameName = x => (x.frame === 'growth' && r >= DESK_HOVER_AT ? 'growth-hover' : x.frame);
for (const [f, im] of Object.entries(frameEls)) {
im.style.opacity = f === frameName(st) ? '1' : prev && f === frameName(prev) && fade < 1 ? '1' : '0';
im.style.zIndex = f === frameName(st) ? '2' : '1';
}
if (frameEls[frameName(st)]) frameEls[frameName(st)].style.opacity = String(fade);
const growthTip = st.frame === 'growth' ? prog(r, DESK_HOVER_AT, 0.15) : 0;
if (st.frame === 'growth' && r >= DESK_HOVER_AT) { frameEls.growth.style.opacity = '1'; frameEls['growth-hover'].style.opacity = String(growthTip); }
// camera: ease into the step's zoom (a fresh frame starts from the whole window)
const keep = prev && prev.frame === st.frame;
const from = keep ? camFor(prev, 1) : camFor(st, 0), to = camFor(st, 1);
const cp = eoc(prog(r, st.at + 0.1, 0.9));
deskCam = { S: lerp(from.S, to.S, cp), ox: lerp(from.ox, to.ox, cp), oy: lerp(from.oy, to.oy, cp) };
cam.style.transform = `translate(${deskCam.ox}px, ${deskCam.oy}px) scale(${deskCam.S})`;
// the confirm dialog
const dIn = prog(r, DESK_DIALOG[0], 0.3), dOut = prog(r, DESK_DIALOG[1] + 0.12, 0.2);
const dv = clamp(dIn * 3) * (1 - dOut);
shade.style.opacity = String(dv);
dlg.style.opacity = String(dv);
dlg.style.transform = `translate(-50%, -50%) scale(${(V ? 1.25 : 1.05) * (0.85 + 0.15 * eob(dIn)) * (1 - 0.06 * dOut)})`;
// step label
const sp = prog(r, st.at + 0.05, 0.3);
stepEl.innerHTML = `<i>${String(si + 1).padStart(2, '0')}</i>${esc(st.step)}`;
stepEl.style.opacity = String(clamp(sp * 2) * (1 - prog(t, s.end - 0.16, 0.16)));
stepEl.style.transform = `translateY(${(1 - eoc(sp)) * 24}px)`;
// cursor
const k = DESK_CURSOR.findLastIndex(([a]) => r >= a);
if (k < 0) dcur.style.opacity = '0';
else {
const [a0, n0] = DESK_CURSOR[k], nx = DESK_CURSOR[k + 1];
const p0 = deskTarget(n0);
let [x, y] = p0;
if (nx) { const p1 = deskTarget(nx[1]); const mp = eoc(clamp((r - a0) / (nx[0] - a0))); x = lerp(p0[0], p1[0], mp); y = lerp(p0[1], p1[1], mp); }
const click = DESK_CURSOR.filter(c => c[2]).reduce((m, c) => Math.max(m, 1 - Math.min(1, Math.abs(r - c[0]) / 0.12)), 0);
dcur.style.opacity = String(clamp((r - DESK_CURSOR[0][0]) * 5));
dcur.style.transform = `translate(${x - 10}px, ${y - 10}px) scale(${1 - 0.18 * click})`;
}
// "Submit for review · your click" by the console button
const lp = prog(r, DESK_LINK_AT, 0.35);
const cb = BOXES.console, [bx, by] = framePt(cb.x + cb.w, cb.y + cb.h);
linkEl.style.opacity = String(clamp(lp * 3));
linkEl.style.left = `${Math.min(bx, DW.x + VW - 12)}px`; linkEl.style.top = `${by + 26}px`;
linkEl.style.transform = `translateX(-100%) scale(${0.6 + 0.4 * eob(lp)})`;
}
// ---------- end cards ----------
const submitEl = $('#submit'), btn = $('#submit .btn'), ring = $('#submit .ring'), kick = $('#submit .kick'),
yours = $('#submit .yours'), fine = $('#submit .fine'), cur = $('#cursor');
@ -338,7 +439,7 @@ function endCards(t) {
cur.style.opacity = String(clamp((r - 0.55) * 4));
cur.style.transform = `translate(${lerp(tx + 380, tx, cp) + wob}px, ${lerp(ty + 420, ty, cp) + wob * 0.6}px)`;
} else if (s.id === 'brand') {
const [mark, word, tag, url, meta, inst] = brandParts;
const [mark, word, tag, url, meta, desk, inst] = brandParts;
const mp = prog(r, 0.0, 0.45);
mark.style.opacity = String(clamp(mp * 3));
mark.style.transform = `scale(${eob(mp)}) rotate(${(1 - eoc(mp)) * -25}deg)`;
@ -346,7 +447,8 @@ function endCards(t) {
pop(tag, r, 0.5, 40);
pop(url, r, 0.85, 40);
pop(meta, r, 1.05, 30);
pop(inst, r, 1.3, 30);
pop(desk, r, 1.2, 30);
pop(inst, r, 1.4, 30);
const beat = 1 - prog(((r + 1e-6) % BEAT), 0, BEAT * 0.5);
url.style.textShadow = `0 0 ${20 + 30 * beat * (r > 0.85 ? 1 : 0)}px rgba(129,140,248,${0.35 + 0.35 * beat})`;
}
@ -360,6 +462,7 @@ function seek(t) {
terminal(t);
panels(t);
shots(t);
desktop(t);
endCards(t);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Before After
Before After

Binary file not shown.

View file

@ -455,12 +455,12 @@
<figure class="see-fig" aria-labelledby="see-cap">
<p class="see-k">See it</p>
<div class="player" data-player>
<video controls preload="none" playsinline width="1280" height="720" poster="img/teaser-poster.webp" aria-label="storebound teaser video, 38 seconds, with music">
<source src="img/teaser.mp4" type="video/mp4">
<video controls preload="none" playsinline width="1280" height="720" poster="img/teaser-poster.webp?v=2" aria-label="storebound teaser video, 49 seconds, with music">
<source src="img/teaser.mp4?v=2" type="video/mp4">
</video>
<button class="play" type="button" hidden aria-label="Play the 38-second teaser (with sound)"><span class="ic ic-play" aria-hidden="true"></span><span>Play · 0:38</span></button>
<button class="play" type="button" hidden aria-label="Play the 49-second teaser (with sound)"><span class="ic ic-play" aria-hidden="true"></span><span>Play · 0:49</span></button>
</div>
<figcaption id="see-cap">38-second teaser: a scripted terminal run with the demo game, from config to “Submit for review · your click”. Has music.</figcaption>
<figcaption id="see-cap">49-second teaser: a scripted terminal run with the demo game, then the desktop app, from config to “Submit for review · your click”. Has music.</figcaption>
</figure>
<ul class="facts session-facts">
<li><b>Dry runs first.</b> Every write shows its plan before anything reaches a store.</li>

View file

@ -1,14 +1,15 @@
// Owner rule: no hand-written SVG. Charts come from visx, icons from Phosphor, the store marks from simple-icons, the
// journey diagram from Mermaid, the fixture art from tools/fixture-art.ts. This guard fails on inline SVG drawing in
// the desktop webview and the site, and on any SVG file that is not a known asset.
// the desktop webview, the site and the teaser video (media/teaser), and on any SVG file that is not a known asset.
// The brand mark is a PNG (tools/brand-assets.py from brand/master/logo-mark.png): no inline brand SVG anywhere.
// Allowed: the <svg> root a visx chart renders into (files that import @visx/*), the vendored icon
// files (site/img/icons: Phosphor and simple-icons; apps/desktop/src/ui/store-marks: simple-icons), each byte-equal to
// files (site/img/icons: Phosphor and simple-icons; apps/desktop/src/ui/store-marks: simple-icons; media/teaser/icons:
// Phosphor), each byte-equal to
// its package (tools/site-icons.ts), and the Mermaid output (docs/img, site/img journey*.svg).
import { describe, expect, test } from 'bun:test';
import { readdirSync, readFileSync, statSync } from 'node:fs';
import { join, relative } from 'node:path';
import { checkSiteIcons, ICON_DIR, MARK_DIR, SITE_ICONS, STORE_MARKS } from '../tools/site-icons';
import { checkSiteIcons, ICON_DIR, MARK_DIR, SITE_ICONS, STORE_MARKS, TEASER_DIR, TEASER_ICONS } from '../tools/site-icons';
const ROOT = join(import.meta.dir, '..');
const walk = (dir: string, keep: (f: string) => boolean): string[] => readdirSync(join(ROOT, dir)).flatMap(n => {
@ -61,11 +62,23 @@ describe('no hand-written SVG', () => {
for (const f of ['site/style.css', 'site/main.js']) expect(svgHits(f, read(f)), f).toEqual([]);
});
test('teaser video (media/teaser): icons and the mouse cursor are vendored Phosphor files, no inline SVG', () => {
const files = walk('media/teaser', n => /\.(html|js|ts|css)$/.test(n)).filter(f => !f.startsWith('media/teaser/out/'));
expect(files.length).toBeGreaterThanOrEqual(5);
expect(files.flatMap(f => svgHits(f, read(f)))).toEqual([]);
// every icon the teaser references is one of the vendored Phosphor files
const used = files.flatMap(f => [...read(f).matchAll(/icons\/([\w-]+\.svg)/g)].map(m => m[1]));
expect(used.length).toBeGreaterThanOrEqual(TEASER_ICONS.length);
const vendored: string[] = TEASER_ICONS.map(([w, i]) => `${i}-${w}.svg`);
for (const n of used) expect(vendored, n).toContain(n ?? '');
});
test('SVG files: vendored Phosphor / simple-icons files and Mermaid diagrams only', () => {
const svgs = ['site', 'docs', 'apps/desktop/src'].flatMap(d => walk(d, n => n.endsWith('.svg'))).map(f => relative(ROOT, join(ROOT, f)));
const svgs = ['site', 'docs', 'apps/desktop/src', 'media'].flatMap(d => walk(d, n => n.endsWith('.svg'))).map(f => relative(ROOT, join(ROOT, f)));
const vendored = new Set([
...[...SITE_ICONS, ...STORE_MARKS].map(n => relative(ROOT, join(ICON_DIR, `${n}.svg`))),
...STORE_MARKS.map(n => relative(ROOT, join(MARK_DIR, `${n}.svg`))),
...TEASER_ICONS.map(([w, n]) => relative(ROOT, join(TEASER_DIR, `${n}-${w}.svg`))),
]);
// byte equality with the packages is checked by checkSiteIcons (above); here: no other SVG file sneaks in
for (const f of svgs) {

View file

@ -4,6 +4,7 @@
// App Store / Google Play marks from simple-icons (CC0 data)
// apps/desktop/src/ui/store-marks the same two store marks for the desktop app (the other desktop icons come from
// @phosphor-icons/react)
// media/teaser/icons Phosphor icons for the teaser video (the mouse cursor, the blocker-list icons)
// Both show them as CSS masks (site/style.css .ic-*, desktop styles.css .store-mark), so they take the text colour in
// both themes and nothing is loaded from outside. The store marks only name the store next to its name; they are
// trademarks of Apple Inc. and Google LLC (docs/desktop.md, the site footer).
@ -14,12 +15,15 @@ import { join } from 'node:path';
export const SITE_ICONS = ['caret-right', 'play', 'user', 'squares-four', 'briefcase'] 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). */
export const TEASER_ICONS = [['fill', 'navigation-arrow'], ['bold', 'check'], ['bold', 'arrow-right'], ['bold', 'user']] as const;
const root = new URL('..', import.meta.url).pathname;
const phosphor = join(root, 'node_modules/@phosphor-icons/core');
const simple = join(root, 'node_modules/simple-icons');
export const ICON_DIR = join(root, 'site/img/icons');
export const MARK_DIR = join(root, 'apps/desktop/src/ui/store-marks');
export const TEASER_DIR = join(root, 'media/teaser/icons');
/** [vendored dir, file name, package file] for every vendored icon. */
function plan(): [string, string, string][] {
@ -28,6 +32,7 @@ function plan(): [string, string, string][] {
...SITE_ICONS.map(n => [ICON_DIR, `${n}.svg`, join(phosphor, 'assets/regular', `${n}.svg`)] as [string, string, string]),
...marks.map(([f, src]) => [ICON_DIR, f, src] as [string, string, string]),
...marks.map(([f, src]) => [MARK_DIR, f, src] as [string, string, string]),
...TEASER_ICONS.map(([w, n]) => [TEASER_DIR, `${n}-${w}.svg`, join(phosphor, 'assets', w, `${n}-${w}.svg`)] as [string, string, string]),
];
}
const rel = (p: string) => p.slice(root.length);
@ -42,7 +47,7 @@ export function checkSiteIcons(): string[] {
if (!existsSync(at)) out.push(`${rel(at)} missing (bun tools/site-icons.ts)`);
else if (readFileSync(at, 'utf8') !== readFileSync(src, 'utf8')) out.push(`${rel(at)} is not ${rel(src).replace('node_modules/', '')}`);
}
for (const dir of [ICON_DIR, MARK_DIR]) {
for (const dir of [ICON_DIR, MARK_DIR, TEASER_DIR]) {
if (!existsSync(dir)) continue;
for (const f of readdirSync(dir)) if (f.endsWith('.svg') && !p.some(([d, n]) => d === dir && n === f)) out.push(`${rel(join(dir, f))} is not a vendored icon`);
}
@ -59,9 +64,10 @@ if (import.meta.main) {
for (const b of bad) console.error(`site-icons: ${b}`);
process.exit(bad.length ? 1 : 0);
}
for (const dir of [ICON_DIR, MARK_DIR]) mkdirSync(dir, { recursive: true });
for (const dir of [ICON_DIR, MARK_DIR, TEASER_DIR]) mkdirSync(dir, { recursive: true });
for (const [dir, f, src] of plan()) writeFileSync(join(dir, f), readFileSync(src));
writeFileSync(join(ICON_DIR, 'LICENSE.txt'), `Icons in this folder, copied unchanged by tools/site-icons.ts:\n\nPhosphor ${version(phosphor)} (https://phosphoricons.com), regular weight, from the @phosphor-icons/core\npackage.\n\n${readFileSync(join(phosphor, 'LICENSE'), 'utf8')}\n\n${simpleNote()}`);
writeFileSync(join(TEASER_DIR, 'LICENSE.txt'), `Icons in this folder, copied unchanged by tools/site-icons.ts:\n\nPhosphor ${version(phosphor)} (https://phosphoricons.com), from the @phosphor-icons/core package.\n\n${readFileSync(join(phosphor, 'LICENSE'), 'utf8')}`);
writeFileSync(join(MARK_DIR, 'LICENSE.txt'), `Store marks in this folder, copied unchanged by tools/site-icons.ts.\n\n${simpleNote()}`);
console.log(`site-icons: ${SITE_ICONS.length} Phosphor icons ${version(phosphor)} and ${STORE_MARKS.length} simple-icons ${version(simple)} store marks -> site/img/icons/, apps/desktop/src/ui/store-marks/`);
console.log(`site-icons: ${SITE_ICONS.length} Phosphor icons ${version(phosphor)} and ${STORE_MARKS.length} simple-icons ${version(simple)} store marks and ${TEASER_ICONS.length} teaser icons -> site/img/icons/, apps/desktop/src/ui/store-marks/, media/teaser/icons/`);
}