Skip to content

struct

TimelineBuilder

pub struct TimelineBuilder {
    /* private fields */
}

A sequence of tweens.

Methods

to

pub fn to(self, targets: impl Into<Targets>, vars: Vars, position: &str) -> Self

Add a to tween at a GSAP position ("", "<", "-=0.3", "label"…).

from

pub fn from(self, targets: impl Into<Targets>, vars: Vars, position: &str) -> Self

Add an animation of targets from vars to where they are, at position.

from_to

pub fn from_to(self, targets: impl Into<Targets>, from: Vars, to: Vars, position: &str) -> Self

Add an animation of targets from from to to, at position.

set

pub fn set(self, targets: impl Into<Targets>, vars: Vars, position: &str) -> Self

Set targets to vars at once, at position.

label

pub fn label(self, name: &str, position: &str) -> Self

Name a time on the timeline (position as for an animation), for others to start from.

repeat

pub fn repeat(self, n: i32) -> Self

-1 repeats forever.

yoyo

pub fn yoyo(self, on: bool) -> Self

Whether each repeat goes back the way it came.

repeat_delay

pub fn repeat_delay(self, s: f64) -> Self

How long to wait between repeats, in seconds.

scroll

pub fn scroll(self, s: Scroll) -> Self

Tie it to the scroll.

paused

pub fn paused(self) -> Self

Start paused.

play

pub fn play(self) -> Animation

Register and start it (unless paused or scroll-triggered).