mirror.mjs 279 B

12345
  1. // Accepts an easing function and returns a new one that outputs mirrored values for
  2. // the second half of the animation. Turns easeIn into easeInOut.
  3. const mirrorEasing = (easing) => (p) => p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2;
  4. export { mirrorEasing };