Styled transitions with minimal boilerplate, typically for page transitions in single page apps.
See README or example for usage.
Uses elm-animations and Effects.tick for animation logic.
Extended type for the target model holding the transition.
Empty transition state, as initial value in the model.
Timeline of the transition
Build the timeline:
exitDuration => action => enterDuration
Default timeline for this action: exit of 100ms then enter of 200ms.
Update exit duration of timeline.
Update enter duration of timeline.
Transition action, to be wrapped in your own action type.
A shortcut to update that initialize the transition with the following parameters:
actionWrapper to wrap Transit's action into your app's Action type (saves you one Effects.map)timeline to setup transitiontarget is the model storing the Transition, that will be updated with new transition state
Returns a tuple that you can directly return from your update.Where all the logic happens. Run transition steps, and triggers timeline's action when needed.
actionWrapper to wrap Transit's action into app's Action type (saves one Effects.map),action is the Transit action to process,target is the model storing the Transition, that will be updated with new transition state.Extract current animation value (a float between 0 and 1).
Extract current animation status.
Transition status.
Opaque type for transition state storage.