scritto_lustre
Types
pub type Transition {
Duration(duration: Int)
Easing(easing: String)
DurationAndEasing(duration: Int, easing: String)
}
Constructors
-
Duration(duration: Int) -
Easing(easing: String)Takes a CSS easing function:
linear(...),cubic-bezier(...)or a keyword such asease-in-out. -
DurationAndEasing(duration: Int, easing: String)
Values
pub fn animate(enabled: Bool) -> attribute.Attribute(message)
Whether value changes animate.
Defaults to True
pub fn bounce(enabled: Bool) -> attribute.Attribute(message)
Swaps the default spring for a bouncier one.
Defaults to False
pub fn edge_fade(f: EdgeFade) -> attribute.Attribute(message)
Fades the edges of the text while it animates: Always, Never, AutoFade.
Defaults to AutoFade
pub fn flow(
elements: List(element.Element(m)),
) -> element.Element(m)
pub fn register() -> Result(Nil, lustre.Error)
pub fn respect_motion_preference(
enabled: Bool,
) -> attribute.Attribute(message)
Whether to follow the user’s prefers-reduced-motion setting.
Defaults to True
pub fn text(
content content: String,
with attributes: List(attribute.Attribute(message)),
) -> element.Element(message)
pub fn transition(t: Transition) -> attribute.Attribute(message)
Animation transition.
Any field left empty keeps its default.
Defaults to 550ms with scritto’s default spring easing
pub fn trend(t: Trend) -> attribute.Attribute(message)
Direction the digits roll in: Up, Down, AutoTrend.
Defaults to AutoTrend