Math animation with Claude Code
A math animation, a dark board where equations morph and graphs draw themselves, is something Claude Code can make. Claude writes each shot in code with canvas drawing, and HyperFrames renders it to MP4. ReelStyles sells this look as the Chalk Board kit, so the equation motion and the colour meanings are already set.
Here are the rules of the look, the steps, a vertical prompt and the closest styles. If you're starting fresh, read my animated videos guide first.
What makes a good math animation
The board is a dark slate in ink-green, from #0a1014 to #0f1a21. A faint chalk grid drifts behind with the camera, dust motes float, and a soft teal lamp wanders over the surface under a dark vignette. Everything is drawn in canvas 2D from code, so no images are needed.
Maths is built in front of the viewer. Equations are set in a book serif and morph: symbols that survive from one line to the next glide to their new places, the rest fade, so you can see what changed. Graphs draw with a glowing pen. Squares and dots pop in layer by layer, and a ring or brace points at the one thing that matters.
Colour is meaning. Teal #4fd8c4 is what is given, structure or the curve. Amber #ffc857 is the result to keep. Coral #ff6f61 is the unknown, the problem or a warning. Violet #a995ff is a second family, rarely. Chalk #ece7da is plain text, and dim #8a98a1 is for axes. Use four colours at most, and let a colour keep its meaning for the whole film. If x² is teal in the first line, it is teal in the last.
A shot has one focal point and at most three study elements. A typical film runs hook equation, then a picture, then the identity morphing in. Shots last three to four seconds, with a caption of five to nine words at the bottom.
Type is a serif for numbers, with italics for variables, and a monospace for tick labels only. Hero equations run 120 to 150 px and nothing is under 28 px. The camera never stops: a slow move with a sway, and cuts are short crossfades.
Steps in Claude Code
1. Plan first
Plan a 20-second chalk board film that shows why the sum of the first n odd numbers is n squared. Give me four shots, the equation line in each, which colour means what, and one caption per shot. Show me the plan before you write any code.
2. Build one scene and check stills
npx hyperframes lint . npx hyperframes snapshot . --at 1,3,6,9 -o snapshots
Look at the stills. Does the same symbol keep the same colour? Is the board lit, not black? Is the caption at least 28 px? Fix shot one before the rest.
3. Render
npx hyperframes render . -o out.mp4 --quality looks --workers 2
Use --quality draft to check the morphs. To speak over the maths, see how to add a voiceover.
A prompt to paste
Make a 25-second 9:16 vertical math animation: why a triangle's angles add up to 180 degrees. Dark slate board with a faint drifting chalk grid and a soft teal lamp. Open with the question "a + b + c = ?" writing on. Then three angles of a drawn triangle pop in as teal, amber and coral dots, slide to sit on one straight line, and the equation morphs to "a + b + c = 180". Ring the result. Caption of five to nine words per shot, slow camera. Plan first, then show stills of shot one.
For a lighter topic, use a single graph that draws itself and one tangent line.
Which styles come closest
The kit has the equation engine, the draw-on moves and a layout check. The nearest ready styles:
| Style | Why it fits |
|---|---|
| Chalk Board | The direct version: morphing equations on a slate |
| Chalkboard | A hand-written board look for lessons |
| Whiteboard explainer | Marker drawings built on a white board |
| Blueprint | Line diagrams drawn on a dark ground |
They all come in one ReelStyles purchase, and you can try 10 styles free first.
What this method cannot do
It is built for maths and other symbolic ideas. It will not carry bullet lists or paragraphs, and the kit has no characters. The shipped example is wide, so for Shorts ask for 9:16 and keep equations short enough to fit the frame.
Questions
Do I need to know LaTeX?
You don't. You describe the equations in plain words, and Claude writes them in the kit's format. Check the stills to be sure each symbol is right.
Can the maths be wrong?
Yes, so check it. Claude can slip on a sign or a fraction, so read each equation in the stills before you render.
Does it work for Shorts?
Yes, with a 9:16 request and shorter equations. See YouTube Shorts in 9:16 with Claude Code.
Sources
HyperFrames on GitHub (Apache-2.0). See the Chalk Board style page for the example film.