When you update a page fragment you can animate the change.
When we morph between an old and a new element, we call it a transition.
For instance, you may add an [up-transition]
attribute to your
links or forms to smoothly fade out the old element while fading in the new element:
<a href="/users"
up-target=".list"
up-transition="cross-fade">
Show users
</a>
In contrast, when we animate a new element without simultaneously removing an old element, we call it an animation.
An example for an animation is opening a new overlay. We can animate the appearance
of the dialog by adding an [up-animation]
attribute to the opening link:
<a href="/users"
up-target=".list"
up-layer="new"
up-animation="move-from-top">
Show users
</a>
Unpoly ships with a number of predefined transitions and predefined animations.
You can define custom animations using up.transition()
and
up.animation()
.
Swaps a fragment with an animated transition.
Defines a named animation.
Defines a named transition that morphs from one element to another.
Applies the given animation to the given element.
Defines a named animation.
Performs an animated transition between the source
and target
elements.
Sets default options for animations and transitions.
Completes animations and transitions.
This event is emitted on an animating element by up.motion.finish()
to
request the animation to instantly finish and skip to the last frame.
Returns whether Unpoly will perform animations.
Defines a named transition that morphs from one element to another.
Swaps a fragment with an animated transition.