UNPKG

@ifed/hook

Version:
18 lines 511 B
var easing = { easeInOutCubic: function easeInOutCubic(x) { if (x >= 1) return 1; return x < 0.5 ? 4 * x * x * x : 1 - Math.pow(-2 * x + 2, 3) / 2; }, easeOutCirc: function easeOutCirc(x) { if (x >= 1) return 1; return Math.sqrt(1 - Math.pow(x - 1, 2)); }, easeOutQuint: function easeOutQuint(x) { if (x >= 1) return 1; return 1 - Math.pow(1 - x, 5); }, easeOutExpo: function easeOutExpo(x) { return x === 1 ? 1 : 1 - Math.pow(2, -10 * x); } }; export default easing;