animejs 4.4.0 → 4.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/bundles/anime.esm.js +31 -61
- package/dist/bundles/anime.esm.min.js +2 -2
- package/dist/bundles/anime.umd.js +31 -61
- package/dist/bundles/anime.umd.min.js +2 -2
- package/dist/modules/animatable/animatable.cjs +1 -1
- package/dist/modules/animatable/animatable.js +1 -1
- package/dist/modules/animatable/index.cjs +1 -1
- package/dist/modules/animatable/index.js +1 -1
- package/dist/modules/animation/additive.cjs +1 -1
- package/dist/modules/animation/additive.js +1 -1
- package/dist/modules/animation/animation.cjs +1 -1
- package/dist/modules/animation/animation.js +1 -1
- package/dist/modules/animation/composition.cjs +1 -1
- package/dist/modules/animation/composition.js +1 -1
- package/dist/modules/animation/index.cjs +1 -1
- package/dist/modules/animation/index.js +1 -1
- package/dist/modules/core/clock.cjs +1 -1
- package/dist/modules/core/clock.js +1 -1
- package/dist/modules/core/colors.cjs +1 -1
- package/dist/modules/core/colors.js +1 -1
- package/dist/modules/core/consts.cjs +1 -1
- package/dist/modules/core/consts.js +1 -1
- package/dist/modules/core/globals.cjs +2 -2
- package/dist/modules/core/globals.js +2 -2
- package/dist/modules/core/helpers.cjs +1 -1
- package/dist/modules/core/helpers.js +1 -1
- package/dist/modules/core/render.cjs +30 -60
- package/dist/modules/core/render.js +32 -62
- package/dist/modules/core/styles.cjs +1 -1
- package/dist/modules/core/styles.js +1 -1
- package/dist/modules/core/targets.cjs +1 -1
- package/dist/modules/core/targets.js +1 -1
- package/dist/modules/core/transforms.cjs +1 -1
- package/dist/modules/core/transforms.js +1 -1
- package/dist/modules/core/units.cjs +1 -1
- package/dist/modules/core/units.js +1 -1
- package/dist/modules/core/values.cjs +1 -1
- package/dist/modules/core/values.js +1 -1
- package/dist/modules/draggable/draggable.cjs +1 -1
- package/dist/modules/draggable/draggable.js +1 -1
- package/dist/modules/draggable/index.cjs +1 -1
- package/dist/modules/draggable/index.js +1 -1
- package/dist/modules/easings/cubic-bezier/index.cjs +1 -1
- package/dist/modules/easings/cubic-bezier/index.js +1 -1
- package/dist/modules/easings/eases/index.cjs +1 -1
- package/dist/modules/easings/eases/index.js +1 -1
- package/dist/modules/easings/eases/parser.cjs +1 -1
- package/dist/modules/easings/eases/parser.js +1 -1
- package/dist/modules/easings/index.cjs +1 -1
- package/dist/modules/easings/index.js +1 -1
- package/dist/modules/easings/irregular/index.cjs +1 -1
- package/dist/modules/easings/irregular/index.js +1 -1
- package/dist/modules/easings/linear/index.cjs +1 -1
- package/dist/modules/easings/linear/index.js +1 -1
- package/dist/modules/easings/none.cjs +1 -1
- package/dist/modules/easings/none.js +1 -1
- package/dist/modules/easings/spring/index.cjs +1 -1
- package/dist/modules/easings/spring/index.js +1 -1
- package/dist/modules/easings/steps/index.cjs +1 -1
- package/dist/modules/easings/steps/index.js +1 -1
- package/dist/modules/engine/engine.cjs +1 -1
- package/dist/modules/engine/engine.js +1 -1
- package/dist/modules/engine/index.cjs +1 -1
- package/dist/modules/engine/index.js +1 -1
- package/dist/modules/events/index.cjs +1 -1
- package/dist/modules/events/index.js +1 -1
- package/dist/modules/events/scroll.cjs +1 -1
- package/dist/modules/events/scroll.js +1 -1
- package/dist/modules/index.cjs +1 -1
- package/dist/modules/index.js +1 -1
- package/dist/modules/layout/index.cjs +1 -1
- package/dist/modules/layout/index.js +1 -1
- package/dist/modules/layout/layout.cjs +1 -1
- package/dist/modules/layout/layout.js +1 -1
- package/dist/modules/scope/index.cjs +1 -1
- package/dist/modules/scope/index.js +1 -1
- package/dist/modules/scope/scope.cjs +1 -1
- package/dist/modules/scope/scope.js +1 -1
- package/dist/modules/svg/drawable.cjs +1 -1
- package/dist/modules/svg/drawable.js +1 -1
- package/dist/modules/svg/helpers.cjs +1 -1
- package/dist/modules/svg/helpers.js +1 -1
- package/dist/modules/svg/index.cjs +1 -1
- package/dist/modules/svg/index.js +1 -1
- package/dist/modules/svg/morphto.cjs +1 -1
- package/dist/modules/svg/morphto.js +1 -1
- package/dist/modules/svg/motionpath.cjs +1 -1
- package/dist/modules/svg/motionpath.js +1 -1
- package/dist/modules/text/index.cjs +1 -1
- package/dist/modules/text/index.js +1 -1
- package/dist/modules/text/scramble.cjs +1 -1
- package/dist/modules/text/scramble.js +1 -1
- package/dist/modules/text/split.cjs +1 -1
- package/dist/modules/text/split.js +1 -1
- package/dist/modules/timeline/index.cjs +1 -1
- package/dist/modules/timeline/index.js +1 -1
- package/dist/modules/timeline/position.cjs +1 -1
- package/dist/modules/timeline/position.js +1 -1
- package/dist/modules/timeline/timeline.cjs +1 -1
- package/dist/modules/timeline/timeline.js +1 -1
- package/dist/modules/timer/index.cjs +1 -1
- package/dist/modules/timer/index.js +1 -1
- package/dist/modules/timer/timer.cjs +1 -1
- package/dist/modules/timer/timer.js +1 -1
- package/dist/modules/utils/chainable.cjs +1 -1
- package/dist/modules/utils/chainable.js +1 -1
- package/dist/modules/utils/index.cjs +1 -1
- package/dist/modules/utils/index.js +1 -1
- package/dist/modules/utils/number.cjs +1 -1
- package/dist/modules/utils/number.js +1 -1
- package/dist/modules/utils/random.cjs +1 -1
- package/dist/modules/utils/random.js +1 -1
- package/dist/modules/utils/stagger.cjs +1 -1
- package/dist/modules/utils/stagger.js +1 -1
- package/dist/modules/utils/target.cjs +1 -1
- package/dist/modules/utils/target.js +1 -1
- package/dist/modules/utils/time.cjs +1 -1
- package/dist/modules/utils/time.js +1 -1
- package/dist/modules/waapi/composition.cjs +1 -1
- package/dist/modules/waapi/composition.js +1 -1
- package/dist/modules/waapi/index.cjs +1 -1
- package/dist/modules/waapi/index.js +1 -1
- package/dist/modules/waapi/waapi.cjs +1 -1
- package/dist/modules/waapi/waapi.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -69,14 +69,14 @@ Help the project become sustainable by sponsoring us on <a target="_blank" href=
|
|
|
69
69
|
</picture>
|
|
70
70
|
</a>
|
|
71
71
|
</td>
|
|
72
|
-
|
|
72
|
+
<td>
|
|
73
73
|
<a target="_blank" href="https://github.com/sponsors/juliangarnier">
|
|
74
74
|
<picture>
|
|
75
75
|
<img align="center" src="./assets/sponsors/placeholder-small.png?v=200126" width="141">
|
|
76
76
|
</picture>
|
|
77
77
|
</a>
|
|
78
78
|
</td>
|
|
79
|
-
|
|
79
|
+
<td>
|
|
80
80
|
<a target="_blank" href="https://github.com/sponsors/juliangarnier">
|
|
81
81
|
<picture>
|
|
82
82
|
<img align="center" src="./assets/sponsors/placeholder-small.png?v=200126" width="141">
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Anime.js - ESM bundle
|
|
3
|
-
* @version v4.4.
|
|
3
|
+
* @version v4.4.1
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2026 - Julian Garnier
|
|
6
6
|
*/
|
|
@@ -835,7 +835,7 @@ const globals = {
|
|
|
835
835
|
editor: null,
|
|
836
836
|
};
|
|
837
837
|
|
|
838
|
-
const globalVersions = { version: '4.4.
|
|
838
|
+
const globalVersions = { version: '4.4.1', engine: null };
|
|
839
839
|
|
|
840
840
|
if (isBrowser) {
|
|
841
841
|
if (!win.AnimeJS) win.AnimeJS = [];
|
|
@@ -1830,50 +1830,6 @@ const render = (tickable, time, muteCallbacks, internalRender, tickMode) => {
|
|
|
1830
1830
|
return hasRendered;
|
|
1831
1831
|
};
|
|
1832
1832
|
|
|
1833
|
-
// Shared context for extracted forEachChildren callbacks in tick()
|
|
1834
|
-
// Avoids closure allocation every frame
|
|
1835
|
-
|
|
1836
|
-
let renderCtxChildrenTime = 0;
|
|
1837
|
-
let renderCtxTlFps = 0;
|
|
1838
|
-
let renderCtxTickTime = 0;
|
|
1839
|
-
let renderCtxTickMode = 0;
|
|
1840
|
-
let renderCtxMuteCallbacks = 0;
|
|
1841
|
-
let renderCtxInternalRender = 0;
|
|
1842
|
-
let renderCtxChildrenHasRendered = 0;
|
|
1843
|
-
let renderCtxChildrenHaveCompleted = true;
|
|
1844
|
-
let loopCtxIsRunningBackwards = false;
|
|
1845
|
-
let loopCtxIterationDuration = 0;
|
|
1846
|
-
let loopCtxMuteCallbacks = 0;
|
|
1847
|
-
|
|
1848
|
-
/** @param {JSAnimation} child */
|
|
1849
|
-
const tickLoopChild = (child) => {
|
|
1850
|
-
if (!loopCtxIsRunningBackwards) {
|
|
1851
|
-
// Force an internal render to trigger the callbacks if the child has not completed on loop
|
|
1852
|
-
if (!child.completed && !child.backwards && child._currentTime < child.iterationDuration) {
|
|
1853
|
-
render(child, loopCtxIterationDuration, loopCtxMuteCallbacks, 1, tickModes.FORCE);
|
|
1854
|
-
}
|
|
1855
|
-
// Reset their began and completed flags to allow retrigering callbacks on the next iteration
|
|
1856
|
-
child.began = false;
|
|
1857
|
-
child.completed = false;
|
|
1858
|
-
} else {
|
|
1859
|
-
const childDuration = child.duration;
|
|
1860
|
-
const childStartTime = child._offset + child._delay;
|
|
1861
|
-
const childEndTime = childStartTime + childDuration;
|
|
1862
|
-
// Triggers the onComplete callback on reverse for children on the edges of the timeline
|
|
1863
|
-
if (!loopCtxMuteCallbacks && childDuration <= minValue && (!childStartTime || childEndTime === loopCtxIterationDuration)) {
|
|
1864
|
-
child.onComplete(child);
|
|
1865
|
-
}
|
|
1866
|
-
}
|
|
1867
|
-
};
|
|
1868
|
-
|
|
1869
|
-
/** @param {JSAnimation} child */
|
|
1870
|
-
const tickRenderChild = (child) => {
|
|
1871
|
-
const childTime = round$1((renderCtxChildrenTime - child._offset) * child._speed, 12); // Rounding is needed when using seconds
|
|
1872
|
-
const childTickMode = child._fps < renderCtxTlFps ? child.requestTick(renderCtxTickTime) : renderCtxTickMode;
|
|
1873
|
-
renderCtxChildrenHasRendered += render(child, childTime, renderCtxMuteCallbacks, renderCtxInternalRender, childTickMode);
|
|
1874
|
-
if (!child.completed && renderCtxChildrenHaveCompleted) renderCtxChildrenHaveCompleted = false;
|
|
1875
|
-
};
|
|
1876
|
-
|
|
1877
1833
|
/**
|
|
1878
1834
|
* @param {Tickable} tickable
|
|
1879
1835
|
* @param {Number} time
|
|
@@ -1890,28 +1846,42 @@ const tick = (tickable, time, muteCallbacks, internalRender, tickMode) => {
|
|
|
1890
1846
|
const tlIsRunningBackwards = tl.backwards;
|
|
1891
1847
|
const tlChildrenTime = internalRender ? time : tl._iterationTime;
|
|
1892
1848
|
const tlCildrenTickTime = now();
|
|
1849
|
+
|
|
1893
1850
|
let tlChildrenHasRendered = 0;
|
|
1894
1851
|
let tlChildrenHaveCompleted = true;
|
|
1852
|
+
|
|
1895
1853
|
// If the timeline has looped forward, we need to manually triggers children skipped callbacks
|
|
1896
1854
|
if (!internalRender && tl._currentIteration !== _currentIteration) {
|
|
1897
1855
|
const tlIterationDuration = tl.iterationDuration;
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1856
|
+
forEachChildren(tl, (/** @type {JSAnimation} */child) => {
|
|
1857
|
+
if (!tlIsRunningBackwards) {
|
|
1858
|
+
// Force an internal render to trigger the callbacks if the child has not completed on loop
|
|
1859
|
+
if (!child.completed && !child.backwards && child._currentTime < child.iterationDuration) {
|
|
1860
|
+
render(child, tlIterationDuration, muteCallbacks, 1, tickModes.FORCE);
|
|
1861
|
+
}
|
|
1862
|
+
// Reset their began and completed flags to allow retrigering callbacks on the next iteration
|
|
1863
|
+
child.began = false;
|
|
1864
|
+
child.completed = false;
|
|
1865
|
+
} else {
|
|
1866
|
+
const childDuration = child.duration;
|
|
1867
|
+
const childStartTime = child._offset + child._delay;
|
|
1868
|
+
const childEndTime = childStartTime + childDuration;
|
|
1869
|
+
// Triggers the onComplete callback on reverse for children on the edges of the timeline
|
|
1870
|
+
if (!muteCallbacks && childDuration <= minValue && (!childStartTime || childEndTime === tlIterationDuration)) {
|
|
1871
|
+
child.onComplete(child);
|
|
1872
|
+
}
|
|
1873
|
+
}
|
|
1874
|
+
});
|
|
1902
1875
|
if (!muteCallbacks) tl.onLoop(/** @type {CallbackArgument} */(tl));
|
|
1903
1876
|
}
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
forEachChildren(tl, tickRenderChild, tlIsRunningBackwards);
|
|
1913
|
-
tlChildrenHasRendered = renderCtxChildrenHasRendered;
|
|
1914
|
-
tlChildrenHaveCompleted = renderCtxChildrenHaveCompleted;
|
|
1877
|
+
|
|
1878
|
+
forEachChildren(tl, (/** @type {JSAnimation} */child) => {
|
|
1879
|
+
const childTime = round$1((tlChildrenTime - child._offset) * child._speed, 12); // Rounding is needed when using seconds
|
|
1880
|
+
const childTickMode = child._fps < tl._fps ? child.requestTick(tlCildrenTickTime) : tickMode;
|
|
1881
|
+
tlChildrenHasRendered += render(child, childTime, muteCallbacks, internalRender, childTickMode);
|
|
1882
|
+
if (!child.completed && tlChildrenHaveCompleted) tlChildrenHaveCompleted = false;
|
|
1883
|
+
}, tlIsRunningBackwards);
|
|
1884
|
+
|
|
1915
1885
|
// Renders on timeline are triggered by its children so it needs to be set after rendering the children
|
|
1916
1886
|
if (!muteCallbacks && tlChildrenHasRendered) tl.onRender(/** @type {CallbackArgument} */(tl));
|
|
1917
1887
|
// Triggers the timeline onComplete() once all chindren all completed and the current time has reached the end
|