Skip to content

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

Install it, add a class, then draw on a canvas when you want characters. Each step links to its page.

  1. Install

    npm install toon-principles
    Install: npm, CDN or download
  2. Add a class

    <button class="toon-press">
      Save
    </button>
    Your first animation
  3. Draw on a canvas

    const stage =
      Toon.createStage('#c');
    stage.loop(() => draw(stage));
    Your first Canvas animation

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

Twelve ordinary elements, one class each: see them running, then copy the code.