Skip to main content

Module easing_presets

Module easing_presets 

Source
Expand description

Easings made from a name, a function or a spring. Each is an Easing the evaluator already knows, so no curve family adds arithmetic to it.

Structs§

Spring
A mass on a damped spring, released at rest position 0 toward 1.
SpringEasing
A spring’s motion as an easing, and how long it lasts.

Constants§

EASING_FAMILIES
The ten families of named, each with an in, an out and an in-out form.
MAX_SPRING_SECONDS
How long a spring may take to settle.
PRESET_POINTS
The most points a table made for a named easing has; the longest is ease-in-out-bounce.
PRESET_TOLERANCE
How close a table made for a named easing stays to its function.

Functions§

easing_equation
Penner’s easing equation for a family name of named, such as ease-out-bounce, at progress (clamped to 0..=1): what the name’s curve or table follows. None for any other name.
easing_names
Every name named knows, in a fixed order: the CSS names, the two step names, then each family’s ease-in-, ease-out- and ease-in-out- form.
named
The easing a name stands for: linear, the CSS names (ease, ease-in, ease-out, ease-in-out), step-start, step-end, and ease-{in,out,in-out}-{sine,quad,cubic,quart,quint,expo,circ,back,elastic,bounce}.
sampled
function, which runs from 0 at 0 to 1 at 1, as a points easing: straight lines within tolerance of it at the quarter points of every piece, through at most max_points points (and at most MAX_EASING_POINTS).
spring
A spring’s motion from 0 to 1 over the time it takes to stay within 0.001 of 1, as a table within tolerance of it of at most max_points points (sampled).