pub struct AnimSpec {
pub keyframes: Vec<Keyframe>,
pub enter: Option<Enter>,
pub exit: Option<Enter>,
}Expand description
Per-node animation declarations. Boxed on NodeSpec: enter and
exit are 60 bytes each and almost every node has neither.
Fields§
§keyframes: Vec<Keyframe>CSS-style stops for the animatable slots (see crate::keyframes):
with a transition, the slots a stop names cycle through the stops
over the transition’s duration, in its repeat direction, offset by
its delay_ms — forever, and without the view redrawing. Slots no
stop names still tween toward what the view declares. Empty = none.
enter: Option<Enter>Where this node’s slots start the first frame it is seen (see
crate::enter): with a transition, the slots it names ease in
from there instead of snapping — dx/dy slide the node in from
that far away, bg fades it in. A node that vanishes and returns
enters again. None = first sight snaps.
exit: Option<Enter>Where this node’s slots end the frame after the view stops
declaring it (see crate::depart). An exit is an Enter read
the other way: with a transition, the departing subtree is copied
out of the last frame that had it and replayed — frozen where
layout left it, on top, inert — while the slots this names ease
from where they were toward what it declares. Needs a stable key
across frames, and a transition with a duration; without both, a
removed node vanishes at once as it always did.