# `Plushie.Animation.Sequence`
[🔗](https://github.com/plushie-ui/plushie-elixir/blob/v0.6.0/lib/plushie/animation/sequence.ex#L1)

Renderer-side sequential animation chain.

Chains multiple transitions and springs that execute one after
another on the same prop. Each step's `from:` defaults to the
previous step's final value if not specified.

## Usage

    # List form
    opacity: sequence([
      transition(200, to: 1.0, from: 0.0),
      loop(800, to: 0.7, from: 1.0, cycles: 3),
      transition(300, to: 0.0)
    ])

    # Do-block form
    opacity: sequence do
      transition(200, to: 1.0, from: 0.0)
      loop(800, to: 0.7, from: 1.0, cycles: 3)
      transition(300, to: 0.0)
    end

## Completion

Only the sequence-level `on_complete:` fires. Individual step
completion tags are ignored.

    opacity: sequence([
      transition(200, to: 1.0, from: 0.0),
      transition(300, to: 0.0)
    ], on_complete: :fade_cycle_done)

# `step`

```elixir
@type step() :: Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t()
```

# `t`

```elixir
@type t() :: %Plushie.Animation.Sequence{on_complete: atom() | nil, steps: [step()]}
```

# `new`

```elixir
@spec new(steps :: [step()], opts :: keyword()) :: t()
```

Creates a new sequence from a list of transition/spring steps.

    Sequence.new([
      Transition.new(200, to: 1.0, from: 0.0),
      Transition.new(300, to: 0.0)
    ])

    Sequence.new([...], on_complete: :done)

# `on_complete`

```elixir
@spec on_complete(sequence :: t(), tag :: atom()) :: t()
```

Sets the completion event tag.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
