phollyer/elm-motion/3.0.2

NOTE: the latest version is 3.0.4

Anim.Engine.Sub

A pure Elm subscription-based animation engine with full control, looping, and seamless mid-flight interruptions.

The pure-Elm counterpart to the WAAPI engine. Same feature set — looping, retargeting, per-axis freezing, pause/resume, mid-flight queries, springs — but driven by Elm's update loop instead of the browser compositor. No JavaScript companion, no ports, and interpolated values are available synchronously on every frame.

Reach for Sub when you want the WAAPI-like feature set but without the JS dependency.

📖 See Sub Engine Documentation and Engine Overview for details.

Types

type alias AnimState =
AnimState

Holds the Sub engine state.

Keep this in your model.

type alias Model =
    { animState : Sub.AnimState }
type alias AnimGroupName =
String

The name of the animation group you want to target.

Builders

type alias AnimBuilder eng =
AnimBuilder eng

Type alias for the base AnimBuilder type.

Engine Builder

type alias EngineBuilder =
EngineBuilder

Builder type for Sub-only builders.

Use this in type annotations when a builder function should only work with this engine.

📖 See Engine Capabilities for patterns and examples.

Initialize

📖 See Initialize for details.

init : List (EngineBuilder -> EngineBuilder) -> AnimState

Initialize the engine state with a list of property initializers.

import Anim.Engine.Sub as Sub
import Anim.Property.Opacity as Opacity


Sub.init
    [ Opacity.init "animGroupName" 0.5
    , ... -- other property initializers
    ]

Target

for : AnimGroupName -> EngineBuilder -> EngineBuilder

Select the animation group that subsequent property builders will target.

Sub.for "animGroupName"
    >> Opacity.begin
    >> Opacity.to 0.2
    >> Opacity.end

Trigger

📖 See Triggering Animations for details.

animate : AnimState -> (EngineBuilder -> EngineBuilder) -> AnimState

Trigger animations.

import Anim.Engine.Sub as Sub


{ model
    | animState =
        Sub.animate model.animState <|
            Sub.for "animGroupName"
                >> entryAnim
}
retarget : AnimState -> (EngineBuilder -> EngineBuilder) -> AnimState

Change the targeted properties instantly to their new values. If currently animating, stop.

This is a convenience function for immediately snapping properties or axes to new values without needing to construct a full animation builder with animate.

Just target the properties or axes you want to change, and any properties or axes you don't mention will be left untouched - if mid-flight, they will continue.

import Anim.Engine.Sub as Sub
import Anim.Property.Translate as Translate


{ model
    | animState =
        Sub.retarget model.animState <|
            Sub.for "animGroupName"
                >> Translate.begin
                >> Translate.toY 0
                >> Translate.end
}
AnimState
-> (AnimBuilder ForResizeSub -> AnimBuilder ForResizeSub)
-> AnimState

Update one or more animation groups after a layout change, or resize event.

Use this to set the new pixel bounds for your animation groups, and the animations will adjust proportionally to the new bounds.

Typical resize handler:

import Anim.Engine.Sub as Sub
import Anim.Property.Translate as Translate


GotTrack (Ok { element }) ->
    let
        bounds =
            { x = Just { min = 0, max = element.width - boxSize }
            , y = Nothing
            , z = Nothing
            }
    in
    ( { model
        | trackPx = element.element.width
        , animState =
            Sub.onResize model.animState <|
                Translate.bounds "boxAnim" bounds
                    >> Translate.bounds "cardAnim" bounds
      }
    , Cmd.none
    )

Note: all bounds are pixel values, regardless of the CSS unit used in your builder. It makes no sense to remap relative units, that's the browser's job, so this function will only target pixel values. Any non-pixel units are ignored. So if "boxAnim" is using Unit.Cqh for its axes, any new bounds will be ignored and the animation will continue as before.

📖 For resize strategies and examples, see Responsive Animations.

Events

= Run AnimGroupName
| Started AnimGroupName
| Ended AnimGroupName
| Cancelled AnimGroupName Float
| Restarted AnimGroupName
| Paused AnimGroupName Float
| Resumed AnimGroupName
| Iteration AnimGroupName Int
| Progress AnimGroupName Float

Subscription animation lifecycle events.

