Prompt Motion: motion graphics made from code
Every frame is a pure function of time, so the video renders identically every time, at any frame rate, with real motion blur. One HTML file, no After Effects.
Inspired by the public prompt library at prompt-motion.com (motion videos made with Claude, each published with its prompt). Credit goes to the original authors of any prompt you reuse.
Files in this skill
scripts/render.py— renders a seek(t) page to MP4, or a contact sheet of stills.scripts/pm_fetch.py— looks up real prompts on prompt-motion.com by tag or text (public pages; keep it low-volume).assets/seek_template.html— a working 9:16 demo (hook → dot → circle → bars → end card) with UZ/RU/EN texts switched by?lang=.
Setup
pip install playwright then python -m playwright install chromium; ffmpeg must be on PATH.
Workflow
- Format: 9:16 1080×1920 for Reels/TikTok/Shorts, 16:9 1920×1080 for YouTube/web, 1:1 1080×1080 for feeds.
- References (optional):
python3 scripts/pm_fetch.py --refreshonce, then--tag <tag>or--grep "<idea>"to read 1–3 real prompts. Tags include product-ui, kinetic-type, music, shapes, particles, charts, diagrams, characters, phone, photos, code. Long, structured prompts are better references than one-liners. - Write the brief in blocks:
<inputs>(what to ask for, with defaults) →<direction>(one concept in one line, a signature shot, max 3 colours + black/white, one typeface, a Banned: line) →<structure>(length, BPM, beat-by-beat shots, loop) →<voice>/<sound>→<build>→<gotchas>→<start>. - Plan check: a one-line concept + a beat table (time / on screen / what moves / why the beat exists). Cut any beat with no "why". Show it to the user if they are present.
- Build one HTML file from
assets/seek_template.html: every frame a pure function of t, seeded randomness, no CSS animations or timers. - Check before the full render:
python3 scripts/render.py page.html x --stills 0.5,2,4,6 --sheet sheet.jpg— look at it and fix small text, overlaps, empty frames, corner clutter, the same layout twice. Then a quick--scale 0.5preview. - Render:
python3 scripts/render.py page.html out.mp4 --sub 2 [--lang uz|ru|en] [--audio mix.wav]. Use 60 fps +--sub 3for hero pieces. - Fix one thing at a time, protect what works, prove each fix with frames. The model can't feel timing — the user watches at full speed and judges.
Direction rules (designed, not template-looking)
- One concept; every shot grows out of the previous one (dot → letter → graph → shape → end card). No crossfades between unrelated scenes.
- Banned by default: glows/neon, particle bursts, lens flares, camera shake, RGB split, crossfades, bouncy easing, generic gradients, grid floors, stock icons/UI kits, HUD text in corners, holds over 0.6 s, unseeded
Math.random. Say what to do instead. - Exits before entries. Nothing pops in (grow, slide from an edge, mask reveal; fades ≥ 0.3 s). Varied durations, never equal staggers. Springs with a tiny overshoot; blur follows speed.
- Focal element ≥ 60% of frame width; text ≥ 48 px on 9:16 (≥ 32 px on 1080p 16:9). Long words (Uzbek, Russian, German): auto-fit — the template does it.
- Beat grid (~120 BPM): cut on beats, land the key line on the drop, last frame = first frame for loops.
- Never invent prices, phone numbers, certificates or statistics. Don't use official brand logos the user didn't supply.
Sound and assets
- Voice:
elevenlabs-audio,voicelab-tts(Uzbek/Russian) orfish-audio-tts. - Music, sound effects, stock:
pixabay-media(for YouTube choose music without Content ID). Or synthesize a beat with Web AudioOfflineAudioContext→ WAV. - AI shots when no stock fits:
google-floworcomfyui-local. Avatars:heygen-avatar-video. - Other renderers when they fit better: Remotion (React), Three.js for 3D, Blender,
after-effects-scripting.