ant-design/components/_util/easings.ts

11 lines
327 B
TypeScript
Raw Normal View History

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;
// biome-ignore lint: it is a common easing function
2019-07-30 11:02:16 +08:00
t /= d / 2;
if (t < 1) {
return (cc / 2) * t * t * t + b;
}
// biome-ignore lint: it is a common easing function
2019-07-30 11:02:16 +08:00
return (cc / 2) * ((t -= 2) * t * t + 2) + b;
}