Produce easing values over time. When the easing is complete, the final value continues to return. Timer starts when return function is first invoked.

If you need to check if an easing is done or reset it, consider timeEasing.

import { Easings } from "https://unpkg.com/ixfx/dist/modulation.js";
// Quad-in easing over one second
const e = Easings.time(`quadIn`, 1000);

// Keep calling e() to get the current value
e();

This function is just a wrapper around Modulate.time

  • Parameters

    • nameOrFunction:
          | "bounceOut"
          | "quintIn"
          | "quintOut"
          | "arch"
          | "smoothstep"
          | "smootherstep"
          | "sineIn"
          | "sineOut"
          | "quadIn"
          | "quadOut"
          | "sineInOut"
          | "quadInOut"
          | "cubicIn"
          | "cubicOut"
          | "quartIn"
          | "quartOut"
          | "expoIn"
          | "expoOut"
          | "quintInOut"
          | "expoInOut"
          | "circIn"
          | "circOut"
          | "backIn"
          | "backOut"
          | "circInOut"
          | "backInOut"
          | "elasticIn"
          | "elasticOut"
          | "bounceIn"
          | "bell"
          | "elasticInOut"
          | "bounceInOut"
          | ((v: number) => number)

      Easing name or a function that produces 0..1 scale

    • duration: Interval

      Duration

    Returns (() => number)

      • (): number
      • Returns number