teaser: no text overflows anywhere: teaser.textCheck(t) checks every visible text node (scroll size within its element, its box inside its card, every card in frame as drawn), render.ts --animatic runs it at every frame of the whole teaser into animatic-checks.json and tests/teaser.test.ts requires zero problems; reject titles shortened ('No demo account', 'Manifest refused'); fixes it found: terminal and pile rows wrap instead of being cut with an ellipsis, the scan findings wrap, the pile shows only the rows that fit whole (no streaming past the edge), caption, edge word, labels and end card line heights fit their glyphs, builds and products push straight in so the terminal stays in frame
This commit is contained in:
parent
20a764b3ee
commit
49557b4c74
6 changed files with 60 additions and 19 deletions
|
|
@ -235,6 +235,9 @@ async function animatic(base: string, dir: string): Promise<void> {
|
|||
// the reject card at every frame of its shot (safe margins, tests/teaser.test.ts)
|
||||
const rj = S.scene('reject'), rejectLayout: unknown[] = [];
|
||||
for (let i = 0; i < Math.round((rj.end - rj.start) * FPS); i++) rejectLayout.push(await page.evaluate(`teaser.rejectLayout(${rj.start + i / FPS})`));
|
||||
// text overflow at every frame of the whole teaser: each text node fits its element and its card, every card in frame
|
||||
const textFrames = Math.round(DURATION * FPS);
|
||||
const textProblems = await page.evaluate(`(() => { const out = []; for (let i = 0; i < ${textFrames}; i++) out.push(...teaser.textCheck(i / ${FPS})); return out; })()`) as unknown[];
|
||||
if (errors.length) throw new Error(`page errors:\n ${[...new Set(errors)].join('\n ')}`);
|
||||
// sound
|
||||
const wav = await page.evaluate(`import('./music.js').then(m => m.renderWav())`) as { base64: string };
|
||||
|
|
@ -263,7 +266,7 @@ async function animatic(base: string, dir: string): Promise<void> {
|
|||
return `${i + 1}. ${s.start.toFixed(1)}-${s.end.toFixed(1)} s (${(s.end - s.start).toFixed(1)} s) **${s.id}**: ${S.SHOT_NOTES[s.id]}${c.length ? ` · caption "${c.map((x: any) => x.text).join('", "')}" (${c.map((x: any) => `${x.from.toFixed(2)}-${x.to.toFixed(2)} s`).join(', ')})` : ''}`;
|
||||
}), ''];
|
||||
writeFileSync(join(dir, 'shots.md'), md.join('\n'));
|
||||
writeFileSync(join(OUT, 'animatic-checks.json'), JSON.stringify({ duration: DURATION, fps: FPS, frame: FORMAT, endLayout: layout, rejectLayout }, null, 2));
|
||||
writeFileSync(join(OUT, 'animatic-checks.json'), JSON.stringify({ duration: DURATION, fps: FPS, frame: FORMAT, endLayout: layout, rejectLayout, textFrames, textProblems }, null, 2));
|
||||
log(`animatic: ${dir} (draft.mp4, contact-sheet.png, shots.md); layout -> out/animatic-checks.json`);
|
||||
} finally { await browser.close(); }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue