commit ad8e6ac22ff610792528eac8451af3965635d2f0
parent e574c2669b048c009b621fbb391442ab7f5113f2
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Mon, 26 Oct 2026 09:50:28 -0400
Merge lane/intro-chime-mark: render.intro.mark none|draw|chime — the mark pops in with MEDIA on the chime, the word slides over
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
7 files changed, 198 insertions(+), 63 deletions(-)
diff --git a/common/lib/report/intro.d.mts b/common/lib/report/intro.d.mts
@@ -3,11 +3,14 @@
type Render = Record<string, unknown> | null | undefined;
export type IntroGround = "light" | "dark";
-export type Intro = { style: string; ground: IntroGround; sound: string | false | undefined; seconds: number };
+export type IntroMark = "none" | "draw" | "chime";
+export type Intro = { style: string; ground: IntroGround; mark: IntroMark; sound: string | false | undefined; seconds: number };
export const INTRO_STYLES: readonly string[];
export const INTRO_GROUNDS: readonly IntroGround[];
export const INTRO_STYLE_GROUND: Readonly<Record<string, IntroGround>>;
+export const INTRO_MARKS: readonly IntroMark[];
+export const INTRO_STYLE_MARK: Readonly<Record<string, IntroMark>>;
export const INTRO_BEATS: Readonly<{
build: Readonly<{ from: number; to: number }>;
chime: Readonly<{ from: number; to: number }>;
diff --git a/common/lib/report/intro.mjs b/common/lib/report/intro.mjs
@@ -11,7 +11,7 @@
// which cannot import umtool, refuses exactly what the build refuses.
//
// "render": { "intro": "boot" } the style alone
-// "render": { "intro": { "style": "boot-dark", "ground": "light",
+// "render": { "intro": { "style": "boot-dark", "ground": "light", "mark": "chime",
// "sound": "intro.wav", "seconds": 4.5 } } or its knobs
//
// Absent (or null): no intro, and the cut renders exactly as it did.
@@ -36,6 +36,24 @@ export const INTRO_STYLE_GROUND = Object.freeze({
});
/**
+ * How the Found-line mark (the lockup's square with its lines) comes in:
+ * `none` (the wordmark alone), `draw` (the square, then its lines drawn one
+ * after another during the first sound -- boot-mark's) or `chime` (the whole
+ * mark pops in on the chime, with MEDIA, and the wordmark slides over to make
+ * room for it). Any style takes any of them.
+ */
+export const INTRO_MARKS = Object.freeze(["none", "draw", "chime"]);
+
+/** Each style's mark when the key names none. */
+export const INTRO_STYLE_MARK = Object.freeze({
+ boot: "none",
+ "boot-wipe": "none",
+ "boot-dark": "none",
+ "boot-cascade": "none",
+ "boot-mark": "draw",
+});
+
+/**
* The beats, in seconds from the intro's first frame: measured off the stand-in
* sound (the GBA boot: silence to 0.34, the build 0.34–2.32, a gap, the chime
* 2.78–3.94, silence to 4.18). Every style times its motion to these, so a
@@ -58,11 +76,11 @@ export const INTRO_SECONDS_MAX = 8;
export const INTRO_ID = "brand-intro";
/**
- * `render.intro` read: null (no intro) or `{ style, ground, sound, seconds }`
+ * `render.intro` read: null (no intro) or `{ style, ground, mark, sound, seconds }`
* with the defaults filled in. `sound` stays as written: `undefined` is the
* stand-in, `false` silence, a string a file (report-to-video resolves it).
* Assumes a key `introErrors` passes; a bad one reads as what it can.
- * @returns {null | { style: string, ground: "light" | "dark", sound: string | false | undefined, seconds: number }}
+ * @returns {null | { style: string, ground: "light" | "dark", mark: "none" | "draw" | "chime", sound: string | false | undefined, seconds: number }}
*/
export function introOf(render) {
const v = render?.intro;
@@ -72,18 +90,19 @@ export function introOf(render) {
return {
style,
ground: o.ground === "light" || o.ground === "dark" ? o.ground : (INTRO_STYLE_GROUND[style] ?? "light"),
+ mark: INTRO_MARKS.includes(o.mark) ? o.mark : (INTRO_STYLE_MARK[style] ?? "none"),
sound: o.sound === false || typeof o.sound === "string" ? o.sound : undefined,
seconds: Number.isFinite(o.seconds) ? o.seconds : INTRO_SECONDS,
};
}
-const KEYS = ["style", "ground", "sound", "seconds"];
+const KEYS = ["style", "ground", "mark", "sound", "seconds"];
/** Every reason `value` (a `render.intro`) cannot be built, as sentences naming the key. */
export function introErrors(value) {
if (value === undefined || value === null) return [];
const o = typeof value === "string" ? { style: value } : value;
- if (!isObj(o)) return [`render.intro must be a style name (${INTRO_STYLES.join(", ")}) or an object {style, ground?, sound?, seconds?}`];
+ if (!isObj(o)) return [`render.intro must be a style name (${INTRO_STYLES.join(", ")}) or an object {style, ground?, mark?, sound?, seconds?}`];
const errors = [];
for (const k of Object.keys(o)) if (!KEYS.includes(k)) errors.push(`render.intro.${k} is not a key (${KEYS.join(", ")})`);
if (!INTRO_STYLES.includes(o.style)) {
@@ -92,6 +111,9 @@ export function introErrors(value) {
if (o.ground !== undefined && !INTRO_GROUNDS.includes(o.ground)) {
errors.push(`render.intro.ground must be ${INTRO_GROUNDS.join(" or ")}, got ${JSON.stringify(o.ground)}`);
}
+ if (o.mark !== undefined && !INTRO_MARKS.includes(o.mark)) {
+ errors.push(`render.intro.mark must be ${INTRO_MARKS.join(", ")}, got ${JSON.stringify(o.mark)}`);
+ }
if (o.sound !== undefined && o.sound !== false && !(typeof o.sound === "string" && o.sound.trim())) {
errors.push("render.intro.sound must be a sound file's path (relative to the manifest) or false (a silent intro)");
}
diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md
@@ -13,6 +13,7 @@
- **`pnpm archilyzer corpus grep` searches the live corpus's transcripts from a terminal, with no editor and no index.** `--regex '<pattern>'` with `--channels a,b`, `--since YYYY-MM-DD`, `--until`, `--window 30`, `--limit N`, `--case-sensitive` and `--json`. It reads each held video's transcript the way the video page does (the cues file, else the best English caption track, en-orig before en), dates it by the video's upload date, and prints each hit's date, channel, id, start second, title and 30 seconds of text, then the videos in range that have no transcript yet. A channel whose drive is not answering is skipped and named. The MCP and the sites read only what was last published; this reads what is on disk now. It writes nothing.
- **`pnpm ops get x-session` says whether an X job would start now, and why not.** It answers the X login in use (the connected profile's cookie jar, or the browser's cookies), when the jar was last refreshed and its age in minutes, the limit (`social.x.maxCookieAgeMinutes`), whether X's cookie alert is up, `allowed`, and the refusal an X job would get. It is the same check that refuses a stale-cookie X job, so an assistant can ask before it queues an X fetch instead of finding out from a refusal. Needs a restart of the editor.
- **A report video can open with a short Archilyzer intro.** "Archilyzer" builds in on the first sound and "MEDIA" lands under it on the chime, after the Game Boy Advance boot screen, then it fades and dissolves into the video. Five styles: `boot` (the letters tumble in large in the sites' accent colours and settle), `boot-wipe` (the word revealed left to right at an even pace), `boot-dark` (`boot` on the videos' dark ground), `boot-cascade` (the letters drop in one after another) and `boot-mark` (the mark's lines are drawn, then the word). Each is about 4 seconds, and the rest of the video starts that much later. The intro is not a chapter: the first chapter still starts at 0:00. Set it on the Build tab's **Look** panel (**Intro**), with `umtool look <project> intro=boot-dark` (`intro=` turns it off), or in a take (`--set render.intro=boot-wipe`). The sound is the GBA's own boot sound for now, a stand-in to replace before any public release; it is not in the repository, so a new checkout makes it once with `node umtool/report-to-video/intro.mjs extract-sound <the GBA startup video>`. A video without an intro builds exactly as before. Needs a restart of umtool and a rebuild of the video.
+- **The intro's mark can pop in on the chime.** A new intro setting, `mark`, says how the Found-line mark (the square with its lines) comes in, with any style: `none` (the word alone, the default for every style but `boot-mark`), `draw` (its lines drawn one by one, as `boot-mark` does) or `chime` (the whole mark pops in on the second sound, with MEDIA, and the word slides over to make room beside it). For the tumbling letters on the dark ground with the mark on the chime, set `{"style": "boot-dark", "mark": "chime"}`, or in a take `--set render.intro.style=boot-dark --set render.intro.mark=chime`. Any other value is refused by name. The existing styles look exactly as before. Needs a restart of umtool and a rebuild of the video.
- **A tall post screenshot in the posts feed grows into the room the column has, instead of shrinking to a thumbnail.** A screenshot was capped at the height of a card of words and drawn smaller to fit it, so a post with a picture (the Huck video's "Hucks home!!!!!! God Is Good!!!") came out a narrow strip beside empty space. Now a picture cut by that cap grows, up to its own full-width height, into the room left in the column beside the card under it — that card stays on screen; only cards further down scroll out as before. A post that fits, and a card of words, are drawn as they were. Needs a restart of umtool and a rebuild of the video.
- **Every wait before the archive asks a site now varies a little, and only ever upward.** A job every 20.0 s, a page every 3.0 s or a sync at the same minute each day is a machine's beat, so each such wait is now stretched by up to a quarter of itself at random, and never shortened: every pacing number stays a minimum (Rumble's 120 s, X's 5 min, the sleep between downloads). It covers the gap between two downloads and between two jobs on one platform, yt-dlp's `--sleep-requests` and `--sleep-subtitles` (drawn once per yt-dlp run, and shown in its logged command line), the archive.org, Wayback and web-fetch gaps, the rate-limit cooldowns and the platform hold's probe, the download lane's metadata-scan batches (60 to 75 titles) and its rests, Save Page Now's and the Kick recorder's polls, and each channel's sync interval (later by at most 30 minutes, the same on every tick until it syncs, and shown so on /operations/sync). The share is **Jitter on every wait before a request** on /settings (`pacing.jitter`, default 25 %; 0 turns it off). Three waits that already varied could come out SHORTER than their minimum and no longer do: the platform cooldown (±10 %), archive.org's back-off (±20 %) and a forum's page pause (as little as 0.85 of it, under its own 5 s floor). It now lands between the pause and 1.8 times it. Four loops that asked a site with no gap at all now wait between requests: a Bluesky feed's pages (3–6 s), a Nitter timeline's pages (4 s and up), the availability check's per-video probes (3 s and up) and umtool's network clip fetches in a build with no editor (one at a time per platform, 30 s apart, Rumble 120 s). Needs a restart of the editor and of umtool.
- **The download lane's metadata scan reads 60 titles at a time and lets the downloads run in between.** A filtered channel's scan holds its platform's download queue while it runs, and the lane used to scan the whole backlog in one go: on 2026-10-25 the scan of h3-podcast's 1,163 unread titles, which started the moment the channel's download pause was lifted, held YouTube from 03:20 to 06:36 and nothing downloaded. The lane now scans 60 titles (about 10 minutes on YouTube), gives that platform 20 minutes of downloads, then scans the next 60, and its log says so: "1103 listed videos left to scan for h3-podcast; the next batch after 20 minutes of downloads." A scan that a platform stopped (a soft block, a rate limit) is still not retried until the next restart. **Run** on the metadata-scan operation still scans the whole backlog. Needs a restart of the editor.
diff --git a/umtool/docs/report-video.md b/umtool/docs/report-video.md
@@ -1412,6 +1412,7 @@ or `null` is no intro, and the cut is built exactly as before):
"render": { "intro": "boot" } // a style by name
"render": { "intro": { "style": "boot-wipe", // or with its knobs:
"ground": "dark", // light | dark (each style has its own default)
+ "mark": "chime", // none | draw | chime (boot-mark: draw; the rest: none)
"sound": "sting.wav", // a file beside the manifest; false = silent; absent = the stand-in
"seconds": 4.18 } } // 3.5–8, default 4.18 (the stand-in sound's length)
```
@@ -1425,6 +1426,18 @@ or `null` is no intro, and the cut is built exactly as before):
| `boot-mark` | dark | The whole lockup: the Found-line mark's square, then its lines drawn one after another, the wordmark sliding out of it, the shimmer, MEDIA on the chime. |
`ground` overrides a style's (`{"style": "boot-wipe", "ground": "dark"}`).
+
+`mark` says how the Found-line mark (the lockup's square with its four lines)
+comes in, on any style: `none`, the wordmark alone (every style's default but
+boot-mark's); `draw`, the square and then its lines drawn one after another
+during the first sound (boot-mark's); `chime`, nothing of the mark until the
+chime (2.78 s), when the whole mark pops in at once -- from nothing, past its
+size and back, turning upright -- together with MEDIA, while the text, built
+centred on its own, slides over to make room, ending on the same lockup as
+boot-mark's last frame. `{"style": "boot-dark", "mark": "chime"}` is the
+tumble on the dark ground with the mark popped in on the chime. With a mark
+the drawing is framed as the whole lockup (~70% of the width), so its letters
+are a little smaller than the wordmark alone (~61%).
Every style is timed to the stand-in sound's measured beats
(common/lib/report/intro.mjs `INTRO_BEATS`): silence to 0.34 s, the build
0.34–2.32 s, the chime from 2.78 s, the fade over the last 0.5 s. A replacement
@@ -1457,7 +1470,7 @@ until then a build with an intro and no `sound` refuses, naming that command.
**Rendered once.** The intro is the same picture in every cut of a size, so it
is rendered (HyperFrames, as the deck is) and encoded once and kept by its key
--- the page (style, ground, size, fps, length), the sound's bytes, the encode's
+-- the page (style, ground, mark, size, fps, length), the sound's bytes, the encode's
parameters and the renderer's version -- as `<key>.mp4` in
`~/.cache/umtool/intro/` (`UMTOOL_INTRO_CACHE` moves it). Each cut copies it
into `segments/brand-intro.mp4` with `brand-intro.intro.json` beside it; a
@@ -1466,7 +1479,9 @@ build whose record names the same key does nothing, `--chrome-only` included.
**Setting it.** The Build tab's **Look** panel has **Intro** (none or a
style); from a terminal `umtool look <project> intro=boot-dark` (`intro=`
clears it); a take compares styles with
-`umtool take <project> --id intro-wipe --label "Intro: wipe" --set render.intro=boot-wipe`.
+`umtool take <project> --id intro-wipe --label "Intro: wipe" --set render.intro=boot-wipe`
+(a knob beside the style: `--set render.intro.style=boot-dark --set render.intro.mark=chime`;
+the Look panel picks the style alone).
The validators refuse an unknown style, ground, length or key by name
(`validateLook`, so the Look panel, `umtool look`, a take and the build all
refuse the same thing).
diff --git a/umtool/report-to-video/chrome-intro.mjs b/umtool/report-to-video/chrome-intro.mjs
@@ -17,7 +17,7 @@
// a render is a seek per frame, from parallel workers, in any order). Every
// cue is a fromTo whose FROM is stated; the page is a dumb interpreter of
// `introCues`, so the tests read every time it uses.
-import { INTRO_BEATS } from "yt-dlp-transcript-common/lib/report/intro.mjs";
+import { INTRO_BEATS, INTRO_STYLE_MARK } from "yt-dlp-transcript-common/lib/report/intro.mjs";
import { pageDuration } from "./deck.mjs";
const r3 = (v) => Math.round(v * 1000) / 1000;
@@ -150,14 +150,17 @@ export function lockupParts(kit) {
* Everything the intro's timeline does, as data: `{ init, cues }`. Keys name
* elements by `data-k`: `stage` (the whole drawing: the fade), `w<i>` / `f<i>`
* (letter i's group -- its motion -- and its path -- its fill), `wipe` /
- * `edge` (the wipe's clip and its leading line), `mwipe` (MEDIA's), and
- * `m<j>` (the mark's shapes, boot-mark). Letter indexes run over the
- * wordmark's ten letters, then MEDIA's five.
+ * `edge` (the wipe's clip and its leading line), `mwipe` (MEDIA's),
+ * `m<j>` (the mark's shapes, `mark: "draw"`), and `mark` / `slide` (the
+ * whole mark and the whole text, `mark: "chime"`). Letter indexes run over
+ * the wordmark's ten letters, then MEDIA's five.
*
* Beats (INTRO_BEATS): the wordmark is built inside the first sound, MEDIA
- * lands on the chime, and the last `fade` seconds fade to the ground.
+ * lands on the chime, and the last `fade` seconds fade to the ground. The
+ * mark (`mark`, the style's own when absent) is drawn during the first sound
+ * or pops in on the chime.
*/
-export function introCues({ style, ground, seconds, parts, palette }) {
+export function introCues({ style, ground, mark = INTRO_STYLE_MARK[style] ?? "none", seconds, parts, palette }) {
const B = INTRO_BEATS;
const init = {};
const cues = [];
@@ -178,6 +181,43 @@ export function introCues({ style, ground, seconds, parts, palette }) {
});
init.stage = { opacity: 1 };
+ // The mark drawn: the square first, then its found lines left to right one
+ // after another (the accent one with its arrow) -- boot-mark's opening.
+ if (mark === "draw") {
+ const bars = parts.markShapes ?? [];
+ bars.forEach((s, j) => {
+ if (s.kind === "ground") {
+ init[`m${j}`] = { scale: 0.82, opacity: 0, transformOrigin: "50% 50%" };
+ cue(`m${j}`, build.from, 0.45, { scale: 0.82, opacity: 0 }, { scale: 1, opacity: 1 }, "power3.out");
+ return;
+ }
+ const at = build.from + 0.12 * j;
+ if (s.kind === "arrow") {
+ init[`m${j}`] = { scale: 0, opacity: 0, transformOrigin: "0% 50%" };
+ cue(`m${j}`, at, 0.3, { scale: 0, opacity: 0 }, { scale: 1, opacity: 1 }, "back.out(2)");
+ } else {
+ init[`m${j}`] = { scaleX: 0, transformOrigin: "0% 50%" };
+ cue(`m${j}`, at, 0.5, { scaleX: 0 }, { scaleX: 1 }, "power3.out");
+ }
+ });
+ }
+ // The mark popped: nothing of it until the chime, then the whole mark at
+ // once, from nothing past its size and back, turning upright as it lands.
+ if (mark === "chime") {
+ init.mark = { scale: 0, rotation: -14, opacity: 0, transformOrigin: "50% 50%" };
+ cue("mark", chime, 0.07, { opacity: 0 }, { opacity: 1 }, "none");
+ cue("mark", chime, 0.5, { scale: 0, rotation: -14 }, { scale: 1, rotation: 0 }, "back.out(2.4)");
+ if (parts.mark) {
+ // The text stands centred on its own until then, and slides over as
+ // the mark arrives: the lockup's centre is the frame's at the end.
+ // (Tried against laying the build out with the mark's room already
+ // left: that tumbles the whole wordmark in off-centre, beside nothing.)
+ const x = r3(parts.mark.x / 2);
+ init.slide = { x };
+ cue("slide", chime, 0.42, { x }, { x: 0 }, "power3.out");
+ }
+ }
+
// MEDIA, on the chime: each letter rises a little into place, one after
// another, in the accent -- the same in every style but the wipe's.
const mediaIn = (lift = 26) => {
@@ -262,25 +302,8 @@ export function introCues({ style, ground, seconds, parts, palette }) {
cue("mwipe", chime, 0.36, { attr: { width: 0 } }, { attr: { width: x1 - x0 } }, "power2.out");
shimmer(build.to + 0.04, 0.03);
} else if (motion === "boot-mark") {
- // The mark first: its found lines drawn left to right one after another
- // (the accent one with its arrow), then the wordmark slides out of it,
- // then the shimmer, and MEDIA on the chime.
- const bars = parts.markShapes ?? [];
- bars.forEach((s, j) => {
- if (s.kind === "ground") {
- init[`m${j}`] = { scale: 0.82, opacity: 0, transformOrigin: "50% 50%" };
- cue(`m${j}`, build.from, 0.45, { scale: 0.82, opacity: 0 }, { scale: 1, opacity: 1 }, "power3.out");
- return;
- }
- const at = build.from + 0.12 * j;
- if (s.kind === "arrow") {
- init[`m${j}`] = { scale: 0, opacity: 0, transformOrigin: "0% 50%" };
- cue(`m${j}`, at, 0.3, { scale: 0, opacity: 0 }, { scale: 1, opacity: 1 }, "back.out(2)");
- } else {
- init[`m${j}`] = { scaleX: 0, transformOrigin: "0% 50%" };
- cue(`m${j}`, at, 0.5, { scaleX: 0 }, { scaleX: 1 }, "power3.out");
- }
- });
+ // The mark first (drawn, above, by its default `mark: "draw"`), then the
+ // wordmark slides out of it, then the shimmer, and MEDIA on the chime.
word.forEach((l, i) => {
const at = 1.0 + i * 0.07;
init[`w${i}`] = { ...init[`w${i}`], x: -40, opacity: 0 };
@@ -301,7 +324,7 @@ export function introCues({ style, ground, seconds, parts, palette }) {
// The page.
// ---------------------------------------------------------------------------
-/** The mark's shapes (boot-mark), each with the origin it grows from, in lockup units. */
+/** The mark's shapes (`mark: "draw"`), each with the origin it grows from, in lockup units. */
function markShapes(mark) {
if (!mark) return [];
const k = mark.size / 512;
@@ -331,15 +354,16 @@ function markShapes(mark) {
/**
* The intro's page.
- * @param {{ style: string, ground: "light" | "dark", seconds: number, width?: number, height?: number, fps?: number,
- * kit: any, gsapSrc?: string }} o
+ * @param {{ style: string, ground: "light" | "dark", mark?: "none" | "draw" | "chime", seconds: number,
+ * width?: number, height?: number, fps?: number, kit: any, gsapSrc?: string }} o
*/
-export function introHtml({ style, ground, seconds, width = 1920, height = 1080, fps = 30, kit, gsapSrc = "assets/gsap.min.js" }) {
+export function introHtml({ style, ground, mark = INTRO_STYLE_MARK[style] ?? "none", seconds, width = 1920, height = 1080, fps = 30, kit, gsapSrc = "assets/gsap.min.js" }) {
const W = width;
const H = height;
const palette = introPalette(ground, kit);
const parts = lockupParts(kit);
- const withMark = style === "boot-mark";
+ const withMark = mark !== "none" && !!parts.mark;
+ const popped = withMark && mark === "chime";
const shapes = withMark ? markShapes(parts.mark) : [];
// The drawing's extent in lockup units, and the scale that sets it in the
// frame: the wordmark ~61% of the width (the lockup with its mark ~70%).
@@ -350,7 +374,7 @@ export function introHtml({ style, ground, seconds, width = 1920, height = 1080,
const k = r3((W * (withMark ? 0.7 : 0.61)) / (x1 - x0));
const ox = r3(W / 2 - ((x0 + x1) / 2) * k);
const oy = r3(H / 2 - ((y0 + y1) / 2) * k);
- const { init, cues } = introCues({ style, ground, seconds, parts: { ...parts, markShapes: shapes }, palette });
+ const { init, cues } = introCues({ style, ground, mark: withMark ? mark : "none", seconds, parts: { ...parts, markShapes: shapes }, palette });
const dur = pageDuration(seconds, fps);
const nW = parts.letters.filter((l) => l.role !== "media").length;
@@ -365,9 +389,9 @@ export function introHtml({ style, ground, seconds, width = 1920, height = 1080,
<clipPath id="intro-mwipe"><rect data-k="mwipe" x="-4" y="${r3(parts.mediaTop - pad)}" width="0" height="${r3(parts.bottom - parts.mediaTop + 2 * pad)}"/></clipPath>`
: "";
const markEls = withMark
- ? `<g transform="translate(${parts.mark.x} ${parts.mark.y}) scale(${r3(parts.mark.size / 512)})">
+ ? `${popped ? '<g data-k="mark">' : ""}<g transform="translate(${parts.mark.x} ${parts.mark.y}) scale(${r3(parts.mark.size / 512)})">
${shapes.map((s, j) => `<g data-k="m${j}" fill="${s.kind === "ground" ? palette.markGround : s.fill}">${s.el}</g>`).join("\n ")}
- </g>`
+ </g>${popped ? "</g>" : ""}`
: "";
const edgeH = r3(parts.wordBottom - parts.top + 24);
const data = { init, cues };
@@ -403,7 +427,8 @@ export function introHtml({ style, ground, seconds, width = 1920, height = 1080,
<rect width="${W}" height="${H}" fill="${palette.ground}"/>
<g data-k="stage">
<g transform="translate(${ox} ${oy}) scale(${k})">
- ${markEls}
+ ${markEls}${popped ? `
+ <g data-k="slide">` : ""}
${wiped ? `<g data-k="glow"><rect x="-70" y="${r3(parts.top - 12)}" width="70" height="${edgeH}" fill="url(#intro-edge)" opacity="0.22"/></g>
` : ""}<g${wiped ? ' clip-path="url(#intro-wipe)"' : ""}>
${wordGlyphs}
@@ -411,7 +436,8 @@ export function introHtml({ style, ground, seconds, width = 1920, height = 1080,
<g data-k="edge"><rect x="-3" y="${r3(parts.top - 12)}" width="6" height="${edgeH}" rx="3" fill="${palette.lit}"/></g>` : ""}
<g${wiped ? ' clip-path="url(#intro-mwipe)"' : ""}>
${mediaGlyphs}
- </g>
+ </g>${popped ? `
+ </g>` : ""}
</g>
</g>
</svg>
diff --git a/umtool/report-to-video/intro.mjs b/umtool/report-to-video/intro.mjs
@@ -3,7 +3,7 @@
// with -- "Archilyzer" built in on the first sound, "media" beneath it on the
// chime, after the Game Boy Advance boot screen.
//
-// "render": { "intro": "boot" } (or { style, ground?, sound?, seconds? })
+// "render": { "intro": "boot" } (or { style, ground?, mark?, sound?, seconds? })
//
// Absent or null: no intro, and the cut is built exactly as before -- the
// timeline is not touched (introManifest returns the manifest itself).
@@ -32,14 +32,14 @@
// the manifest) is that replacement; `sound: false` is a silent intro.
//
// THE CACHE. The intro is the same picture in every cut of a size, so it is
-// rendered once and kept by its key -- the page (style, ground, size, fps,
+// rendered once and kept by its key -- the page (style, ground, mark, size, fps,
// length), the sound's bytes and the encode's parameters -- as
// `<cache>/<key>.mp4` (UMTOOL_INTRO_CACHE, default ~/.cache/umtool/intro), and
// copied into each cut's segments/brand-intro.mp4 with a record beside it
// (`brand-intro.intro.json`). A cut whose record names the key builds nothing.
//
// On the CLI (variants for judging, outside any cut):
-// node intro.mjs render --style boot [--ground light|dark] [--seconds 4.18]
+// node intro.mjs render --style boot [--ground light|dark] [--mark none|draw|chime] [--seconds 4.18]
// [--sound <wav> | --silent] [--width 1920 --height 1080 --fps 30] --out <file.mp4>
// node intro.mjs extract-sound <reference.mp4>
// `render` takes the heavy slot (heavy-gate.mjs) unless HEAVY=0.
@@ -53,13 +53,13 @@ import { fileURLToPath, pathToFileURL } from "node:url";
import { promisify } from "node:util";
import {
- INTRO_BEATS, INTRO_GROUNDS, INTRO_ID, INTRO_SECONDS, INTRO_SECONDS_MAX, INTRO_SECONDS_MIN, INTRO_STYLE_GROUND, INTRO_STYLES,
- introErrors, introOf, validateIntro,
+ INTRO_BEATS, INTRO_GROUNDS, INTRO_ID, INTRO_MARKS, INTRO_SECONDS, INTRO_SECONDS_MAX, INTRO_SECONDS_MIN, INTRO_STYLE_GROUND,
+ INTRO_STYLE_MARK, INTRO_STYLES, introErrors, introOf, validateIntro,
} from "yt-dlp-transcript-common/lib/report/intro.mjs";
export {
- INTRO_BEATS, INTRO_GROUNDS, INTRO_ID, INTRO_SECONDS, INTRO_SECONDS_MAX, INTRO_SECONDS_MIN, INTRO_STYLE_GROUND, INTRO_STYLES,
- introErrors, introOf, validateIntro,
+ INTRO_BEATS, INTRO_GROUNDS, INTRO_ID, INTRO_MARKS, INTRO_SECONDS, INTRO_SECONDS_MAX, INTRO_SECONDS_MIN, INTRO_STYLE_GROUND,
+ INTRO_STYLE_MARK, INTRO_STYLES, introErrors, introOf, validateIntro,
};
const execFileP = promisify(execFile);
@@ -83,7 +83,7 @@ export function introEntry(render) {
const o = introOf(render);
if (!o) return null;
return {
- type: INTRO_TYPE, id: INTRO_ID, style: o.style, ground: o.ground, seconds: o.seconds,
+ type: INTRO_TYPE, id: INTRO_ID, style: o.style, ground: o.ground, mark: o.mark, seconds: o.seconds,
...(o.sound !== undefined ? { sound: o.sound } : {}),
// A placeholder's words (umtool's Play view, the deck's table).
heading: "Intro",
@@ -199,7 +199,11 @@ async function probeSeconds(file) {
* cacheDir?: string, workers?: number, emit?: (ev: string, f: object) => void, standin?: string }} o
*/
export async function renderIntro({ entry, render, encode, manifestDir = process.cwd(), workDir, cacheDir = introCacheDir(), workers = 4, emit = () => {}, standin = INTRO_STANDIN_SOUND }) {
- const errors = introErrors({ style: entry.style, ground: entry.ground, seconds: entry.seconds, ...(entry.sound !== undefined ? { sound: entry.sound } : {}) });
+ const errors = introErrors({
+ style: entry.style, ground: entry.ground, seconds: entry.seconds,
+ ...(entry.mark !== undefined ? { mark: entry.mark } : {}),
+ ...(entry.sound !== undefined ? { sound: entry.sound } : {}),
+ });
if (errors.length) throw new Error(errors.join("; "));
const { introHtml } = await import("./chrome-intro.mjs");
const { brandKit } = await import("./brand.mjs");
@@ -207,7 +211,10 @@ export async function renderIntro({ entry, render, encode, manifestDir = process
const W = render.width ?? 1920;
const H = render.height ?? 1080;
const fps = render.fps ?? 30;
- const html = introHtml({ style: entry.style, ground: entry.ground, seconds: entry.seconds, width: W, height: H, fps, kit: brandKit("archilyzer-media") });
+ const html = introHtml({
+ style: entry.style, ground: entry.ground, ...(entry.mark !== undefined ? { mark: entry.mark } : {}),
+ seconds: entry.seconds, width: W, height: H, fps, kit: brandKit("archilyzer-media"),
+ });
const sound = introSoundPath(entry, manifestDir, standin);
let soundSha = null;
if (sound) {
@@ -280,7 +287,7 @@ export async function buildIntroSegment(entry, { render, encode, outDir, manifes
await rm(tmp, { force: true });
}
const recTmp = `${recPath}.${process.pid}.tmp`;
- await writeFile(/* turbopackIgnore: true */ recTmp, JSON.stringify({ key: r.key, style: entry.style, ground: entry.ground, seconds: entry.seconds, cached: r.cached }) + "\n");
+ await writeFile(/* turbopackIgnore: true */ recTmp, JSON.stringify({ key: r.key, style: entry.style, ground: entry.ground, mark: entry.mark, seconds: entry.seconds, cached: r.cached }) + "\n");
await rename(recTmp, recPath);
if (r.cached) emit("note", { id: entry.id, message: `${entry.id}: intro from the cache (key ${r.key.slice(0, 12)})` });
return seg;
@@ -311,7 +318,8 @@ async function main(argv) {
}
if (cmd !== "render") {
console.error(
- "usage: intro.mjs render --style <" + INTRO_STYLES.join("|") + "> [--ground light|dark] [--seconds s]\n" +
+ "usage: intro.mjs render --style <" + INTRO_STYLES.join("|") + "> [--ground light|dark] [--mark " + INTRO_MARKS.join("|") + "]\n" +
+ " [--seconds s]\n" +
" [--sound <wav> | --silent] [--width 1920 --height 1080 --fps 30] --out <file.mp4>\n" +
" intro.mjs extract-sound <reference.mp4> [--out <wav>]",
);
@@ -322,6 +330,7 @@ async function main(argv) {
const intro = {
style: flag("--style"),
...(flag("--ground") ? { ground: flag("--ground") } : {}),
+ ...(flag("--mark") ? { mark: flag("--mark") } : {}),
...(flag("--seconds") ? { seconds: Number(flag("--seconds")) } : {}),
...(rest.includes("--silent") ? { sound: false } : flag("--sound") ? { sound: path.resolve(/* turbopackIgnore: true */ flag("--sound")) } : {}),
};
@@ -341,7 +350,7 @@ async function main(argv) {
await rm(workDir, { recursive: true, force: true });
await mkdir(/* turbopackIgnore: true */ path.dirname(/* turbopackIgnore: true */ path.resolve(/* turbopackIgnore: true */ out)), { recursive: true });
await copyFile(r.path, out);
- console.log(`${entry.style} (${entry.ground}) -> ${out}${r.cached ? " (cached)" : ""} key ${r.key.slice(0, 12)}`);
+ console.log(`${entry.style} (${entry.ground}, mark ${entry.mark}) -> ${out}${r.cached ? " (cached)" : ""} key ${r.key.slice(0, 12)}`);
};
const gate = new URL("./heavy-gate.mjs", pathToFileURL(process.argv[1])).href;
const { withRenderSlot } = await import(/* webpackIgnore: true */ gate);
diff --git a/umtool/report-to-video/intro.test.mjs b/umtool/report-to-video/intro.test.mjs
@@ -14,7 +14,7 @@ import { tmpdir } from "node:os";
import path from "node:path";
import {
- INTRO_BEATS, INTRO_ID, INTRO_SECONDS, INTRO_STANDIN_SOUND, INTRO_STYLES, buildIntroSegment, introAudioGraph,
+ INTRO_BEATS, INTRO_ID, INTRO_MARKS, INTRO_SECONDS, INTRO_STANDIN_SOUND, INTRO_STYLE_MARK, INTRO_STYLES, buildIntroSegment, introAudioGraph,
introEncodeArgs, introEntry, introErrors, introKey, introManifest, introOf, introRecordPath, introSoundPath,
missingSoundMessage, validateIntro,
} from "./intro.mjs";
@@ -38,17 +38,18 @@ const cut = (render) => ({ slug: "t", render: { ...RENDER, ...render }, timeline
// Validation
// ---------------------------------------------------------------------------
-test("render.intro: a style name or {style, ground, sound, seconds}; absent and null are no intro", () => {
+test("render.intro: a style name or {style, ground, mark, sound, seconds}; absent and null are no intro", () => {
assert.deepEqual(introErrors(undefined), []);
assert.deepEqual(introErrors(null), []);
for (const s of INTRO_STYLES) {
assert.deepEqual(introErrors(s), [], s);
assert.deepEqual(introErrors({ style: s, ground: "dark", sound: false, seconds: 5 }), [], s);
+ for (const mark of INTRO_MARKS) assert.deepEqual(introErrors({ style: s, mark }), [], `${s} ${mark}`);
}
assert.deepEqual(introErrors({ style: "boot", sound: "intro.wav" }), []);
assert.equal(introOf({}), null);
assert.equal(introOf({ intro: null }), null);
- assert.deepEqual(introOf({ intro: "boot" }), { style: "boot", ground: "light", sound: undefined, seconds: INTRO_SECONDS });
+ assert.deepEqual(introOf({ intro: "boot" }), { style: "boot", ground: "light", mark: "none", sound: undefined, seconds: INTRO_SECONDS });
assert.equal(introOf({ intro: "boot-dark" }).ground, "dark");
assert.equal(introOf({ intro: "boot-mark" }).ground, "dark");
assert.equal(introOf({ intro: { style: "boot-dark", ground: "light" } }).ground, "light", "a ground named beats the style's");
@@ -61,6 +62,22 @@ test("render.intro: an unknown style is refused by name, with the styles listed"
assert.match(introErrors({ ground: "dark" })[0], /style null is not an intro style/);
});
+test("render.intro.mark: none, draw or chime; boot-mark draws it, every other style has none", () => {
+ assert.deepEqual([...INTRO_MARKS], ["none", "draw", "chime"]);
+ for (const s of INTRO_STYLES) assert.equal(introOf({ intro: s }).mark, s === "boot-mark" ? "draw" : "none", s);
+ assert.equal(INTRO_STYLE_MARK["boot-mark"], "draw");
+ assert.equal(introOf({ intro: { style: "boot-dark", mark: "chime" } }).mark, "chime", "a mark named beats the style's");
+ assert.equal(introOf({ intro: { style: "boot-mark", mark: "none" } }).mark, "none");
+ assert.match(introErrors({ style: "boot", mark: "pop" }).join(), /render\.intro\.mark must be none, draw, chime, got "pop"/);
+ assert.match(introErrors({ style: "boot", mark: true }).join(), /render\.intro\.mark must be/);
+ // A take sets it as one more knob, beside the style.
+ const take = mergePatch(cut({ intro: "boot" }), patchFromSets(["render.intro.style=boot-dark", "render.intro.mark=chime"]));
+ assert.deepEqual(validateLook(take), []);
+ const entry = selectVariant(take).timeline[0];
+ assert.deepEqual([entry.style, entry.ground, entry.mark], ["boot-dark", "dark", "chime"]);
+ assert.match(applyLookPatch(cut({}), { intro: { style: "boot", mark: "drawn" } }).errors.join(), /render\.intro\.mark must be/);
+});
+
test("render.intro: a bad ground, sound, length or key is refused, each by its name", () => {
assert.match(introErrors({ style: "boot", ground: "grey" }).join(), /render\.intro\.ground must be light or dark/);
assert.match(introErrors({ style: "boot", sound: 3 }).join(), /render\.intro\.sound must be/);
@@ -116,7 +133,7 @@ test("no render.intro: selectVariant's timeline is the manifest's, entry for ent
test("render.intro: selectVariant opens the cut with the intro entry, everything else after it in order", () => {
const sel = selectVariant(cut({ intro: { style: "boot-dark", seconds: 4.5 } }));
assert.deepEqual(sel.timeline.map((e) => e.id), [INTRO_ID, ...TIMELINE.map((e) => e.id)]);
- assert.deepEqual(sel.timeline[0], { type: "intro", id: INTRO_ID, style: "boot-dark", ground: "dark", seconds: 4.5, heading: "Intro" });
+ assert.deepEqual(sel.timeline[0], { type: "intro", id: INTRO_ID, style: "boot-dark", ground: "dark", mark: "none", seconds: 4.5, heading: "Intro" });
// A second pass (a reader that selects a selected cut) does not add a second intro.
assert.equal(introManifest(sel).timeline.filter((e) => e.type === "intro").length, 1);
assert.equal(introEntry({ intro: { style: "boot", sound: false } }).sound, false);
@@ -232,6 +249,48 @@ test("boot-cascade drops the letters one after another, evenly", () => {
assert.ok(gaps.every((g) => Math.abs(g - gaps[0]) <= 0.002), `even: ${gaps}`);
});
+test("mark: chime -- nothing of the mark before the chime, then it pops (overshooting) as the text slides over to make room", () => {
+ const p = lockupParts(kit);
+ const palette = introPalette("dark", kit);
+ const { init, cues } = introCues({ style: "boot-dark", ground: "dark", mark: "chime", seconds: INTRO_SECONDS, parts: p, palette });
+ assert.equal(init.mark.scale, 0);
+ assert.equal(init.mark.opacity, 0);
+ const pop = cues.filter((c) => c.k === "mark");
+ assert.ok(pop.length >= 2);
+ for (const c of pop) assert.equal(c.at, INTRO_BEATS.chime.from, "the pop starts on the chime");
+ const grow = pop.find((c) => c.to.scale !== undefined);
+ assert.equal(grow.to.scale, 1);
+ assert.match(grow.ease, /^back\.out/, "an overshoot, not a draw");
+ assert.ok(!cues.some((c) => /^m\d/.test(c.k)), "no line-by-line draw");
+ // The text starts centred on its own (half the mark's room to the left) and ends where the lockup puts it.
+ assert.equal(init.slide.x, Math.round((p.mark.x / 2) * 1000) / 1000);
+ const slide = cues.find((c) => c.k === "slide");
+ assert.equal(slide.at, INTRO_BEATS.chime.from);
+ assert.equal(slide.to.x, 0);
+ // The tumble itself is boot-dark's, letter for letter.
+ const plain = introCues({ style: "boot-dark", ground: "dark", seconds: INTRO_SECONDS, parts: p, palette });
+ assert.deepEqual(cues.filter((c) => /^[wf]\d/.test(c.k)), plain.cues.filter((c) => /^[wf]\d/.test(c.k)));
+ // The page: the mark in its pop group, the text in its slide group, on the lockup's framing.
+ const html = introHtml({ style: "boot-dark", ground: "dark", mark: "chime", seconds: INTRO_SECONDS, kit });
+ assert.match(html, /<g data-k="mark"><g transform="translate\(-/);
+ assert.match(html, /<g data-k="slide">/);
+ assert.ok(!/data-k="slide"/.test(introHtml({ style: "boot-dark", ground: "dark", seconds: INTRO_SECONDS, kit })), "no mark, no slide");
+});
+
+test("mark: draw is boot-mark's draw, and naming a style's own mark draws the same page", () => {
+ const p = lockupParts(kit);
+ const shapes = introHtml({ style: "boot-mark", ground: "dark", seconds: INTRO_SECONDS, kit });
+ assert.equal(introHtml({ style: "boot-mark", ground: "dark", mark: "draw", seconds: INTRO_SECONDS, kit }), shapes);
+ assert.equal(introHtml({ style: "boot", ground: "light", mark: "none", seconds: INTRO_SECONDS, kit }), introHtml({ style: "boot", ground: "light", seconds: INTRO_SECONDS, kit }));
+ assert.match(shapes, /data-k="m0"/);
+ assert.ok(!/data-k="m0"/.test(introHtml({ style: "boot-mark", ground: "dark", mark: "none", seconds: INTRO_SECONDS, kit })), "mark: none drops it");
+ // A drawn mark on another style: its lines run inside the first sound.
+ const { cues } = introCues({ style: "boot", ground: "light", mark: "draw", seconds: INTRO_SECONDS, parts: { ...p, markShapes: [{ kind: "ground" }, { kind: "bar" }, { kind: "arrow" }] }, palette: introPalette("light", kit) });
+ const m = cues.filter((c) => /^m\d/.test(c.k));
+ assert.equal(new Set(m.map((c) => c.k)).size, 3);
+ for (const c of m) assert.ok(c.at >= INTRO_BEATS.build.from && c.at + c.dur <= INTRO_BEATS.build.to, `${c.k} at ${c.at}`);
+});
+
test("the page: one full-frame composition of the intro's length, its colours the ground's", () => {
const html = introHtml({ style: "boot-dark", ground: "dark", seconds: INTRO_SECONDS, kit });
assert.match(html, /data-composition-id="intro" data-start="0" data-duration="4\.1666"/);
@@ -260,9 +319,9 @@ test("the sound: absent is the stand-in, a path is the manifest's, false is sile
});
test("the cache key: the same intro is the same key; style, ground, size, fps, length, sound or encode change it", () => {
- const key = ({ style = "boot", ground = "light", width = 1920, height = 1080, fps = 30, seconds = INTRO_SECONDS, soundSha = "s1", crf = 20 } = {}) =>
+ const key = ({ style = "boot", ground = "light", mark = undefined, width = 1920, height = 1080, fps = 30, seconds = INTRO_SECONDS, soundSha = "s1", crf = 20 } = {}) =>
introKey({
- html: introHtml({ style, ground, seconds, width, height, fps, kit }), soundSha,
+ html: introHtml({ style, ground, ...(mark ? { mark } : {}), seconds, width, height, fps, kit }), soundSha,
encode: encodeArgs({ ...RENDER, fps, crf }), fps, frames: frameCount(seconds, fps), version: "hf",
});
const base = key();
@@ -270,7 +329,7 @@ test("the cache key: the same intro is the same key; style, ground, size, fps, l
assert.equal(key(), base);
const changed = [
key({ style: "boot-wipe" }), key({ ground: "dark" }), key({ width: 1280, height: 720 }), key({ fps: 60 }),
- key({ seconds: 5 }), key({ soundSha: "s2" }), key({ soundSha: null }), key({ crf: 23 }),
+ key({ seconds: 5 }), key({ soundSha: "s2" }), key({ soundSha: null }), key({ crf: 23 }), key({ mark: "chime" }), key({ mark: "draw" }),
];
for (const k of changed) assert.notEqual(k, base);
assert.equal(new Set(changed).size, changed.length);