Creates an easing based on clock time. Time starts being counted when easing function is created.

timeEasing allows you to reset and check for completion. Alternatively, use time which is a simple function that just returns a value.

import { Easings } from "https://unpkg.com/ixfx/dist/modulation.js";
const t = Easings.timeEasing(`quintIn`, 5*1000); // Will take 5 seconds to complete
...
t.compute(); // Get current value of easing
t.reset(); // Reset to 0
t.isDone; // _True_ if finished

Thisi function is just a wrapper around Modulator.timedModulator.

  • 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)

      Name of easing, or an easing function

    • duration: Interval

      Duration

    Returns ModulatorTimed

    Easing