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_atand asks for frames only whileIdleFade::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§
- Idle
Fade - 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
selftootheratt(0..=1).
Functions§
- indicator_
elapsed - Time since
epochat the start of the stepnowfalls in: what an indicator draws, so its pose changes once per step. - indicator_
phase - Where in a loop
periodlong an indicator stands atnow,0..1, taken at the start of the stepnowfalls in. - indicator_
step - The step
nowfalls in, counted from the indicator’sepoch. - next_
indicator_ step - When the step after the one
nowfalls in begins.