animation
Animation timing without a framework: Easing curves (the CSS keywords, cubic-bezier(),
steps() and linear(), read from a CSS string or built directly), physical Springs with
their settling time, and to_css_linear to turn any curve into a CSS linear().
The same model as the TypeScript package’s animation category, for code that computes
animation values itself (a renderer, a native player, a tool that exports animations).
Install
Section titled “Install”Cargo feature animation (enabled by default). To compile only this module:
or in Cargo.toml:
Import path: helpers4::animation.
| Item | What it does |
|---|---|
Easing | A timing curve: how the progress of an animation follows the progress of time, from 0.0 to 1.0. |
Spring | A damped spring going from 0.0 to 1.0: the curve behind “spring” transitions of design tools, with the time it takes to settle. |
StepPosition | Where the jumps of a steps() easing happen, as in CSS. |
to_css_linear | Samples an easing function into a CSS linear() easing, so that any curve (a Spring, a custom bounce) can be played by CSS transitions and the Web Animations API, which do not take code. |
Error types
Section titled “Error types”Documented on the page of the helper that returns them.
| Type | Returned by |
|---|---|
ParseEasingError | Easing |
