Skip to main content

Timeline

A simple timeline class for managing animations with easing and precise progress control.

It provides methods for playing, reversing, pausing, and resetting the timeline.

Basic Demo

Initialization

caution
  • Timeline does not work with DOM elements or styles — it performs time and easing calculations only.
  • Animation is disabled by default. You must explicitly call .play() to start it.
  • Timeline does not run automatically on creation, even if callbacks are provided.
  • The timeline operates in the range 0 → 1, regardless of duration.
import { Timeline } from "vevet";

const tm = new Timeline(
{ duration: 350, easing: [0.25, 0.1, 0.25, 1] },
{
onUpdate: ({ eased }) => {
// your animation here
},
}
);

tm.play();

tm.pause();

Destroy the instance:

tm.destroy();