Skip to content

struct

Vars

pub struct Vars {
    /* private fields */
}

Tween settings and properties, GSAP's vars.

Methods

new

pub fn new() -> Vars

Animation settings with the defaults: half a second, easing out.

set

pub fn set(self, prop: &str, value: impl ToString) -> Vars

Animate prop (any CSS property, a transform like x, rotation, scale, or autoAlpha) to/from value.

duration

pub fn duration(self, seconds: f64) -> Vars

How long it lasts, in seconds.

delay

pub fn delay(self, seconds: f64) -> Vars

How long it waits before starting, in seconds.

ease

pub fn ease(self, ease: &str) -> Vars

A GSAP ease name ("power3.out", "elastic.out(1, 0.4)", …).

stagger

pub fn stagger(self, s: Stagger) -> Vars

How its targets' starts are spread out.

repeat

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

-1 repeats forever.

yoyo

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

Whether each repeat goes back the way it came.

repeat_delay

pub fn repeat_delay(self, seconds: f64) -> Vars

How long to wait between repeats, in seconds.

scroll

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

Tie it to the scroll.

paused

pub fn paused(self) -> Vars

Create it paused (start it with [Animation::play]).

Trait implementations