meo-canvas - v8.0.0
    Preparing search index...

    Function track

    • Declares an animation once and samples it per page.

      Tracks work in seconds because that is what duration and fps already speak, and because a delay expressed as a fraction of the whole sequence changes meaning whenever the sequence length changes. index folds in the stagger, so a row of bars is one track rather than per-item arithmetic at the call site.

      Type Parameters

      Parameters

      Returns Track<T>

      const grow = track({ from: 0, to: 1, duration: 0.75, delay: 0.1, stagger: 0.18, ease: 'outCubic' })

      await Root({
      width: 640,
      height: 320,
      duration: grow.totalDuration(3),
      fps: 24,
      children: page => Row({ children: BARS.map((bar, i) => Box({ width: 300 * grow.at(page, i) })) }),
      })