Skip to content

struct

Stagger

pub struct Stagger {
    pub each: Option<f64>,
    pub amount: Option<f64>,
    pub from: From,
    pub grid: Option<(usize, usize)>,
    pub ease: Ease,
}

GSAP's stagger: a delay between targets (each) or spread over a total (amount), from a point in the list or a grid, optionally eased.

Fields

each

pub each: Option<f64>

Seconds between one target's start and the next.

amount

pub amount: Option<f64>

Seconds to spread all the starts over.

from

pub from: From

Which target starts first.

grid

pub grid: Option<(usize, usize)>

(rows, cols) to measure distance on a grid.

ease

pub ease: Ease

How the starts are spread.

Methods

each

pub fn each(seconds: f64) -> Stagger

Start each target seconds after the one before.

amount

pub fn amount(seconds: f64) -> Stagger

Spread the targets' starts over seconds in all.

from

pub fn from(self, from: From) -> Stagger

Which target starts first: the first, the last, the centre, the edges or one by index.

grid

pub fn grid(self, rows: usize, cols: usize) -> Stagger

Measure the order on a grid of rows by cols, by distance from where it starts.

ease

pub fn ease(self, ease: Ease) -> Stagger

How the starts are spread across the stagger's time.

offsets

pub fn offsets(&self, count: usize) -> Vec<f64>

Start offsets (seconds) for count targets.

Trait implementations