Copybara bot | be50d49 | 2023-11-30 00:16:42 +0100 | [diff] [blame] | 1 | 'use strict'; |
2 | |||||
3 | // See: http://robertpenner.com/easing/ | ||||
4 | |||||
5 | const 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 | |||||
12 | const 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 | |||||
18 | export { easeInOutQuad, inOutQuintic }; |