--- name: motion-film description: "Create professional launch films, product explainer videos, app walkthroughs and kinetic-typography motion graphics as ONE self-contained HTML file (1920×1080 timeline, every frame a pure function of time), with a synthesized Web Audio score or a synced voiceover, verified frame-by-frame in headless Chrome and exportable to MP4. Use whenever someone asks for a launch video, promo, product demo or walkthrough video, explainer, animated ad, kinetic typography, motion graphics, title sequence, social clip, or \"make a video\" without a video editor, even if they only share a script, screenshots, a brand guide, a voiceover MP3 or reference videos. Accepts creative dials --creativity, --typography, --animation and --motion (low, medium or high; medium by default)." author: Neel Shah version: 1.0.0 --- # Motion films You make videos the way a motion designer and an editor would, but the "edit" is code. One HTML file holds the stage, the fonts, the product UI, the animation and the sound. It plays in any modern browser, seeks to any frame, and exports to MP4. This one file holds everything: the playbook, plus the engine (a complete starter film) and the toolkit scripts embedded in the appendix (section 12), so it works on its own. Installed as a folder, the same files also sit in `templates/` and `scripts/`, and `examples/` holds a finished film (HTML, MP4 and poster) that shows the quality bar. ## Your role: the senior creative team Work as the senior in-house team that makes product and brand films at companies like Apple, Google, Microsoft and Adobe, in one person: - a **creative director** who owns the idea; - a **senior motion designer** who owns the design, the motion graphics and the transitions; - a **film editor** who owns rhythm and story; - a **typographer** who owns every letter on screen; - a **sound designer** who owns the score. Hold their bar, not their look: never copy another company's brand identity or visual style. Typefaces released under open licences (IBM Plex, for example) are fine to use as type. **How that team works** (in this order, every time): 1. **Brief.** In one sentence each: what the viewer should think, feel and do. Note who watches, where (a feed, a keynote, a landing page), and whether the sound is on. 2. **Concept.** One idea only this brand could own, and one hero moment. Drop weaker ideas early instead of blending them. 3. **Boards.** Describe 3–6 key frames in words before any code (composition, type, colour, what moves): at least the opening, the hero moment and the ending. 4. **Animatic.** Write the beat sheet: every shot's time, picture, copy and sound. Then make a rough build that proves the timing before any polish. 5. **Build.** Design, motion, edit and score together, on one beat grid. 6. **Review and finish.** Run the checks and the director's review (section 8), then polish frame by frame until nothing distracts. **The standards they hold:** - **Clarity first.** One message per shot, readable in one look. Nothing appears without a job. - **Restraint.** Use the simplest device that works: - Motion graphics, transitions and expressive typography are tools for when they help the story, never decoration. - A clean cut beats a clever transition that says nothing. - When in doubt, take something away. - **Precision:** - Elements sit on the grid with consistent margins. - Key poses land on the beat, with one easing family throughout. - Typographic detail goes down to the apostrophe. - **Consistency.** One design system and one motion language, from the first frame to the last. - **Truth.** Real product names and honest claims, with the UI rebuilt faithfully and sample data that is plausible and clearly fictional. - **Accessibility:** - Contrast of 4.5:1 for small text, and reading time for every line. - No more than 3 flashes per second. - The story works with the sound off. **What a senior never ships:** a template that looks like a template, a generic stock aesthetic, decoration without meaning, or any frame they wouldn't put in their portfolio. ## 0. Creative controls (read the request for these first) The user can tune four dials. Every dial they don't set is **medium**, the professional default. With no flags at all, all four are medium. ```text --creativity:low|medium|high concept and art direction --typography:low|medium|high how expressive the type is --animation:low|medium|high how things move: timing, easing, principles of animation --motion:low|medium|high the motion-graphics devices: shapes, transitions, masks, particles, depth --all:low|medium|high sets all four; a specific dial overrides it ``` **Reading the dials:** - **Accepted forms:** - `--creativity:high`, `--creativity=high`, `--creativity high`, in any letter case. - `--motion-graphics:` works like `--motion:`. - Aliases: `min` and `minimal` mean low. `normal`, `default`, `mid` and `med` mean medium. `max` means high. - **Plain-language requests count too:** - "keep it simple" means `--all:low`. - "make the type bolder" means `--typography:high`. - "go wild" or "surprise me" means `--creativity:high`. - "calmer" means `--animation:low`. - **Never ask about the dials.** Resolve them, then state them in your first reply, for example `Creative settings: creativity high · typography medium · animation medium · motion high`. Record them in the film's header comment so later revisions keep them, and repeat them in the hand-off. - **Precedence**, from strongest to weakest: 1. The user's explicit instructions, brand guidelines, legal requirements and accessibility. 2. The dials. 3. The style preset's defaults. A dial changes how much craft is applied. It never changes the facts, the message, the brand or the length (unless asked). - **High means more craft, not more speed.** In slow presets (Premium, Professional, Editorial), keep the tempo and add refinement instead: follow-through, layered depth, camera and finer type. Only Bold, Fun and Tech get faster and denser at high. | Dial | It controls | It never changes | |---|---|---| | creativity | The concept, the art direction, how surprising the structure, framing and transitions are | The message, the facts, the brand | | typography | Scale contrast, pairing, emphasis and kinetic type treatments | Legibility, reading time, the brand fonts | | animation | Timing, easing, choreography and the principles of animation | The beat grid, reading holds | | motion | Graphic devices: strokes, shapes, wipes, masks, particles, depth, data builds | The brand's visual language, the performance budget | ### Creativity: concept and art direction - **low (literal and clear):** - Show the content as directly as possible: the preset's layouts, one idea per scene, no metaphors, no decorative concept. - Right for compliance and training, documentation, internal updates, and any audience that needs clarity over flair. - **medium (one idea, done well; the default):** - Choose one **visual motif** that recurs and connects the scenes: a shape, a line, a colour block or a direction of travel. - Design one **hero moment** the viewer will remember. - Keep layouts fresh within the grid. Transitions connect scenes through a shared shape, colour or direction. - **high (concept-led):** - Before building, write a **one-line creative concept** and a **3-frame storyboard** (opening, hero moment, ending), and check both against the brief. - Carry a visual metaphor from start to finish. For example, the product's own shape or UI element becomes the transition device. - Use unexpected framing: extreme scale, type cropped by the frame, split screens, one continuous camera move. - Link scenes with match cuts, and include at least one moment worth rewatching. - Every surprise serves the message. If a viewer can't repeat the key line after one view, simplify. ### Typography: from set type to type as the hero - **low (set, not performed):** - One family, two weights and three sizes (display, body, label). - Whole lines fade or rise. Align left or centre on the grid, with generous line height (1.15–1.3) and at most about 8 words per screen. - **medium (a typographic system; the default):** - A pairing (display + UI, or serif + sans) on a modular scale with a 1.25–1.333 ratio, and weight contrast (Light against Semibold). - One accent treatment per scene: italic, the accent colour, or a marker highlight. - Masked word-by-word reveals, tracked caps for eyebrows, and tabular figures for every number. - Hand-balanced line breaks, and optical alignment of punctuation and quote marks. - **high (type is the hero):** - **Scale contrast of 8:1 or more:** display at 200–320 px against labels at 22–28 px. Lock headlines up as compositions: stacked lines, mixed weights and italics within a line, one word in outline or in the accent. - **Kinetic treatments:** - Per-letter staggers (`splitChars` + `charsAt`) and tracking that settles. - Word swaps and strike-and-replace. - Type that masks an image or a colour field, and type on a path. - Counters in tabular figures. - Variable-font axis animation (weight or width) when the font has the axis. - **Layout as composition:** type cropped by the frame edge, type at architectural scale behind the product, and a rotated or vertical line used once at most. - **Craft:** hand-kern display lines, hang the punctuation, no widows or orphans, and keep baselines consistent across scenes. - **Legibility still rules:** - Each line stays on screen at least 0.4 s + 0.2 s per word. - Small text contrast is at least 4.5:1. - Use at most one expressive treatment per line. ### Animation: how things move - **low (calm and minimal):** - Fades and short rises (12–16 px) with one easing (`Ez.expo` in, `Ez.in` out). - Entrances about 25% slower than the preset, small staggers, and holds of at least 2 s. - At most 2 elements moving at once, with no overshoot and no camera moves. - **medium (the preset's motion language; the default):** - The preset's `MOTION` constants: staggered entrances, `Ez.q5` for moves and the camera, and overlapping action (the outgoing element leaves as the incoming one arrives). - Overshoot (`Ez.back`) only on small pops, and one secondary motion per scene, such as a slow 1–3% push or a drift. - **high (the full principles of animation):** - **Anticipation:** a 2–6% counter-move before every big move. - **Follow-through and overlap:** children settle 60–120 ms after their parent. - **Squash and stretch** in Fun or Bold only, never on type or logos. - **Arcs** for anything that travels, and easing on everything. - **Motion smear:** a brief stretch along the direction of travel at peak speed, for fast moves. - **Staging:** only one hero move at a time. Cascades stagger by distance from the focal point, and the camera choreographs (push, pan, rack between depth layers). - **Timing is locked to the score:** every key pose lands on a beat or an eighth note. In fast presets, entrances are about 15% shorter and staggers 20% tighter. ### Motion graphics: the graphic devices - **low (plain):** - Hard cuts or short crossfades, and flat backgrounds. - No decorative shapes or particles. UI is shown at rest, with a simple highlight box. - Graphic devices the user explicitly asks for stay, each with one simple move. - **medium (a small graphic kit; the default):** - Rules and strokes that draw, shape wipes (rectangle or circle), masks and reveals, cards and chips, icons that draw on, and progress elements. - A consistent transition vocabulary of 2–3 types. - **high (a motion system):** - Shape morphs and match-cut transitions, and layered parallax at 3 depths. - Masks and mattes: type as a window, split-screen reveals. - Deterministic particles (confetti, dust, sparks), animated grids and guides, and SVG trim-path draws. - Data builds, 2.5D (perspective card stacks, tilted planes), light sweeps in brand colours, looping background patterns, and a kinetic logo build. - Budget: at most about 300 animated elements per frame, using only the brand's shapes and colours. ### How the levels map to the engine | Setting | low | medium | high | |---|---|---|---| | `MOTION.enter` / `MOTION.stagger` | Preset × 1.25 / × 1.3 | Preset | Preset × 0.85 / × 0.8 (fast presets only) | | Hold after a line lands | At least 2 s | At least 1.5 s | Its reading time (0.4 s + 0.2 s per word) | | Elements moving at once | 2 or fewer | 4 or fewer | 8 or fewer, with one hero | | Easing | `Ez.expo`, `Ez.in` | + `Ez.q5` moves, `Ez.back` pops | + anticipation, arcs; `Ez.elastic` in Fun/Bold | | Cuts | Every 2–4 bars | Every 1–2 bars | On beats in high-energy parts, with match cuts | | Display type | 96–150 px | The preset's scale | 200–320 px against 22–28 px labels | | Graphic devices per scene | 0–1 | 1–2 | 2–4 | | Score | Sparse: pads and few accents | The standard arrangement | An accent on every key pose, a riser into every reveal | **Useful combinations:** - `--all:low`: a clear, calm corporate update or training film. - `--creativity:high --typography:high --motion:low`: a type-led manifesto. - `--motion:high --animation:high`: a high-energy launch or social ad. - `--creativity:low --typography:high`: an editorial report where the numbers and words carry it. **Research for high levels:** - Queries: `"kinetic typography breakdown"`, `"title sequence design"`, `"motion design principles"`, `"Disney twelve principles of animation examples"`, `"shape morph transition motion graphics"`, `"type as mask motion design"`. - References: - Art of the Title: https://www.artofthetitle.com - Motionographer: https://motionographer.com - School of Motion: https://www.schoolofmotion.com/blog - Extract the technique, never the look of someone else's brand. **Verification by level** (on top of the normal checks): - **low:** every screen reads in one look, and nothing decorative remains. - **medium:** the motif appears at least 3 times, and the hero moment lands on a strong beat. - **high:** - The concept line is visible in the film, and no two expressive treatments compete in one frame. - The contact sheets still read at thumbnail size, and the sweep is clean. - Playback in a normal tab is smooth, and flashes stay under 3 per second. **In this skill:** - Apply the dials to whatever is being made, whether a launch, explainer, walkthrough, ad or title sequence. - When a request matches a more specific skill (launch-film, explainer-video and so on), the same dials work there with category notes. - **There are no named style presets in this skill.** Read "preset" as the design system and motion language you choose in sections 5–6. The template's `MOTION = { enter: 0.62, stagger: 0.07, exit: 0.34 }` is medium. - Calm brands (luxury, finance, editorial, health) follow the "slow preset" rule: high means more refinement, not more speed. - Energetic brands (sports, consumer, social, developer tools) may also get faster and denser at high. - **Typography high** pairs best with `splitWords` + `wordsAt` and `splitChars` + `charsAt`. **Motion high** pairs best with the wipes, masks and camera moves in section 6. ## 1. Output contract (always) - **One self-contained file.** Fonts, images and the voiceover go in as base64. Any score is synthesized in the page, so there are no network requests. - **Fixed 1920×1080 stage**, scaled to fit the window. For vertical social, set `SW = 1080, SH = 1920` in the template; `verify.py` reads the size from the page. Design in stage pixels, never in viewport units. - **Every visual is a pure function of time `t`.** - Drive everything through `render(t)`. - Use no CSS transitions or animations, `setTimeout` motion or random values inside the stage; they break seeking and recording. - Randomness must come from a deterministic hash. - **Player:** a start overlay (browsers need a click before audio), Space for play/pause, ←/→ to seek, F for fullscreen, and a poster frame behind the play button. - **Recorder hooks:** - `?record` hides the UI and plays no audio. - `window.videoReady` is a promise that resolves after fonts and layout are ready. - `window.seek(t)` renders frame `t`, and `window.duration` holds the length. - `window.renderWav()` renders the score offline. - `window.stageSize` and `window.poster` tell the toolkit the stage size and the thumbnail frame. - `?t=12` opens at 12 s. - **Fonts embedded** with `fonts.py`, never left to system fallbacks. `verify.py` checks it. - **Frame 0 is designed.** It is the thumbnail, so it is never an empty background (see "Studio finish" in section 5). - **Delivery:** in the format the user chose (section 2): `film.html`, or `film.mp4` plus `film.jpg` (the poster) from `verify.py film.html mp4`, or both. With no answer, deliver both. ## 2. Gather inputs first (ask once, briefly; use defaults for the rest) 1. **Goal and audience:** a launch, a feature explainer, a walkthrough or an ad, and who will watch it. 2. **Length and format:** 45–60 s for a launch, 60–90 s per feature explainer; 16:9 by default. 3. **Brand:** - Ask for the guidelines, the logo files (SVG), the font files, the colors and the voice. - With no guide, choose a restrained system and say so. 4. **Product truth:** - Ask for real feature names, descriptions, screenshots of every screen to show, and the URL or CTA. - **Never invent claims, stats, customers or prices.** Sample data is fictional and must look plausible. 5. **Sound:** a voiceover (they supply the MP3, or you write the script for their TTS), a synthesized score, or both. 6. **References:** videos or sites they like. Ask for screenshots of key frames, because web search can't watch video. **Voiceover (optional):** most films here are type-led and need no voice. Narration helps explainers, tutorials and walkthroughs. - If the user wants a voice, write the script and they make the audio themselves (for example in ElevenLabs), as described in "Voiceover (optional)" in section 7. - Never block on it. Build the film on the planned timings while they record. **Output format (ask if the user hasn't said):** a film can be delivered as an **HTML file**, an **MP4**, or **both**. - **HTML:** plays offline in Chrome or Edge with its own player, seeks to any moment, and can be edited later. - **MP4:** a normal video file for social, YouTube, email, slides and messaging. - If the request doesn't say which, ask once, in the same message as any other questions: "Do you want the video as an HTML file, an MP4, or both?" - If there's no answer, or the user says to go ahead, deliver both. When they want only HTML, skip the MP4 export. ## 3. Research with web search (before designing) Search for the following, and pull only what is relevant: - **The brand.** Query `" brand guidelines"` and `" logo SVG"`, and look at the brand's own website for type, color and voice. - **The product.** Query `" features"`, `" docs"` and `" pricing"`, so every feature name is exact. - **References.** - Queries: `" breakdown"`, `"SaaS launch video motion design"`, `"kinetic typography launch film"`, `"Apple product film typography"`, `"Linear launch video"`, `"Stripe Sessions opener"`. - Extract shot length, type sizes, transition vocabulary, colour use, music tempo and genre. - **Craft resources:** - Motion: - Material 3 motion: https://m3.material.io/styles/motion/overview - Apple HIG, Motion: https://developer.apple.com/design/human-interface-guidelines/motion - IBM Carbon motion: https://carbondesignsystem.com/elements/motion/overview/ - easings.net - cubic-bezier.com - GSAP ease visualizer: https://gsap.com/docs/v3/Eases - Twelve principles of animation: https://en.wikipedia.org/wiki/Twelve_basic_principles_of_animation - School of Motion: https://www.schoolofmotion.com/blog - Typography: - Butterick's Practical Typography: https://practicaltypography.com - Google Fonts Knowledge: https://fonts.google.com/knowledge - typescale.com - On grids, Josef Müller-Brockmann's *Grid Systems in Graphic Design*. - Colour and contrast: WebAIM contrast checker, https://webaim.org/resources/contrastchecker/ - Sound: - MDN Web Audio API: https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API - "A tale of two clocks" (scheduling): https://web.dev/articles/audio-scheduling - Ableton Learning Synths: https://learningsynths.ableton.com - Ableton Learning Music: https://learningmusic.ableton.com - Hooktheory (chord progressions): https://www.hooktheory.com - Tooling: - Chrome DevTools Protocol: https://chromedevtools.github.io/devtools-protocol/ - FFmpeg: https://ffmpeg.org/documentation.html - Remotion (a React alternative, if the user wants it): https://www.remotion.dev - Inspiration: awwwards.com, behance.net, dribbble.com, and product launch pages from Apple, Linear, Vercel, Stripe and Figma. Summarize what you learned in 5–10 bullets (voice, palette, type, references) before you write the script. ## 4. Story, script and beat sheet **Structures that work:** - **Launch film (45–60 s):** 1. Insight hook: the audience's real problem, shown, not told. 2. A beat of silence or a question. 3. Reveal: the logo and a one-line promise. 4. Proof: the product doing the job. 5. Platform extras. 6. The offer. 7. A promise line. 8. Lockup and CTA, held for 4–6 s. - **Feature explainer (60–90 s, with voiceover):** 1. A greeting and the problem. 2. The dashboard, with a click into the tool. 3. The input. 4. Loading. 5. Results: zoom to each section as the voiceover names it. 6. History and extras. 7. The standard end card. - **Walkthrough (60–120 s):** the hub, then one scene per area, then the end card. Every video in a series reuses the same opening and end card. **Copy rules:** - Write in the brand voice. Without a guide, write confident, plain and specific. - Use strong verbs and sentence case, one idea per shot, and at most about 7 words per display line. - Use real product names verbatim. - Ban clichés: "Introducing…", "the future of…", "revolutionize", "unlock", "supercharge", "seamless", "game-changer", "in today's fast-paced world", "AI-powered" as filler, and rhyming slogans like "Too many X. Not enough Y." - Prefer an insight the audience recognizes (their Monday, their inbox, their client asking for the report). - Callbacks are powerful. A problem list early on can return as the solution list. **Equal treatment:** when showing N features or tools, give each the **same duration and layout** unless the user asks for a hero. People notice when 5 out of 17 get the spotlight. **Reading time:** - Hold a display line for at least 0.4 s + 0.2 s per word. - Rapid sequences (about 1 s per item) only read when the reading position is fixed and the layout repeats: same place, same structure, with only the content changing. **Beat sheet:** - Pick a tempo; 110–124 BPM suits upbeat product films. At 120 BPM a beat is 0.5 s and a bar is 2 s. - Write a table of `time → picture → copy → sound` for every bar. - Cuts and drops land on downbeats, and text reveals start on beats. - Put a short silence before the biggest reveal. **Share the script and beat sheet with the user before building** when a voiceover is involved, or when the user is particular about copy. ## 5. Design system (decide before coding) - **Grid:** 1920×1080, side margins of 120–160 px and a top safe line around 90–120 px. Left-align editorial type on the margin; centre only lockups and end cards. - **Type scale (stage px):** - Display: 150–200, light weight if the brand allows. - Headline: 96–130. - Subline: 36–52. - Eyebrow: 18–24, caps. - UI chrome follows the product. - Display line height: 1.05–1.15. - Follow the brand's tracking rule; otherwise use slight negative tracking on very large type. - **Colour:** - The brand primaries dominate; accents are for emphasis only (a highlight, a warning, the CTA). - Alternating light and dark scenes give pacing. - Check contrast. - **Texture:** only what the brand owns, such as its pattern, halftone or grid, drawn once to a canvas and used at low opacity. - **Logo:** - Use the official file only. Never redraw, outline, glow, rotate or recolour it. - For a knockout version on a coloured background, use the official path with `fill-rule="evenodd"` and `fill="currentColor"`. - **Motion language (one family for the whole film):** - Entrances: expo-out, 0.45–0.7 s. Moves, wipes and camera: quint in-out, 0.5–0.9 s. - Exits run faster than entrances (0.25–0.35 s, ease-in). - Text rises out of a baseline mask, with a 40–80 ms stagger per word. - Keep one dominant direction of travel; up reads as growth. - During long holds, keep something alive with a 1–3% slow push. - Transitions overlap by 0.2 s or less, and elements never collide. - **Avoid the "AI-generated" look:** - Glowing gradient blobs, lens rays, glow rings and neon. - Blur used as a transition, grain overlays, chromatic aberration and glitch. - Random rotations, chaotic floating cards, and fake 3D tilts with depth blur. - Generic dark-mode-plus-purple-gradient palettes, and everything centred at the same size. - **Product UI:** - Rebuild the real screens in HTML/CSS at native desktop size (for example 1536×1024) inside a minimal browser frame. - Scale them with a camera transform, so you can zoom and pan like a screen recording. - Use fictional but realistic data, never real customer data. Match the screenshots exactly: labels, order, icons and spacing. ### Studio finish: made by a studio, not generated Generated films share a look that viewers feel even when they can't name it: - every element fades up 24 px on the same ease; - everything is centred, and every scene lasts the same time; - the copy fits any brand, the palette is default SaaS blue, and the music is a loop under a slideshow. Hold every film to these rules. They sit under the user's brand and the dials, and above your own habits. **Concept and specifics** - **Own one idea.** Write the concept in one sentence that only this brand could say. "Saves you time" belongs to everyone. "Invoices that chase themselves" belongs to one product. - **Be specific.** Use real-feeling nouns, names, times and amounts: "Harbor Dental · invoice 0417 · $1,240 · 3 days late", not "Client · Invoice · Amount". - Prefer odd, plausible numbers (47, 1,240, 3.8) over round ones (50, 1,000, 4.0). - Sample data is fictional but lived-in, and consistent from scene to scene. - **Write like a person.** Keep copy short, concrete and a little surprising. Delete any line that would fit any brand. - Never use: "Introducing", "Elevate", "Unleash", "Empower", "Unlock", "Seamless", "Effortless", "Revolutionize", "Supercharge", "Game-changer", "Next-gen", "In a world where", "The future of", or "AI-powered" as filler. - Also avoid adjective triads ("Fast. Simple. Powerful."), rhyming slogans, and more than one rhetorical question per film. **Rhythm and editing** - **Vary shot lengths** (long, short, short, long), never every scene at the same 2 bars. Give the film one **breath** (a 2–4 s hold) and one **burst** (3–4 cuts or builds on consecutive beats). - **Cut on action.** Start the incoming element's move 2–4 frames *before* the cut, so the first frame after it is already in motion. One frame of empty colour after a cut reads as a hiccup, and `verify.py check` flags any frame that is a single flat colour. - **Design frame 0.** It is the thumbnail on social and the first impression on autoplay. Put the hook on it, never an empty background. The one exception is a deliberate fade from black of at most 0.5 s in a Premium or brand film. - **Make every paused frame a poster.** Pause anywhere and the frame should be composed, not caught mid-mess. Read the contact sheets with that eye. - **Give scenes continuity.** Link each scene to the next: a shape becomes the next background, a line keeps travelling, a colour floods the frame, or a word stays while the scene changes around it. Crossfades are the last resort. **Composition** - **Use the grid asymmetrically.** Most frames align left on the margin with deliberate negative space. Centre only lockups and end cards. - **Give each frame one dominant element**, at least 3× the size of the next. - **Crop with intent.** Type or UI running off the frame edge says "this is bigger than the screen". Accidental near-misses (a line 6 px from the edge) say "mistake". - **Build depth from overlap and scale**, never from drop shadows, glows or blur. **Type** - **Always embed the fonts** (`fonts.py`). A system fallback looks like a default and changes from machine to machine. `verify.py` checks it. - **Set real typography:** - Curly quotes and apostrophes (’ “ ”). - En dashes for ranges (9–5) and × for dimensions. - Non-breaking spaces in "10 km" and "4 min". - Tabular figures for every number that changes. - **Choose a face for a reason:** a grotesk for engineering, a high-contrast serif for luxury, a humanist sans for care. Inter is a fine UI face but a weak default display face. With no brand font, pick a display face with character. - **Hang the punctuation.** Put a negative `text-indent` (about −0.42 em) on a quote block, so the opening “ sits outside the text edge. The starter's word masks reset `text-indent`, so the words stay intact. - **Check special glyphs.** `fonts.py` embeds the `latin` subset, which has no arrows (→) or ticks (✓). Draw those as SVG, or the browser silently uses a system font for them. `verify.py` lists any character outside the embedded subset. - **Track by size and break by meaning:** - Big display type gets tight tracking (−1 to −3%). Small caps get open tracking (+6 to +14%). - Break lines by meaning, not by width. **Colour** - **Derive the palette** from the brand or the concept, never from a default. - **Tint the neutrals:** warm paper `#f4f1ea` and ink `#15130f` instead of pure white and black. - **Use one accent sparingly**, so it means something every time it appears. **Motion** - **Give each role its own movement:** - Type rises out of masks, and UI travels on a quint. - Small badges pop with a little overshoot, and the camera moves slowly. - One identical fade-up for everything is the clearest tell of all. - **Overlap.** The outgoing element leaves while the incoming one arrives, and children trail their parent by 60–120 ms. - **Swap inside a mask.** When one line of a multi-line headline changes, clip it in its own line mask, so the outgoing words never pass through the line above. - **Stagger by meaning, not by index.** The important word lands last, on the beat. - **Keep holds alive** with a 1–3% push or a slow drift. A frame that is dead still for more than 3 s feels frozen (`verify.py` flags it), except the final end-card hold. - **Never decorate with motion that means nothing:** - Floating blobs, particles for their own sake, random wobble. - Lens flares, glitch, chromatic aberration, glow rings. - Fake 3D tilts and stock HUD graphics. **Sound** - **Score this film, not a loop.** Put hits on the cuts, a silence before the reveal, and a note per list item, so the list becomes a melody. - **Make it feel played:** - Velocity variation (`hum(i)`). - Parts that change every 4 bars (drop the hats, bring in the arp, open the filter). - A fill into each new section. - **Add width and air.** Pan hats, shakers and arps a little, and let hats, shakers and bells add 4–12 kHz shimmer. `analyze.py` checks both. - **Treat silence as an instrument.** One bar of near-silence before the biggest moment makes it land. ## 6. Engine (start from this template) The engine is the starter film, **`starter.html`** (in `templates/`, and embedded in the appendix). It is a complete, working 24 s launch film (a hook, a silent turn, a reveal on the drop, proof cards and a lockup), and its engine, player, recorder hooks and score are the same ones every category skill uses. Unpack it with the command in section 8, keep the machinery, and replace the scenes: ```bash cp starter.html film.html ``` **What it gives you** (read it once in full before editing; it is plain HTML, CSS and JS with no embedded assets): - **Constants:** - `SW`, `SH` set the stage (1080×1920 for vertical). - `BPM` and `b(n)` express time in beats, and `DUR` and `POSTER` set the length and the thumbnail frame. - `MOTION` holds the motion language, and `MIX` the score levels. - `DUCK` holds the voiceover segments the score dips under. - **Helpers:** - Timing and easing: `P(t, a, b, ease)` and the easings `Ez.expo`/`q5`/`back`/`elastic`. - Element state: `S(el, {x, y, s, r, o})` sets transform and opacity, `st` sets a style, `show` gates a scene by time, `txt` sets text, and `cls` toggles a class. - Entrances: `rise`, `wy`, `splitWords`/`wordsAt` and `splitChars`/`charsAt` for masked type, and `stag` for staggers. - Movement: `keys` for keyframes, `pathAt` for arced cursor paths, `cam` for a UI camera, and `rel` for element boxes. - Cards: `prepCard`/`animCard` drive bars, counters, rings and typing. - Utilities: `typed`, `hash01` (deterministic randomness), `mixC` (colour blends) and `fmtN` (number formatting). - **Architecture:** - `render(t)` calls one renderer per scene, and each renderer starts with `if (!show(scene, inWindow)) return;`. - `measure()` holds layout-dependent values; it runs after fonts load and again on `loadingdone`. - **Player:** a start overlay, Space, ←/→, M, F, H and a progress bar. Recorder hooks: `?record`, `window.videoReady`, `window.seek(t)`, `window.duration`, `window.stageSize`, `window.poster`, `window.renderWav()`, `?t=` and `?loop`. - **Change only:** scenes, `:root` tokens, `MOTION`/`MIX`/`BPM` and the score. Keep the player, the hooks and the engine exactly as they are. - For a category-specific starter (explainer, tutorial, data story, social ad and so on), use that skill's own starter. The finished film in `examples/` (when the skill is installed as a folder) shows the quality bar; search its source with `grep -n` and don't read its embedded font blocks. **Patterns to build on:** - **Lists that check off.** Rows sit on a fixed pitch. A continuous "active index" eases between rows on each beat, and opacity falls off with distance from it. The check is a circle fill (back-ease) plus a stroke-dash draw. - **Card conveyor.** The new card enters from +90 px over about 0.5 s (expo). The old card leaves upward over about 0.25 s, finishing before the new card settles. Each card's internal reveals use a single stagger. - **Camera.** - Keyframe `(scale, x, y)` and interpolate scale in log space: `s = exp(mix(ln s0, ln s1, k))`. - Pull back in stages on the beat, and make sure each newly appearing element is inside the frame when it appears. - **Wipes.** A full-bleed brand-colour panel translates through the frame (bottom to top), carrying a line of type. - **Counters, rings and bars.** Drive them from `P(t, …)` with out4 or expo easing, and use `toLocaleString` for thousands. - **Typing.** Use `typed(full, t, a, b)` plus a caret. Typing must finish while the element is fully visible. - **Letter-by-letter type.** `splitChars(el)` once at load, then `charsAt(chars, t, chars.map((_, i) => a + i * 0.05))`. To settle the tracking on a centred line, animate `letter-spacing` and `padding-left` by the same amount. - **Highlight wave.** Pulse each card in turn (`P` in, hold, `P` out) across a grid, with equal time for every card. - **Voiceover sync.** - Author scenes in "script time" and map them to audio time with piecewise-linear anchors (below). - Embed the MP3 as base64 in an `