UNPKG

framer-motion

Version:

A simple and powerful JavaScript animation library

6 lines (4 loc) 279 B
// 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 };