ant-design/components/_util/easings.ts

11 lines
321 B
TypeScript
Raw Normal View History

2019-08-16 18:15:28 +08:00
// eslint-disable-next-line import/prefer-default-export
2019-07-31 19:23:11 +08:00
export function easeInOutCubic(t: number, b: number, c: number, d: number) {
2019-07-30 11:02:16 +08:00
const cc = c - b;
t /= d / 2;
if (t < 1) {
return (cc / 2) * t * t * t + b;
}
// eslint-disable-next-line no-return-assign
2019-07-30 11:02:16 +08:00
return (cc / 2) * ((t -= 2) * t * t + 2) + b;
}