easings.js 235 B

123456789
  1. export function easeInOutCubic(t, b, c, d) {
  2. const cc = c - b;
  3. t /= d / 2;
  4. if (t < 1) {
  5. return cc / 2 * t * t * t + b;
  6. }
  7. // biome-ignore lint: it is a common easing function
  8. return cc / 2 * ((t -= 2) * t * t + 2) + b;
  9. }