Progress Events

📖 See Event Reference for details.

withProgressEvents : Bool -> EngineBuilder -> EngineBuilder

Opt in to per-frame Progress events.

Off by default.

Progress events can create a lot of noise in your update loop, especially when debugging the Msg flow in your app. Therefore they are suppressed by default and you need to explicitly opt in to receive them.

This is a precedence function, so it can operate as a global setting for all groups in the builder chain, or you can set it on a per-group basis which overrides any global setting for that group.

Sub.withProgressEvents True -- global setting
    >> Sub.for "box"
    >> Sub.withProgressEvents False -- overrides global for this group
    >> ... -- other builders

Update

📖 See React for details.

type alias AnimMsg =
AnimMsg

Message type used with update.

import Anim.Engine.Sub as Sub


type Msg
    = SubMsg Sub.AnimMsg
    | ...
update : AnimMsg -> AnimState -> ( AnimState, List AnimEvent )

Handle animation lifecycle messages.

Returns the updated state and a list of AnimEvents for you to pattern match on.

import Anim.Engine.Sub as Sub


update : Msg -> Model -> ( Model, Cmd Msg )
update msg model =
    case msg of
        SubMsg animMsg ->
            let
                ( animState, events ) =
                    Sub.update animMsg model.animState
            in
            ( List.foldl handleEvent { model | animState = animState } events
            , Cmd.none
            )


handleEvent : Sub.AnimEvent -> (Model, Cmd Msg) -> ( Model, Cmd Msg )
handleEvent event (model, cmd) =
    case event of
        ...

Subscriptions

📖 See Subscriptions for details.

subscriptions : (AnimMsg -> msg) -> AnimState -> Sub msg

Subscribe to receive animation frame updates.

Your animations will not run without this subscription, and when no animations are running, this subscription is silent and has no performance impact.

import Anim.Engine.Sub as Sub


type Msg
    = SubMsg Sub.AnimMsg
    | ...


subscriptions : Model -> Sub Msg
subscriptions model =
    Sub.subscriptions SubMsg model.animState

View

To render an animation, add attributes to the element you want to animate.

📖 See Render for details.

attributes : AnimGroupName -> AnimState -> List (Attribute msg)

Apply the animation attributes to your element.

import Anim.Engine.Sub as Sub
import Html exposing (div, text)


div
    (Sub.attributes "animGroupName" animState)
    [ text "Animating element" ]

Playback

These functions are precedence functions, so they can operate as a global setting for all groups in the builder chain, or you can set them on a per-group basis which overrides any global setting for that group.

Sub.iterations 3 -- global setting
    >> Sub.for "box"
    >> Sub.iterations 5 -- overrides global for this group
    >> ... -- other builders
iterations : Int -> EngineBuilder -> EngineBuilder

Set how many times an animation should repeat.

loopForever : EngineBuilder -> EngineBuilder

Make an animation loop infinitely.

alternate : EngineBuilder -> EngineBuilder

Make an animation alternate direction on each iteration.

alternate only has a visible effect when the animation runs more than once, so calling it when iterations is unset or 1 automatically bumps iterations to 2. An explicit iterations count (or loopForever) set before or after alternate is preserved.

Timing

📖 See Timing for details.

delay : Int -> EngineBuilder -> EngineBuilder

Set the global delay for all animations in this builder.

introAnim : EngineBuilder -> EngineBuilder
introAnim =
    delay 500
        >> fadeInHeader
        >> slideInSidebar
        >> fadeInContent
duration : Int -> EngineBuilder -> EngineBuilder

Set the global duration for all animations in this builder.

introAnim : EngineBuilder -> EngineBuilder
introAnim =
    duration 500
        >> fadeInHeader
        >> slideInSidebar
        >> fadeInContent
speed : Float -> EngineBuilder -> EngineBuilder

Set the global speed for all animations in this builder.

introAnim : EngineBuilder -> EngineBuilder
introAnim =
    speed 300
        >> slideDownHeader
        >> slideInSidebar
        >> slideUpContent

Easing

📖 See Easing for details.

easing : Easing -> EngineBuilder -> EngineBuilder

Set the global easing function.

