Skip to main content

Module animation

Module animation 

Expand description

What is left of the toolkit’s early animation primitives besides the motion library (crate::motion, where every motion lives): IdleFade for chrome that shows on activity and fades once quiet, the looping indicators’ cadence, and Lerp for blending values that are not motion.

Modules§

idle_fade
Chrome that shows on activity and fades out on its own once things are quiet: an overlay scroll bar after scrolling, a block’s drag handle after the pointer moves. It is fully visible for a hold after the last activity, then fades; something that holds it (the pointer on it, a drag) keeps it visible. Its owner sleeps through the hold on IdleFade::fade_deadline_at and asks for frames only while IdleFade::fading_at, so resting chrome costs no frames.
indicator
The cadence of looping indicators: a spinner, a tab’s busy arc, a sweeping bar.
lerp
Interpolation between two values of a kind, for blending colours and amounts that are not motion (a chart’s colour scale, a theme blend). A value that moves over time does so through crate::motion.

Structs§

IdleFade
The idle fade of a piece of chrome: when it was last woken, how long it then stays fully visible, and how long it takes to fade out.

Constants§

CHROME_FADE
How long fading chrome takes to go, once its hold is over: every piece of chrome that fades does so alike.
INDICATOR_STEP
One step of a looping indicator: 30 a second.

Traits§

Lerp
Interpolation from self to other at t (0..=1).

Functions§

indicator_elapsed
Time since epoch at the start of the step now falls in: what an indicator draws, so its pose changes once per step.
indicator_phase
Where in a loop period long an indicator stands at now, 0..1, taken at the start of the step now falls in.
indicator_step
The step now falls in, counted from the indicator’s epoch.
next_indicator_step
When the step after the one now falls in begins.