module
spec
Declarative motion: the motion* template attributes, presets, and text splitting.
h1(motion: "fade-up") "Hello"
ul(motion: "pop", motion-stagger: 0.06) { li "a" li "b" li "c" }
div(motion-from: "opacity: 0; x: -60", motion-duration: 1.2, motion-ease: "expo.out",
motion-trigger: "scroll", motion-start: "top 80%")
img(motion: "float") // loops forever
section(motion-to: "rotation: 360", motion-trigger: "scroll", motion-scrub: true)Structs
- MotionSpec
A parsed declarative animation.
Enums
Functions
parse_props
pub fn parse_props(s: &str) -> Vec<(String, String)>"opacity: 0; y: 40px, rotation: -10" → [("opacity","0"), …]. Pairs are separated by ; (or by , outside parentheses).
split_text
pub fn split_text(text: &str, by: SplitBy) -> Vec<(String, bool)>Split text into animatable pieces; whitespace is kept as its own pieces (marked false) so spacing survives inline-block layout.