ICT30016-Assignment-3/node_modules/motion-utils/dist/es/easing/modifiers/mirror.mjs
dlawler489 a79a6afd34 intial
intial
2025-09-16 12:09:52 +10:00

5 lines
279 B
JavaScript

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