easeInOutCubic
It is slow at both ends and fast in the middle. A firm start or stop. The common default. easeInOutCubic reaches 50% of its travel at 50% of the time and 90% at 71%. Its peak speed is 3x the average.
Demo
easeInOutCubic
linear
easeInOutCubic
linear
Your system asks for reduced motion, so nothing plays. The charts above show the whole move.
Code
animation-timing-function: linear(0, 0.0001, 0.0005, 0.0017, 0.004, 0.0078, 0.0135, 0.0214, 0.032, 0.0456, 0.0625, 0.0832, 0.108, 0.1373, 0.1715, 0.2109, 0.256, 0.3071, 0.3645, 0.4287, 0.5, 0.5713, 0.6355, 0.6929, 0.744, 0.7891, 0.8285, 0.8627, 0.892, 0.9168, 0.9375, 0.9544, 0.968, 0.9786, 0.9865, 0.9922, 0.996, 0.9983, 0.9995, 0.9999, 1);animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1);Least-squares fit; the worst gap is 0.9 points of travel. Use linear() when the end of the curve matters.
el.animate({ translate: ['0 0', '240px 0'] }, { duration: 600, easing: 'linear(0, 0.0001, 0.0005, 0.0017, 0.004, 0.0078, 0.0135, 0.0214, 0.032, 0.0456, 0.0625, 0.0832, 0.108, 0.1373, 0.1715, 0.2109, 0.256, 0.3071, 0.3645, 0.4287, 0.5, 0.5713, 0.6355, 0.6929, 0.744, 0.7891, 0.8285, 0.8627, 0.892, 0.9168, 0.9375, 0.9544, 0.968, 0.9786, 0.9865, 0.9922, 0.996, 0.9983, 0.9995, 0.9999, 1)', fill: 'both' });import { easeInOutCubic } from '../../core/motion/curves.js';
import { curveToLinear } from '../../core/motion/springs.js';
const easing = curveToLinear(easeInOutCubic, { tolerance: 0.002 }); // the linear() string above
const x = easeInOutCubic(u); // per-frame code, u in 0..1Numbers
- 50% of travel
- 50%of the time
- 90% of travel
- 71%of the time
- After 10% of time
- 0.4%of the travel is done
- Peak speed
- 3xtimes the average
- Overshoot
- 0%stays inside the end
- Undershoot
- 0%never below the start
- linear() points
- 41at a 0.002 tolerance
- cubic-bezier
- closeworst gap 0.9 points
Use and avoid
Use for
- Moves between two resting positions: camera pushes, slides and loops.
- General UI and card moves between 200 and 500 ms.
Avoid for
- Quick UI feedback under 200 ms: the slow start delays the response.
- Long travel across the frame: the stop is abrupt for the distance.
Nearest vawe ease
settle, curve gap 0.014.