0.1.0
Initial release.
Core
<.motion>component with a declarative animation lifecycle:animate,exit,hover,tap,drag,in_view, andscroll.- Animations run on the Web Animations API (WAAPI) for GPU-accelerated performance; the Elixir side stays purely declarative.
- Animations compose via the individual transform properties
(
translate/scale/rotate) instead of thetransformshorthand, so a hoverscale, a dragtranslate, and a FLIPtranslatedon't clobber each other.
Presets
- Entrance/exit:
fade,blur,slide-up,slide-down,slide-left,slide-right,zoom-in,zoom-out,drop,flip-x,flip-y. - Gesture:
scale-up,scale-down,press,lift,tilt-left,tilt-right. - Keyframe/attention:
shake,bounce,pulse,wiggle,spin,ping,rubber-band,float,highlight. - Custom inline
keyframesand user-defined variants viaLiveAnimate.config({ variants: { ... } }).
Transitions
- Per-animation
:transitionconfig — spring physics (stiffness/damping/mass, velocity-aware) or tween easing (CSS keyword,cubic-bezier(...), or a 4-element control-point list). - Global default spring via
LiveAnimate.config({ spring: { ... } }).
Gestures
hover/tapvia pointer events (touch-guarded).dragwith axis locking, bounds (constraints), elastic overscroll, and a velocity-aware spring snap-back that carries the fling's momentum — orsnap_back: falseto stay where dropped. Emitsphx-drag-endto the server.
Triggers & lists
in_viewandscrolltriggers backed byIntersectionObserver(withrepeat), so there's no per-scroll layout work on the main thread.staggeroffsets each child's animation; computed per mount-batch, so stream appends don't inherit a runaway delay.
LiveView lifecycle integration
- Exit animations play before LiveView removes an element, via the
phx-removetransition binding. - FLIP layout animations (
layout) animate elements smoothly through stream reflows and reorders; id-reuse safe. - Server-driven page transitions:
use LiveAnimate+@transitiondrives the View Transitions API on navigation. Presetsfade,blur,slide-left,slide-right,slide-up,slide-down; optional per-transitiondurationandeasing;apply_to: :navigate(default) or:allto also transitionlive_patchupdates. Falls back to the default crossfade where the View Transitions API is unavailable.
Accessibility
- Honors
prefers-reduced-motionby default (animations collapse to instant). - Per-element
respect_motion={false}opt-out for decorative animations, and a globalLiveAnimate.config({ respectMotion: false })default (with per-elementrespect_motion={true}to opt back in).