diff --git a/package.json b/package.json index a78f3b0b..a37d9c35 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,8 @@ "test:media": "node scripts/smoke-media.mjs", "validate:short-form": "node .claude/skills/short-form-edit/scripts/validate-plan.mjs", "validate:footage": "node .claude/skills/short-form-edit/scripts/validate-footage.mjs", - "preflight:all": "node scripts/preflight-all.mjs" + "preflight:all": "node scripts/preflight-all.mjs", + "preview:cards": "node scripts/style-library/preview-cards.mjs" }, "engines": { "node": ">=22" diff --git a/scripts/style-library/preview-cards.mjs b/scripts/style-library/preview-cards.mjs new file mode 100644 index 00000000..d498a2f3 --- /dev/null +++ b/scripts/style-library/preview-cards.mjs @@ -0,0 +1,82 @@ +#!/usr/bin/env node +/** + * preview-cards.mjs — render the 2-3s loop + poster GUIDE.md requires per card. + * + * GUIDE: "a preview is produced by rendering the card on its own (via the + * HyperFrames CLI) and grabbing frame 1 as the poster. The preview script is + * added once the first real card exists" — this is that script. + * + * node scripts/style-library/preview-cards.mjs 03-mimmo + * node scripts/style-library/preview-cards.mjs 03-mimmo --seconds 3 + * node scripts/style-library/preview-cards.mjs 02-kallaway --card kallaway.t1.stat.bigfig + * + * The CLI renders a project directory, not a loose file, so each card is copied + * into a scratch project with its tokens.css beside it. tier2 cards are overlays + * and would preview as black, so they are rendered over a neutral backdrop — + * that backdrop exists only in the preview, never in the card. + * + * MP4 loops go to renders/previews/