toon
The 12 basic principles of animation as CSS classes and a small Canvas toolkit: 520 lines, no dependencies, no build step.
npm install toon-principles
or use a CDN, or download two files: see Install
Start in three steps
Section titled “Start in three steps”Install it, add a class, then draw on a canvas when you want characters. Each step links to its page.
Install
Install: npm, CDN or downloadnpm install toon-principlesAdd a class
Your first animation<button class="toon-press"> Save </button>Draw on a canvas
Your first Canvas animationconst stage = Toon.createStage('#c'); stage.loop(() => draw(stage));
A few of the principles
Section titled “A few of the principles”Each card acts out its principle once as it scrolls into view. Point at a
card, or tab to it, to watch it again. Each card holds the key pose of its principle. Open one to play its full
demo. See all 12
Squash & stretchMake things feel soft or heavy: they flatten on impact and stretch when fast.
AnticipationA small wind-up before the main move: button presses, jumps, launches.
StagingPoint attention at one thing: highlight it and quiet everything else.
Straight ahead vs pose to poseSimulate motion frame by frame, or plan it with keyframes.
Follow-through & overlapping actionParts keep moving after the body stops: staggered lists, trailing tails.
Slow in & slow outEasing: speed up and slow down instead of moving at constant speed.
With HTML
Section titled “With HTML”Twelve ordinary elements, one class each: see them running, then copy the code.