heroEntrance : EngineBuilder -> EngineBuilder
heroEntrance =
    easing EaseInOut
        >> fadeInHeroTitle
        >> slideInHeroArtwork
        >> revealPrimaryCta

Spring

spring : Spring -> EngineBuilder -> EngineBuilder

Set the global spring.

draggableCardSettle : EngineBuilder -> EngineBuilder
draggableCardSettle =
    spring Spring.wobbly
        >> settleCardPosition
        >> settleCardShadow

Unit

cssUnit : Unit -> EngineBuilder -> EngineBuilder

Set the default length unit for all length-bearing properties.

responsivePanelMotion : EngineBuilder -> EngineBuilder
responsivePanelMotion =
    cssUnit Unit.Vw
        >> slidePanelIn
        >> growPanelHeight
cssUnitX : Unit -> EngineBuilder -> EngineBuilder

Set the default length unit for the X axis.

responsiveDrawerMotion : EngineBuilder -> EngineBuilder
responsiveDrawerMotion =
    cssUnitX Unit.Vw
        >> slideDrawerX
        >> alignDrawerLabelX
cssUnitY : Unit -> EngineBuilder -> EngineBuilder

Set the default length unit for the Y axis.

responsiveSheetMotion : EngineBuilder -> EngineBuilder
responsiveSheetMotion =
    cssUnitY Unit.Vh
        >> slideSheetY
        >> alignSheetHeaderY
cssUnitZ : Unit -> EngineBuilder -> EngineBuilder

Set the default length unit for the Z axis.

layeredSceneMotion : EngineBuilder -> EngineBuilder
layeredSceneMotion =
    cssUnitZ Unit.Px
        >> pushSceneBackgroundBack
        >> bringFloatingCardForward
cssUnitWidth : Unit -> EngineBuilder -> EngineBuilder

Set the default length unit used for width values in Sub animations.

responsiveCardWidth : EngineBuilder -> EngineBuilder
responsiveCardWidth =
    cssUnitWidth Unit.Vw
        >> growCardWidth
        >> settleCardSpacing
cssUnitHeight : Unit -> EngineBuilder -> EngineBuilder

Set the default length unit used for height values in Sub animations.

responsivePanelHeight : EngineBuilder -> EngineBuilder
responsivePanelHeight =
    cssUnitHeight Unit.Vh
        >> expandPanelHeight
        >> alignPanelHeaderY

Animation Control

📖 See Controlling Animations for details.

stop : AnimGroupName -> AnimState -> AnimState

Stop a running animation by instantly jumping to its end state.

