blob: fea208f19fb954556c404190f5bb262c58558da0 [file] [log] [blame]
Copybara botbe50d492023-11-30 00:16:42 +01001'use strict';
2
3// See: http://robertpenner.com/easing/
4
5const easeInOutQuad = (t, b, c, d) => {
6 t /= d / 2;
7 if(t < 1) return c / 2 * t * t + b;
8 t--;
9 return -c / 2 * (t * (t - 2) - 1) + b;
10};
11
12const inOutQuintic = (t, b, c, d) => {
13 const ts = (t/=d)*t;
14 const tc = ts*t;
15 return b+c*(6*tc*ts + -15*ts*ts + 10*tc);
16};
17
18export { easeInOutQuad, inOutQuintic };