Raxol.Animation.DSL (Raxol v2.0.1)
View SourceDeclarative animation DSL for composing complex animation sequences.
This module provides a fluent, chainable API for creating sophisticated animations with timing controls, parallel execution, and conditional logic.
Examples
# Simple animation sequence
import Raxol.Animation.DSL
sequence()
|> fade_in(duration: 300)
|> slide_up(distance: 20, duration: 400)
|> scale_bounce(scale: 1.2, duration: 200)
|> execute(element_id)
# Parallel animations
parallel()
|> with_animation(fade_in(duration: 500))
|> with_animation(rotate(degrees: 360, duration: 1000))
|> execute(element_id)
# Conditional animations
sequence()
|> fade_in(duration: 300)
|> when_condition(fn state -> state.user_type == :premium end)
|> sparkle_effect(duration: 1000)
|> end_condition()
|> slide_out(direction: :right, duration: 400)
|> execute(element_id)
# Complex choreographed animation
choreography()
|> stage("entrance",
sequence()
|> fade_in(duration: 300)
|> slide_up(distance: 30, duration: 500, easing: :ease_out_back)
)
|> stage("highlight",
parallel()
|> with_animation(glow_effect(duration: 800))
|> with_animation(pulse_scale(scale: 1.05, duration: 600))
)
|> stage("exit",
sequence()
|> fade_out(duration: 400)
|> scale_down(scale: 0.8, duration: 300)
)
|> execute_choreography(element_id)
Summary
Functions
Creates a new choreography for complex multi-stage animations.
Adds a delay to the sequence.
Ends a conditional block.
Executes the animation sequence for the given element.
Executes a choreography with multiple stages.
Adds a fade in animation to the sequence.
Adds a fade out animation to the sequence.
Adds a glow effect animation.
Loops the sequence infinitely or for a specified number of iterations.
Creates a parallel animation group.
Adds a pulse scale animation.
Repeats the previous animation or sequence.
Adds a rotation animation.
Adds a scale animation to the sequence.
Adds a scale bounce animation.
Adds a scale down animation.
Creates a new animation sequence.
Adds a slide animation to the sequence.
Adds a slide in animation.
Adds a slide out animation.
Adds a sparkle effect animation.
Adds a stage to a choreography.
Adds a conditional block to the sequence.
Adds an animation to a parallel group.
Functions
Creates a new choreography for complex multi-stage animations.
Adds a delay to the sequence.
Ends a conditional block.
Executes the animation sequence for the given element.
Executes a choreography with multiple stages.
Adds a fade in animation to the sequence.
Adds a fade out animation to the sequence.
Adds a glow effect animation.
Loops the sequence infinitely or for a specified number of iterations.
Creates a parallel animation group.
Adds a pulse scale animation.
Repeats the previous animation or sequence.
Adds a rotation animation.
Adds a scale animation to the sequence.
Adds a scale bounce animation.
Adds a scale down animation.
Creates a new animation sequence.
Adds a slide animation to the sequence.
Adds a slide in animation.
Adds a slide out animation.
Adds a sparkle effect animation.
Adds a stage to a choreography.
Adds a conditional block to the sequence.
Adds an animation to a parallel group.