easeInOutQuad
It is slow at both ends and fast in the middle. A mild, even curve. easeInOutQuad reaches 50% of its travel at 50% of the time and 90% at 78%. Its peak speed is 2x the average.
Demo
easeInOutQuad
linear
easeInOutQuad
linear
Your system asks for reduced motion, so nothing plays. The charts above show the whole move.
Code
animation-timing-function: linear(0, 0.0013, 0.005, 0.0113, 0.02, 0.0313, 0.045, 0.0612, 0.08, 0.1013, 0.125, 0.1513, 0.18, 0.2113, 0.245, 0.2813, 0.32, 0.3612, 0.405, 0.4513, 0.5, 0.5488, 0.595, 0.6387, 0.68, 0.7188, 0.755, 0.7888, 0.82, 0.8488, 0.875, 0.8988, 0.92, 0.9388, 0.955, 0.9688, 0.98, 0.9888, 0.995, 0.9988, 1);animation-timing-function: cubic-bezier(0.46, 0.02, 0.55, 1);Least-squares fit; the worst gap is 0.6 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.0013, 0.005, 0.0113, 0.02, 0.0313, 0.045, 0.0612, 0.08, 0.1013, 0.125, 0.1513, 0.18, 0.2113, 0.245, 0.2813, 0.32, 0.3612, 0.405, 0.4513, 0.5, 0.5488, 0.595, 0.6387, 0.68, 0.7188, 0.755, 0.7888, 0.82, 0.8488, 0.875, 0.8988, 0.92, 0.9388, 0.955, 0.9688, 0.98, 0.9888, 0.995, 0.9988, 1)', fill: 'both' });import { easeInOutQuad } from '../../core/motion/curves.js';
import { curveToLinear } from '../../core/motion/springs.js';
const easing = curveToLinear(easeInOutQuad, { tolerance: 0.002 }); // the linear() string above
const x = easeInOutQuad(u); // per-frame code, u in 0..1Numbers
- 50% of travel
- 50%of the time
- 90% of travel
- 78%of the time
- After 10% of time
- 2%of the travel is done
- Peak speed
- 2xtimes 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.6 points
Use and avoid
Use for
- Moves between two resting positions: camera pushes, slides and loops.
- Small UI changes and hover states.
Avoid for
- Quick UI feedback under 200 ms: the slow start delays the response.
- Hero moves: the stop is too soft.
Nearest vawe ease
glide, curve gap 0.0295.