pub enum Curve {
Linear,
Decelerate,
Cubic {
x1: f32,
y1: f32,
x2: f32,
y2: f32,
},
CriticalSpring {
omega: f32,
},
Interval {
begin: f32,
end: f32,
inner: Box<Curve>,
},
Flipped(Box<Curve>),
}Expand description
The shared animation layer — physics, curves, driver — see
frus_core::animation. Re-exported here so applications can reach it through
frus_widgets without depending on frus-core directly.
An easing curve remapping [0,1] → [0,1].
f(0) = 0 and f(1) = 1 hold for every variant.
Variants§
Linear
The identity: f(t) = t.
Decelerate
A quadratic ease-out, f(t) = 1 − (1 − t)²: fast at once, then coasting to
a stop. It is the shape of something arriving — a glow flaring at an edge,
a value settling — where the interesting part is the start.
Cubic
A cubic Bézier defined by its two control points (x1,y1) and (x2,y2) —
the same parameterisation as CSS’s cubic-bezier().
Fields
CriticalSpring
The step response of a critically damped spring: starts at rest, settles
gently with no overshoot, renormalised so that f(1) = 1. omega sets how
lively it feels.
Interval
Applies inner only over the sub-window [begin, end]: 0 before, 1
after. This is what unlocks staggered animations.
Fields
Flipped(Box<Curve>)
Mirrored: f(t) = 1 − inner(1 − t), which turns an ease-in into an
ease-out.
Implementations§
Source§impl Curve
impl Curve
Sourcepub fn ease_in_out() -> Curve
pub fn ease_in_out() -> Curve
ease-in-out: slow at both ends.
Sourcepub fn critical_spring() -> Curve
pub fn critical_spring() -> Curve
The framework’s default spring curve (omega = 8): the feel of screen and
sheet transitions, in closed form.