Function silkenweb::animation::infinite_animation

source ·
pub fn infinite_animation() -> impl Signal<Item = f64> + 'static
Expand description

Provide an infinite time signal for animations.

The signal will tick each frame until it is dropped.

§Example

A rotating square:

svg().width(200.0).height(200.0).child(
    rect()
        .x(Px(25.0))
        .y(Px(25.0))
        .width(Px(50.0))
        .height(Px(50.0))
        .transform(Sig(
            infinite_animation().map(|time| format!("rotate({} 50 50)", time / 10.0))
        )),
);

See module-level documentation for more details.