stop is silent — no Cancelled event is emitted. Cancelled is reserved for genuine external interruptions (e.g. browser-level cancellation outside the engine's control).

import Anim.Engine.Sub as Sub


Sub.stop "animGroup" model.animState
reset : AnimGroupName -> AnimState -> AnimState

Reset an animation by instantly jumping back to its start state.

import Anim.Engine.Sub as Sub


Sub.reset "animGroup" model.animState
restart : AnimGroupName -> AnimState -> AnimState

Restart an animation from the beginning.

import Anim.Engine.Sub as Sub


Sub.restart "animGroup" model.animState
pause : AnimGroupName -> AnimState -> AnimState

Pause a running animation.

import Anim.Engine.Sub as Sub


Sub.pause "animGroup" model.animState
resume : AnimGroupName -> AnimState -> AnimState

Resume a paused animation.

import Anim.Engine.Sub as Sub


Sub.resume "animGroup" model.animState

Discrete Properties

📖 See Discrete Properties for details.

discreteEntry : String -> String -> EngineBuilder -> EngineBuilder

Add a discrete CSS property for entry animations.

The value is applied as an inline style from the first frame and held throughout the animation. Use this when an element is appearing (e.g., going from display: none to display: block).

This function is a precedence function, so it can operate as a global setting for all groups in the builder chain, or you can set it on a per-group basis which overrides any global setting for that group.

import Anim.Engine.Sub as Sub
import Anim.Property.Opacity as Opacity


Sub.animate model.animState <|
    Sub.discreteEntry "display" "block"
        >> Sub.discreteEntry "visibility" "visible"
        >> Sub.for "box"
        >> Opacity.begin
        >> Opacity.to 1
        >> Opacity.end
discreteExit : String -> String -> String -> EngineBuilder -> EngineBuilder

Add a discrete CSS property for exit animations.

Exit animations need to hold their initial state until the very end of the animation, at which point they flip to the final state. Therefore you need to set both entry and exit values for the property.

This function is a precedence function, so it can operate as a global setting for all groups in the builder chain, or you can set it on a per-group basis which overrides any global setting for that group.

Use when an element is disappearing (e.g., going from display: block to display: none).

import Anim.Engine.Sub as Sub
import Anim.Property.Opacity as Opacity


Sub.animate model.animState <|
    Sub.discreteExit "display" "block" "none"
        >> Sub.for "box"
        >> Opacity.begin
        >> Opacity.to 0
        >> Opacity.end

Transform Order

📖 See Transform Ordering for details.

transformOrder : List TransformProperty -> EngineBuilder -> EngineBuilder

Set the transform order.

The transform order specifies how translate, rotate, skew and scale transforms are combined. Start the list with the transform to apply first.

This is a precedence function, so it can operate as a global setting for all groups in the builder chain, or you can set it on a per-group basis which overrides any global setting for that group.

Any missing transforms are automatically appended in the default order (Translate → Rotate → Skew → Scale).

import Anim.Engine.Sub as Sub
import Anim.Extra.TransformOrder exposing (TransformProperty(..))


Sub.transformOrder [ Scale, Rotate, Translate, Skew ] -- global setting
    >> Sub.for "box"
    >> Sub.transformOrder [ Rotate, Translate ] -- overrides global for this group
    >> ... -- other builders

Freeze

Freeze an axis to hold it in place while other axes or properties animate.

This is a precedence function, so it can operate as a global setting for all groups in the builder chain, or you can add a per-group freeze on top of the inherited global frozen axes for that group.

Sub.freezeX [ Sub.translate ] -- global setting
    >> Sub.for "box"
    >> Sub.freezeY [ Sub.rotate ] -- adds to the inherited global freeze for this group
    >> ... -- other builders

📖 See Interrupting Animations for details.

type alias FreezeProperty =
FreezeProperty

Identifies a property that can be frozen at its current animated position.

Use with freezeX, freezeY, etc. to hold specific axes at their current values during animation interruptions.

translate : FreezeProperty

Freeze the translate property.

rotate : FreezeProperty

Freeze the rotate property.

scale : FreezeProperty

Freeze the scale property.

skew : FreezeProperty

Freeze the scale property.

freezeX : List FreezeProperty -> EngineBuilder -> EngineBuilder

Freeze the X axis of the specified properties at their current animated values.

The named axis indicates which axis will remain frozen while you animate the others.

import Anim.Engine.Sub as Sub
import Anim.Property.Translate as Translate


Sub.animate model.animState <|
    Sub.freezeX [ Sub.translate ]
        >> Sub.for "box"
        >> Translate.begin
        >> Translate.toY 0
        >> Translate.end
freezeY : List FreezeProperty -> EngineBuilder -> EngineBuilder

Freeze the Y axis of the specified properties at their current animated values.

freezeZ : List FreezeProperty -> EngineBuilder -> EngineBuilder

Freeze the Z axis of the specified properties at their current animated values.

freezeXY : List FreezeProperty -> EngineBuilder -> EngineBuilder

Freeze the X and Y axes of the specified properties at their current animated values.

freezeXZ : List FreezeProperty -> EngineBuilder -> EngineBuilder

Freeze the X and Z axes of the specified properties at their current animated values.

freezeYZ : List FreezeProperty -> EngineBuilder -> EngineBuilder

Freeze the Y and Z axes of the specified properties at their current animated values.

freezeXYZ : List FreezeProperty -> EngineBuilder -> EngineBuilder

Freeze all axes of the specified properties at their current animated values.

Unfreeze

Unfreeze an axis to allow it to animate.

This is a precedence function, so it can operate as a global setting for all groups in the builder chain, or you can remove axes on a per-group basis from the inherited global frozen axes for that group.

Sub.freezeX [ Sub.translate ] -- global freeze setting
    >> Sub.for "box"
    >> Sub.unfreezeX [ Sub.translate ] -- removes the inherited global freeze for this group
    >> ... -- other builders
unfreezeX : List FreezeProperty -> EngineBuilder -> EngineBuilder

Unfreeze the X axis of the specified properties, allowing it to animate again.

unfreezeY : List FreezeProperty -> EngineBuilder -> EngineBuilder

Unfreeze the Y axis of the specified properties, allowing it to animate again.

unfreezeZ : List FreezeProperty -> EngineBuilder -> EngineBuilder

Unfreeze the Z axis of the specified properties, allowing it to animate again.

unfreezeXY : List FreezeProperty -> EngineBuilder -> EngineBuilder

Unfreeze the X and Y axes of the specified properties.

unfreezeXZ : List FreezeProperty -> EngineBuilder -> EngineBuilder

Unfreeze the X and Z axes of the specified properties.

unfreezeYZ : List FreezeProperty -> EngineBuilder -> EngineBuilder

Unfreeze the Y and Z axes of the specified properties.

unfreezeXYZ : List FreezeProperty -> EngineBuilder -> EngineBuilder

Unfreeze all axes of the specified properties.

State Queries

📖 See State Queries for details.

anyRunning : AnimState -> Maybe Bool

Check if any animations are currently running.

Returns Nothing if there are no animations.

isRunning : AnimGroupName -> AnimState -> Maybe Bool

Check if a specific animation group is currently running.

Returns Nothing if there are no animations for the group.

allComplete : AnimState -> Maybe Bool

Check if all animations are complete.

Returns Nothing if there are no animations.

isComplete : AnimGroupName -> AnimState -> Maybe Bool

Check if a specific animation group has completed.

Returns Nothing if there are no animations for the group.

getProgress : AnimGroupName -> AnimState -> Maybe Float

Get the current progress of an animation group as a value from 0.0 to 1.0.

Returns Nothing if there are no animations for the group.

import Anim.Engine.Sub as Sub


Sub.getProgress "myAnimation" model.animState
-- Just 0.5 (halfway through)

Timing Queries

getDuration : AnimGroupName -> AnimState -> Maybe Int

Get the total duration of an animation group, in milliseconds.

This is the wall-clock time for a single iteration - the longest delay + duration across the group's properties. Looping does not multiply it; each iteration reports the same span.

Returns Nothing if there are no animations for the group.

import Anim.Engine.Sub as Sub


Sub.getDuration "myAnimation" model.animState
-- Just 600
getElapsed : AnimGroupName -> AnimState -> Maybe Int

Get the elapsed time of an animation group within its current iteration, in milliseconds.

Counts from the moment the animation is triggered, so it includes any delay before motion begins. Resets to 0 at each iteration boundary and never exceeds getDuration.

Returns Nothing if there are no animations for the group.

import Anim.Engine.Sub as Sub


Sub.getElapsed "myAnimation" model.animState
-- Just 300 (halfway through a 600ms animation)
getRemaining : AnimGroupName -> AnimState -> Maybe Int

Get the remaining time of an animation group within its current iteration, in milliseconds.

Equal to getDuration - getElapsed, clamped at 0.

Returns Nothing if there are no animations for the group.

import Anim.Engine.Sub as Sub


Sub.getRemaining "myAnimation" model.animState
-- Just 300 (halfway through a 600ms animation)

Property Queries

📖 See Property Queries and Properties for details.

Custom Properties

getPropertyCurrent : AnimGroupName -> String -> AnimState -> Maybe Float

Get the current interpolated value of a custom property animation.

The second argument is the CSS property name.

Returns Nothing if the element has no animation for the given custom property.

getPropertyEnd : AnimGroupName -> String -> AnimState -> Maybe Float

Get the end value of a custom property animation.

The second argument is the CSS property name.

Returns Nothing if the element has no animation for the given custom property.

AnimGroupName
-> String
-> AnimState
-> Maybe
{ start : Maybe Float
, end : Float
}

Get the custom property range (start and end) of an element being animated.

The second argument is the CSS property name.

Returns Nothing if the element has no animation for the given custom property.

getPropertyStart : AnimGroupName -> String -> AnimState -> Maybe Float

Get the start value of a custom property animation.

The second argument is the CSS property name.

Returns Nothing if the element has no animation for the given custom property.

Returns Just 0 if no explicit start value was set, which is the default when no start value is set.

Custom Color Properties

getColorPropertyCurrent : AnimGroupName -> String -> AnimState -> Maybe Color

Get the current interpolated value of a custom color property animation.

The second argument is the CSS property name.

Returns Nothing if the element has no animation for the given custom color property.

getColorPropertyEnd : AnimGroupName -> String -> AnimState -> Maybe Color

Get the end value of a custom color property animation.

The second argument is the CSS property name.

Returns Nothing if the element has no animation for the given custom color property.

AnimGroupName
-> String
-> AnimState
-> Maybe
{ start : Maybe Color
, end : Color
}

Get the custom color property range (start and end) of an element being animated.

The second argument is the CSS property name.

Returns Nothing if the element has no animation for the given custom color property.

getColorPropertyStart : AnimGroupName -> String -> AnimState -> Maybe Color

Get the start value of a custom color property animation.

The second argument is the CSS property name.

Returns Nothing if the element has no animation for the given custom color property.

Returns transparent white (rgba 255 255 255 0) if no explicit start value was set, which is the default when no start value is set.

Opacity

AnimGroupName
-> AnimState
-> Maybe
{ start : Maybe Float
, end : Float
}

Get the opacity range (start and end) of an element being animated.

Returns Nothing if the element has no opacity animation.

getOpacityStart : AnimGroupName -> AnimState -> Maybe Float

Get the start opacity of an element being animated.

Returns Nothing if the element has no opacity animation.

Returns Just 1.0 (fully opaque) if no explicit start value was set, which is the default when no start value is set.

getOpacityEnd : AnimGroupName -> AnimState -> Maybe Float

Get the end opacity of an element being animated.

Returns Nothing if the element has no opacity animation.

getOpacityCurrent : AnimGroupName -> AnimState -> Maybe Float

Get the current opacity of an element based on its animation state.

Returns Nothing if the element has no opacity animation.

Returns the start opacity if the animation has not started yet.

Returns the current interpolated opacity if the animation is running.

Returns the end opacity if the animation has completed.

Perspective Origin

AnimGroupName
-> AnimState
-> Maybe
{ start :
Maybe
{ x : Float
, y : Float
}
, end :
{ x : Float
, y : Float
}
}

Get the perspective origin range (start and end) of an element being animated.

Returns Nothing if the element has no perspective origin animation.

AnimGroupName
-> AnimState
-> Maybe
{ x : Float
, y : Float
}

Get the start perspective origin of an element being animated.

Returns Nothing if the element has no perspective origin animation.

Returns Just { x = 50, y = 50 } if no explicit start value was set, which is the default when no start value is set.

AnimGroupName
-> AnimState
-> Maybe
{ x : Float
, y : Float
}

Get the end perspective origin of an element being animated.

Returns Nothing if the element has no perspective origin animation.

AnimGroupName
-> AnimState
-> Maybe
{ x : Float
, y : Float
}

Get the current perspective origin of an element based on its animation state.

Returns Nothing if the element has no perspective origin animation.

Returns the start perspective origin if the animation has not started yet.

Returns the current interpolated perspective origin if the animation is running.

Returns the end perspective origin if the animation has completed.

Rotate

AnimGroupName
-> AnimState
-> Maybe
{ start :
Maybe
{ x : Float
, y : Float
, z : Float
}
, end :
{ x : Float
, y : Float
, z : Float
}
}

Get the rotate range (start and end) of an element being animated.

Returns Nothing if the element has no rotate animation.

AnimGroupName
-> AnimState
-> Maybe
{ x : Float
, y : Float
, z : Float
}

Get the start rotation of an element being animated.

Returns Nothing if the element has no rotate animation.

Returns Just { x = 0, y = 0, z = 0 } if no explicit start value was set, which is the default when no start value is set.

AnimGroupName
-> AnimState
-> Maybe
{ x : Float
, y : Float
, z : Float
}

Get the end rotation of an element being animated.

Returns Nothing if the element has no rotate animation.

AnimGroupName
-> AnimState
-> Maybe
{ x : Float
, y : Float
, z : Float
}

Get the current rotation of an element based on its animation state.

Returns Nothing if the element has no rotate animation.

Returns the start rotation if the animation has not started yet.

Returns the current interpolated rotation if the animation is running.

Returns the end rotation if the animation has completed.

Scale

AnimGroupName
-> AnimState
-> Maybe
{ start :
Maybe
{ x : Float
, y : Float
, z : Float
}
, end :
{ x : Float
, y : Float
, z : Float
}
}

Get the scale range (start and end) of an element being animated.

Returns Nothing if the element has no scale animation.

AnimGroupName
-> AnimState
-> Maybe
{ x : Float
, y : Float
, z : Float
}

Get the start scale of an element being animated.

Returns Nothing if the element has no scale animation.

Returns Just { x = 1, y = 1, z = 1 } if no explicit start value was set, which is the default when no start value is set.

AnimGroupName
-> AnimState
-> Maybe
{ x : Float
, y : Float
, z : Float
}

Get the end scale of an element being animated.

Returns Nothing if the element has no scale animation.

AnimGroupName
-> AnimState
-> Maybe
{ x : Float
, y : Float
, z : Float
}

Get the current scale of an element based on its animation state.

Returns Nothing if the element has no scale animation.

Returns the start scale if the animation has not started yet.

Returns the current interpolated scale if the animation is running.

Returns the end scale if the animation has completed.

Size

AnimGroupName
-> AnimState
-> Maybe
{ start :
Maybe
{ width : Float
, height : Float
}
, end :
{ width : Float
, height : Float
}
}

Get the size range (start and end) of an element being animated.

Returns Nothing if the element has no size animation.

AnimGroupName
-> AnimState
-> Maybe
{ width : Float
, height : Float
}

Get the start size of an element being animated.

Returns Nothing if the element has no size animation.

Returns Just { width = 0, height = 0 } if no explicit start value was set, which is the default when no start value is set.

AnimGroupName
-> AnimState
-> Maybe
{ width : Float
, height : Float
}

Get the end size of an element being animated.

Returns Nothing if the element has no size animation.

AnimGroupName
-> AnimState
-> Maybe
{ width : Float
, height : Float
}

Get the current size of an element based on its animation state.

Returns Nothing if the element has no size animation.

Returns the start size if the animation has not started yet.

Returns the current interpolated size if the animation is running.

Returns the end size if the animation has completed.

Skew

AnimGroupName
-> AnimState
-> Maybe
{ start :
Maybe
{ x : Float
, y : Float
}
, end :
{ x : Float
, y : Float
}
}

Get the skew range (start and end) of an element being animated.

Returns Nothing if the element has no skew animation.

AnimGroupName
-> AnimState
-> Maybe
{ x : Float
, y : Float
}

Get the start skew of an element being animated.

Returns Nothing if the element has no skew animation.

AnimGroupName
-> AnimState
-> Maybe
{ x : Float
, y : Float
}

Get the end skew of an element being animated.

Returns Nothing if the element has no skew animation.

AnimGroupName
-> AnimState
-> Maybe
{ x : Float
, y : Float
}

Get the current skew of an element based on its animation state.

Returns Nothing if the element has no skew animation.

Returns the start skew if the animation has not started yet.

Returns the current interpolated skew if the animation is running.

Returns the end skew if the animation has completed.

Translate

AnimGroupName
-> AnimState
-> Maybe
{ start :
Maybe
{ x : Float
, y : Float
, z : Float
}
, end :
{ x : Float
, y : Float
, z : Float
}
}

Get the translate range (start and end) of an element being animated.

Returns Nothing if the element has no translate animation.

AnimGroupName
-> AnimState
-> Maybe
{ x : Float
, y : Float
, z : Float
}

Get the start translate of an element being animated.

Returns Nothing if the element has no translate animation.

Returns Just {x = 0, y = 0, z = 0} if no explicit start value was set, which is the default when no start value is set.

AnimGroupName
-> AnimState
-> Maybe
{ x : Float
, y : Float
, z : Float
}

Get the end translate of an element being animated.

Returns Nothing if the element has no translate animation.

AnimGroupName
-> AnimState
-> Maybe
{ x : Float
, y : Float
, z : Float
}

Get the current translate of an element based on its animation state.

Returns Nothing if the element has no translate animation.

Returns the start translate if the animation has not started yet.

Returns the current interpolated translate if the animation is running.

Returns the end translate if the animation has completed.