Module: j5e/easing

Description

Easing functions for animation segments.

References

Examples

// Easing by keyFrame. Move a servo from 0° to 180° with inOutQuad easing and then back to 0° with outBounce easing.
import Servo from "j5e/servo";
import Animation from "j5e/animation";
import { inOutQuad, outBunce } from "j5e/easing";

const servo = await new Servo(13);
const ani = await new Animation(servo);

const wave = {
  duration: 8000,
  cuePoints: [0, 0.5, 1],
  keyFrames: [ 0, { value: 180, easing: inOutQuad }, {value: 0, easing: outBounce }]
};

ani.enqueue(wave);