Jaime Ortega

vaiven

A Canvas engine where every animation is one JSON config.

Year
2026
Made for
Zero-dependency JavaScript
State
shipped

From the Spanish vaivén, the swing of things. A perpetual to and fro.

Every figure in vaiven is one JSON object. Shape, count, spacing, easing, phase, drift. No animation code, no timeline, no dependencies. Change a number and the motion changes with it, which means you can hunt for a figure by feel rather than by writing another loop.

The engine is a few kilobytes of Canvas 2D. You give it the parameters of a system and it runs forever, with no timeline to write.

How to use it

It is on npm. Install it, open the playground, and design the figure you want.

  1. Add it to a project and open the playground.

    Terminal
    npm i @jaimeortega/vaiven
    npx vaiven
  2. The playground writes vaiven.presets.json — saving a look there is publishing it. Then register the element and point it at a preset.

    Terminal
    import "@jaimeortega/vaiven/element";

Zero dependencies, Canvas 2D. Every figure is one JSON config, so the playground is the authoring tool and the file it writes is what your site serves.