securityos/node_modules/framer-motion/dist/es/easing/modifiers/mirror.mjs

6 lines
279 B
JavaScript
Raw Normal View History

2024-09-06 15:32:35 +00:00
// 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 };