pub enum Easing {
Linear,
EaseInQuad,
EaseOutQuad,
EaseInOutQuad,
EaseInCubic,
EaseOutCubic,
EaseInOutCubic,
EaseInSine,
EaseOutSine,
EaseInOutSine,
EaseOutElastic,
EaseOutBounce,
}Expand description
A normalized easing curve: reshapes a linear progress fraction (0.0..=1.0) into an eased
one, the same named curves as CSS transitions and https://easings.net.
Linear is the default. The In variants start slow, Out variants end
slow, and InOut variants do both (matching the usual naming convention: “In” describes the
start of the motion, not a direction).
EaseOutElastic and EaseOutBounce are the
only curves in their families: both are used for a settle/overshoot effect at the end of a
motion, and the in/in-out variants (the same shape mirrored to the start) are uncommon enough
in practice that this curated set omits them.
Variants§
Linear
Constant speed: t unchanged.
EaseInQuad
Starts slow, accelerates, quadratically.
EaseOutQuad
Starts fast, decelerates, quadratically.
EaseInOutQuad
Slow -> fast -> slow, quadratically.
EaseInCubic
Starts slow, accelerates, cubically – a stronger version of EaseInQuad.
EaseOutCubic
Starts fast, decelerates, cubically – a stronger version of EaseOutQuad.
EaseInOutCubic
Slow -> fast -> slow, cubically – a stronger version of EaseInOutQuad.
EaseInSine
A gentle sine-shaped start.
EaseOutSine
A gentle sine-shaped end.
EaseInOutSine
A gentle sine-shaped start and end.
EaseOutElastic
Springs past the target and oscillates back before settling, going outside 0.0..=1.0
for part of the curve.
EaseOutBounce
Bounces (like a dropped ball) to a stop at the target.