Updates
Changelog
What changed in each release, and what it means for your code.
For the full changelog, see the GitHub releases.
New featuresBug fixesBreaking changesPerformance & optimizationsPackagingDocumentation
0.3.3
- New
completeOnTabHiddenprop that jumps running animations to their end when the browser tab is hidden. See Finish animations when the tab is hidden. AnimeTransitionAnimeTransitionGroupAnimeLayoutGroup AnimeLayoutGroupitems return to their normal place after twodepschanges in one update, instead of staying pinned until the group remounts.
0.3.2
- New
reducedMotionmodule option that makes animations jump to their end state for visitors who ask for less motion. See Accessibility. AnimeTransitionGrouptakesdepsandshallow, so it measures its layout only when items are added, removed or reordered, or when adepsvalue changes.useSplitTextkeeps its split when a parent re-render passes the same parameters as a new object.- The CSS that the transition
components and layout groups rely on no longer loads on every page. It
ships with the code that uses it: the three components and
useAnimeLayout. - Importing from
#nanime/composablesnow adds the same code as auto-imports. Before, it also kept the top-level code of composables you don't use. - The
performance guide
and the
AnimeLayoutGrouppage explain when to passdepstoAnimeTransitionGroupandAnimeLayoutGroup.
0.3.1
- Fixes the Tailwind CSS v3 build error introduced in 0.3.0.
- Selector lists in
elements, such as".card, .card h3", no longer log a warning inAnimeLayoutGroup.
0.3.0
useAnimeScrolltakes a parameters object instead of a ref or getter. Pass template refs astargetandcontainerdirectly, and refs forenter,leave,repeatandaxisupdate the observer without rebuilding it.- After a leave, the styles it animated are
removed, so a
v-showor KeepAlive element comes back in its normal place. An enter with only an end value, such as{ opacity: 1 }, now starts from the element's own style. Give it a start value:{ opacity: [0, 1] }. AnimeTransitionAnimeTransitionGroup -
patch()on auseAnimeLayoutreturnsPromise<void>instead of the timeline.await layout.patch(...)still resolves when the animation finishes. Read the timeline fromlayout.timeline. - TypeScript rejects
duration,delayandeasein the animation options ofuseScrambleText, where AnimeJS ignored them. Put them in the scramble options. - New
AnimeLayoutGroupcomponent that animates its children to their new position and size whendepschange. - Default props for
nanimecomponents, set inapp.config.tsor for part of the app. See component defaults. - New
htmloption inuseSplitTextfor text that changes. See render changing text with v-once. -
AutoLayoutParams,LayoutAnimationParams,AnimeScrollParams,AnimeScrollTargetandScrambleAnimationParamsare exported from#nanime/types. - Changing a field of a
reactive()parameters object, such asparams.x = 200, now rebuilds and restarts the animation, as it does for a ref or getter. If you change parameters often, passkeepTime: trueto keep the playhead, or useuseAnimatablefor values that change every frame. useAnimateuseAnimeTimelineuseSplitTextuseScrambleTextuseAnimeScrolluseAnimeLayout - Calling a method inside your component's
onMounted, such asanimation.seek(500)orlayout.patch(update), now takes effect. The animation is created before youronMountedruns. useAnimateuseAnimatableuseAnimeLayout - Calling
sync()on auseAnimeTimelinewith auseAnimatedeclared after it now syncs that animation. - A
useAnimeTimelinecarries on when its parameters change. WithkeepTime, it keeps its playhead and stays playing or paused. Withautoplay: useAnimeScroll(...), it keeps following the scroll. - When the target,
triggerorcontainerref of auseDraggablepoints to a new element, dragging moves to that element. A target that isnullat mount no longer throws. - A
useDraggablestays disabled afterdisable()when it rebuilds. - Snapping in
useDraggableworks whensnapis a ref or a function that takes the draggable. A top-levelsnapstill applies when you also pass anxoryobject. - When the target of a
useAnimatablechanges, the old element goes back to its original styles. - Animations added with
link()stay linked when the parameters of auseAnimeScrollchange. - When the target of a
useSplitTextbecomesnull, the original text comes back andlines,wordsandcharsare emptied. - Items in
AnimeTransitionGroupwith a CSStransitionno longer animate twice after a move. - Elements keep their shape while a layout animates. A box with padding keeps its size, one-line text stays on one line, inline text keeps its line height, and an icon in a button next to text, such as the x on a tag chip, stays in its button. AnimeTransitionGroupuseAnimeLayout
- A
useAnimeLayoutno longer rebuilds in the middle of an animation and cuts it short. - TypeScript accepts a getter as the
useAnimeLayouttarget and as theuseDraggabletrigger.
0.2.1
- With pnpm,
nuxi devwarned that none of theanimejs/*entriesnanimeadds tovite.optimizeDeps.includecould be resolved, and Vite skipped pre-bundling them. The entries now point Vite at the AnimeJS copy insidenanime, so they resolve whether or not your app depends onanimejsitself. - Items in
<AnimeTransitionGroup>lost an inlinebackground,colororborder-radiuswhen the other items finished moving while they were still entering or leaving. They now keep it. -
animejs/easings, which#nanime/easingsre-exports, is now pre-bundled too. - The
useAnimatablepage now says that a number beside a property in the options is that property's tween duration, not a value to animate to.
0.2.0
-
useAnimeLayoutreturns the AnimeJS layout itself instead of a wrapper object. Read properties straight off it rather than from.properties.animate()no longer takes a callback: use the timeline it returns, for examplelayout.animate().then(done). - Added
<AnimeTransition>and<AnimeTransitionGroup>, built on Vue's<Transition>and<TransitionGroup>. They run enter and leave with AnimeJS instead of CSS classes. In a list, the other items slide to their new places through AnimeJS layout, andstagger()delays work across items that enter or leave in the same update. - The transition components take
enter-animation,leave-animationandmove-animation, as AnimeJS params or the name of a transition style. Seven styles are built in, such asfadeandslide-up, and you can add your own undernanime.transitionsinapp.config.ts. - New
componentsmodule option. Set it tofalseto skip registering the transition components. -
useAnimeLayoutnow has a docs page and apatch()method. Pass it the function that changes your state, and it records the layout, runs the function, waits for Vue to update the DOM, then animates. The layout also rebuilds only when its target or parameters actually change, not on every reactive update. - Hovering a composable, a component prop or a
#nanime/typestype in your editor now shows what it does and its default. - Replacing an element inside a composable's parameters, for example the target of a timeline step, was ignored. The change check treated any two elements as equal, so the animation kept the old one.
- Parameters holding reactive state or an AnimeJS instance could overflow the stack during the change check.
-
import { useAnimate } from '#nanime/composables'failed, so turning off auto-imports withcomposables: falseleft no way to import the composables. -
lodash-esandtailwind-mergeare no longer added to Vite's pre-bundled dependencies.nanimenever used them. - New Components section. The Misc pages are now one Utilities page under Composables.
- New Media library example. Drag to bin and Loading sequence are rebuilt with the transition components. The Timeline storyboard and Text magnet examples are gone.
- New pages comparing
nanimewith Nuxt modules and Vue packages for AnimeJS. - Every page has its own search title and description. Code blocks in live demos highlight correctly again.
0.1.14
- Fixed
reactive is not definedruntime crashes caused by Nuxt auto-imports innode_modules.
0.1.13
- Added
useAnimeScrollcomposable wrapping AnimeJSonScroll(). Owns the observer's lifecycle, and pass it to an animation'sautoplayto drive it from scroll position. -
keepTimeoption lets a running animation keep its playhead across a rebuild instead of resetting. Defaults tofalse, matching prior behavior; set it per call, ornanime.keepTime: trueinnuxt.config, to opt in. -
useSplitTextexposesrefresh(), for re-splitting after the element's text changes. - Composable return values are recognised by
proxy marker wherever AnimeJS accepts an instance, not by parameter
name, so they work directly in
autoplayor.sync(). -
#nanime/typesadds the scroll and remaining SVG types. -
useSplitTextreturned an emptymethodsobject. Property extraction now walks the prototype chain instead ofObject.keys. -
useSplitTextre-splits current text and watches explicit sources, fixing a mount-time runaway. - A timeline no longer empties itself when its parameters change. Buffered calls replay on rebuild.
-
useAnimatenow watches bothtargetandparameters, not justtarget. - An animation whose parameters carry
another composable's instance is cancelled, not reverted, on rebuild,
since
Timer.revert()cascades into the linkedScrollObserver. -
autoplayresolved tonullwhen the scroll observer did not exist yet, and never relinked afterwards. - Rebuilds are skipped when the new parameters match the old ones. Checking for a match takes about 0.06 microseconds, next to nothing compared to the roughly 2.8 milliseconds a full rebuild costs at 200 targets.
- Every page rewritten for shorter, plainer sentences, with composable pages following one layout.
- Corrected wrong API claims across
composable pages (return type, buffering,
rebuild triggers), and wrong
upstream AnimeJS defaults for
ease,splitTextwords, andonScrollthresholds, now read from the installed package. - Corrected example pages against their components (timeline count, drag handle, scramble target), and added a Scroll road trip showcase.
- Tightened showcase page prose for a consistent register, and fixed two factual errors in the text magnet page.
v0.0.11...v0.1.12
- Removed
<ATransitionSlide>/<ATransitionScale>, thecomponents/prefixmodule options, and the#nanime/componentsalias. They broke underuseAnimeLayout, sonanimeis composables-only until layout handling is sorted out. -
useDraggablenow returns a buffered proxy (BufferedProxyReturns<T>rather thanProxyReturns<T>). Methods called before the instance exists are replayed once it is created, sodraggable.disable()no longer needs optional chaining, and code that used it still compiles. useAnimeTimelinenow buffers the whole timer control surface, not just the builder methods, so calls likeplay,pause, andseekare safe before mount. Its return type changed the same way asuseDraggable's.-
@vueuse/coreis no longer a dependency at all. The three helpers the runtime used from it (useMounted,tryOnScopeDisposeandtoReactive) are now in-tree, so installingnanimeno longer pulls VueUse in. -
animejsanddefuare plain dependencies now, andvueis the only peer left. Both are imported at runtime, so nothing has to be installed alongsidenanimeany more. - New
#nanime/proxies/svgalias re-exportingmorphTo,createMotionPathandcreateDrawable, plus a#nanime/proxiesroot that re-exports both the text and SVG proxies. -
#nanime/utilsalso exportsanimateandcreateTimerfor imperative work outside a composable. -
#nanime/typesaddsJSAnimation,Timer,TimerParams,TimerOptions,DrawableSVGGeometry,TextSplitterParamsandSplitTemplateParams. -
.sync()accepts a composable's return value whether or not the underlying instance is held in a ref. - Added a Performance guide covering engine choice, high-frequency updates and split-text cost, and caveats for every composable page.
- Added an Examples section with four showcase demos, replacing the transition components docs.
v0.0.11
- Added
useAnimeTimelinecomposable wrapping AnimeJScreateTimeline()with Vue ref target normalization, pre-mount command buffering, and timeline syncing. - Composable returns can now be passed
directly to
.sync().nanimeunwraps them to raw AnimeJS instances.
v0.0.9/v0.0.10
- Renamed
useLayouttouseAnimeLayout. It stays auto-imported but undocumented and unsupported while its interaction with Vue's DOM management is worked out. - Added
useScrambleTextcomposable wrapping AnimeJSscrambleText()with reactive text cycling.
v0.0.8
- Renamed animation
optionstoparametersacross all composables. - Added instant play support for calling
composables outside
setup().
v0.0.5
- Initial release with
useAnimate,useWaapiAnimate,useAnimatable,useSplitText, anduseDraggable.