animejs 4.2.0 → 4.2.2
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/dist/bundles/anime.esm.js +103 -48
- package/dist/bundles/anime.esm.min.js +2 -2
- package/dist/bundles/anime.umd.js +103 -48
- package/dist/bundles/anime.umd.min.js +2 -2
- package/dist/modules/animatable/animatable.cjs +2 -2
- package/dist/modules/animatable/animatable.js +2 -2
- 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 +7 -3
- package/dist/modules/animation/animation.d.ts +8 -3
- package/dist/modules/animation/animation.js +7 -3
- 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 +1 -1
- package/dist/modules/core/render.js +1 -1
- 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 +17 -4
- package/dist/modules/draggable/draggable.d.ts +2 -0
- package/dist/modules/draggable/draggable.js +18 -5
- 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 +7 -3
- package/dist/modules/events/scroll.d.ts +2 -0
- package/dist/modules/events/scroll.js +7 -3
- package/dist/modules/index.cjs +1 -1
- package/dist/modules/index.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 +12 -2
- package/dist/modules/svg/morphto.js +12 -2
- package/dist/modules/svg/motionpath.cjs +23 -12
- package/dist/modules/svg/motionpath.d.ts +1 -1
- package/dist/modules/svg/motionpath.js +23 -12
- package/dist/modules/text/index.cjs +1 -1
- package/dist/modules/text/index.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 +9 -5
- package/dist/modules/timeline/timeline.d.ts +8 -3
- package/dist/modules/timeline/timeline.js +9 -5
- package/dist/modules/timer/index.cjs +1 -1
- package/dist/modules/timer/index.js +1 -1
- package/dist/modules/timer/timer.cjs +17 -14
- package/dist/modules/timer/timer.d.ts +12 -7
- package/dist/modules/timer/timer.js +17 -14
- package/dist/modules/types/index.d.ts +7 -3
- 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 +8 -5
- package/dist/modules/waapi/waapi.d.ts +8 -5
- package/dist/modules/waapi/waapi.js +8 -5
- package/package.json +3 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Anime.js - events - CJS
|
|
3
|
-
* @version v4.2.
|
|
3
|
+
* @version v4.2.2
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2025 - Julian Garnier
|
|
6
6
|
*/
|
|
@@ -95,6 +95,8 @@ class ScrollContainer {
|
|
|
95
95
|
/** @type {Number} */
|
|
96
96
|
this.top = 0;
|
|
97
97
|
/** @type {Number} */
|
|
98
|
+
this.scale = 1;
|
|
99
|
+
/** @type {Number} */
|
|
98
100
|
this.zIndex = 0;
|
|
99
101
|
/** @type {Number} */
|
|
100
102
|
this.scrollX = 0;
|
|
@@ -206,6 +208,7 @@ class ScrollContainer {
|
|
|
206
208
|
height = $el.clientHeight;
|
|
207
209
|
this.top = elRect.top;
|
|
208
210
|
this.left = elRect.left;
|
|
211
|
+
this.scale = elRect.width ? width / elRect.width : (elRect.height ? height / elRect.height : 1);
|
|
209
212
|
}
|
|
210
213
|
this.width = width;
|
|
211
214
|
this.height = height;
|
|
@@ -731,8 +734,9 @@ class ScrollObserver {
|
|
|
731
734
|
}
|
|
732
735
|
}
|
|
733
736
|
const rect = $target.getBoundingClientRect();
|
|
734
|
-
const
|
|
735
|
-
const
|
|
737
|
+
const scale = container.scale;
|
|
738
|
+
const offset = (isHori ? rect.left + container.scrollX - container.left : rect.top + container.scrollY - container.top) * scale;
|
|
739
|
+
const targetSize = (isHori ? rect.width : rect.height) * scale;
|
|
736
740
|
const containerSize = isHori ? container.width : container.height;
|
|
737
741
|
const scrollSize = isHori ? container.scrollWidth : container.scrollHeight;
|
|
738
742
|
const maxScroll = scrollSize - containerSize;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Anime.js - events - ESM
|
|
3
|
-
* @version v4.2.
|
|
3
|
+
* @version v4.2.2
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2025 - Julian Garnier
|
|
6
6
|
*/
|
|
@@ -93,6 +93,8 @@ class ScrollContainer {
|
|
|
93
93
|
/** @type {Number} */
|
|
94
94
|
this.top = 0;
|
|
95
95
|
/** @type {Number} */
|
|
96
|
+
this.scale = 1;
|
|
97
|
+
/** @type {Number} */
|
|
96
98
|
this.zIndex = 0;
|
|
97
99
|
/** @type {Number} */
|
|
98
100
|
this.scrollX = 0;
|
|
@@ -204,6 +206,7 @@ class ScrollContainer {
|
|
|
204
206
|
height = $el.clientHeight;
|
|
205
207
|
this.top = elRect.top;
|
|
206
208
|
this.left = elRect.left;
|
|
209
|
+
this.scale = elRect.width ? width / elRect.width : (elRect.height ? height / elRect.height : 1);
|
|
207
210
|
}
|
|
208
211
|
this.width = width;
|
|
209
212
|
this.height = height;
|
|
@@ -729,8 +732,9 @@ class ScrollObserver {
|
|
|
729
732
|
}
|
|
730
733
|
}
|
|
731
734
|
const rect = $target.getBoundingClientRect();
|
|
732
|
-
const
|
|
733
|
-
const
|
|
735
|
+
const scale = container.scale;
|
|
736
|
+
const offset = (isHori ? rect.left + container.scrollX - container.left : rect.top + container.scrollY - container.top) * scale;
|
|
737
|
+
const targetSize = (isHori ? rect.width : rect.height) * scale;
|
|
734
738
|
const containerSize = isHori ? container.width : container.height;
|
|
735
739
|
const scrollSize = isHori ? container.scrollWidth : container.scrollHeight;
|
|
736
740
|
const maxScroll = scrollSize - containerSize;
|
package/dist/modules/index.cjs
CHANGED
package/dist/modules/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Anime.js - svg - CJS
|
|
3
|
-
* @version v4.2.
|
|
3
|
+
* @version v4.2.2
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2025 - Julian Garnier
|
|
6
6
|
*/
|
|
@@ -24,8 +24,18 @@ var helpers = require('./helpers.cjs');
|
|
|
24
24
|
* @return {FunctionValue}
|
|
25
25
|
*/
|
|
26
26
|
const morphTo = (path2, precision = .33) => ($path1) => {
|
|
27
|
+
const tagName1 = ($path1.tagName || '').toLowerCase();
|
|
28
|
+
if (!tagName1.match(/^(path|polygon|polyline)$/)) {
|
|
29
|
+
throw new Error(`Can't morph a <${$path1.tagName}> SVG element. Use <path>, <polygon> or <polyline>.`);
|
|
30
|
+
}
|
|
27
31
|
const $path2 = /** @type {SVGGeometryElement} */(helpers.getPath(path2));
|
|
28
|
-
if (!$path2)
|
|
32
|
+
if (!$path2) {
|
|
33
|
+
throw new Error("Can't morph to an invalid target. 'path2' must resolve to an existing <path>, <polygon> or <polyline> SVG element.");
|
|
34
|
+
}
|
|
35
|
+
const tagName2 = ($path2.tagName || '').toLowerCase();
|
|
36
|
+
if (!tagName2.match(/^(path|polygon|polyline)$/)) {
|
|
37
|
+
throw new Error(`Can't morph a <${$path2.tagName}> SVG element. Use <path>, <polygon> or <polyline>.`);
|
|
38
|
+
}
|
|
29
39
|
const isPath = $path1.tagName === 'path';
|
|
30
40
|
const separator = isPath ? ' ' : ',';
|
|
31
41
|
const previousPoints = $path1[consts.morphPointsSymbol];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Anime.js - svg - ESM
|
|
3
|
-
* @version v4.2.
|
|
3
|
+
* @version v4.2.2
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2025 - Julian Garnier
|
|
6
6
|
*/
|
|
@@ -22,8 +22,18 @@ import { getPath } from './helpers.js';
|
|
|
22
22
|
* @return {FunctionValue}
|
|
23
23
|
*/
|
|
24
24
|
const morphTo = (path2, precision = .33) => ($path1) => {
|
|
25
|
+
const tagName1 = ($path1.tagName || '').toLowerCase();
|
|
26
|
+
if (!tagName1.match(/^(path|polygon|polyline)$/)) {
|
|
27
|
+
throw new Error(`Can't morph a <${$path1.tagName}> SVG element. Use <path>, <polygon> or <polyline>.`);
|
|
28
|
+
}
|
|
25
29
|
const $path2 = /** @type {SVGGeometryElement} */(getPath(path2));
|
|
26
|
-
if (!$path2)
|
|
30
|
+
if (!$path2) {
|
|
31
|
+
throw new Error("Can't morph to an invalid target. 'path2' must resolve to an existing <path>, <polygon> or <polyline> SVG element.");
|
|
32
|
+
}
|
|
33
|
+
const tagName2 = ($path2.tagName || '').toLowerCase();
|
|
34
|
+
if (!tagName2.match(/^(path|polygon|polyline)$/)) {
|
|
35
|
+
throw new Error(`Can't morph a <${$path2.tagName}> SVG element. Use <path>, <polygon> or <polyline>.`);
|
|
36
|
+
}
|
|
27
37
|
const isPath = $path1.tagName === 'path';
|
|
28
38
|
const separator = isPath ? ' ' : ',';
|
|
29
39
|
const previousPoints = $path1[morphPointsSymbol];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Anime.js - svg - CJS
|
|
3
|
-
* @version v4.2.
|
|
3
|
+
* @version v4.2.2
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2025 - Julian Garnier
|
|
6
6
|
*/
|
|
@@ -24,36 +24,46 @@ var helpers = require('./helpers.cjs');
|
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* @param {SVGGeometryElement} $path
|
|
27
|
+
* @param {Number} totalLength
|
|
27
28
|
* @param {Number} progress
|
|
28
|
-
* @param {Number}lookup
|
|
29
|
+
* @param {Number} lookup
|
|
30
|
+
* @param {Boolean} shouldClamp
|
|
29
31
|
* @return {DOMPoint}
|
|
30
32
|
*/
|
|
31
|
-
const getPathPoint = ($path, progress, lookup
|
|
32
|
-
|
|
33
|
+
const getPathPoint = ($path, totalLength, progress, lookup, shouldClamp) => {
|
|
34
|
+
const point = progress + lookup;
|
|
35
|
+
const pointOnPath = shouldClamp
|
|
36
|
+
? Math.max(0, Math.min(point, totalLength)) // Clamp between 0 and totalLength
|
|
37
|
+
: (point % totalLength + totalLength) % totalLength; // Wrap around
|
|
38
|
+
return $path.getPointAtLength(pointOnPath);
|
|
33
39
|
};
|
|
34
40
|
|
|
35
41
|
/**
|
|
36
42
|
* @param {SVGGeometryElement} $path
|
|
37
43
|
* @param {String} pathProperty
|
|
44
|
+
* @param {Number} [offset=0]
|
|
38
45
|
* @return {FunctionValue}
|
|
39
46
|
*/
|
|
40
|
-
const getPathProgess = ($path, pathProperty) => {
|
|
47
|
+
const getPathProgess = ($path, pathProperty, offset = 0) => {
|
|
41
48
|
return $el => {
|
|
42
49
|
const totalLength = +($path.getTotalLength());
|
|
43
50
|
const inSvg = $el[consts.isSvgSymbol];
|
|
44
51
|
const ctm = $path.getCTM();
|
|
52
|
+
const shouldClamp = offset === 0;
|
|
45
53
|
/** @type {TweenObjectValue} */
|
|
46
54
|
return {
|
|
47
55
|
from: 0,
|
|
48
56
|
to: totalLength,
|
|
49
57
|
/** @type {TweenModifier} */
|
|
50
58
|
modifier: progress => {
|
|
59
|
+
const offsetLength = offset * totalLength;
|
|
60
|
+
const newProgress = progress + offsetLength;
|
|
51
61
|
if (pathProperty === 'a') {
|
|
52
|
-
const p0 = getPathPoint($path,
|
|
53
|
-
const p1 = getPathPoint($path,
|
|
62
|
+
const p0 = getPathPoint($path, totalLength, newProgress, -1, shouldClamp);
|
|
63
|
+
const p1 = getPathPoint($path, totalLength, newProgress, 1, shouldClamp);
|
|
54
64
|
return helpers$1.atan2(p1.y - p0.y, p1.x - p0.x) * 180 / helpers$1.PI;
|
|
55
65
|
} else {
|
|
56
|
-
const p = getPathPoint($path,
|
|
66
|
+
const p = getPathPoint($path, totalLength, newProgress, 0, shouldClamp);
|
|
57
67
|
return pathProperty === 'x' ?
|
|
58
68
|
inSvg || !ctm ? p.x : p.x * ctm.a + p.y * ctm.c + ctm.e :
|
|
59
69
|
inSvg || !ctm ? p.y : p.x * ctm.b + p.y * ctm.d + ctm.f
|
|
@@ -65,14 +75,15 @@ const getPathProgess = ($path, pathProperty) => {
|
|
|
65
75
|
|
|
66
76
|
/**
|
|
67
77
|
* @param {TargetsParam} path
|
|
78
|
+
* @param {Number} [offset=0]
|
|
68
79
|
*/
|
|
69
|
-
const createMotionPath = path => {
|
|
80
|
+
const createMotionPath = (path, offset = 0) => {
|
|
70
81
|
const $path = helpers.getPath(path);
|
|
71
82
|
if (!$path) return;
|
|
72
83
|
return {
|
|
73
|
-
translateX: getPathProgess($path, 'x'),
|
|
74
|
-
translateY: getPathProgess($path, 'y'),
|
|
75
|
-
rotate: getPathProgess($path, 'a'),
|
|
84
|
+
translateX: getPathProgess($path, 'x', offset),
|
|
85
|
+
translateY: getPathProgess($path, 'y', offset),
|
|
86
|
+
rotate: getPathProgess($path, 'a', offset),
|
|
76
87
|
}
|
|
77
88
|
};
|
|
78
89
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Anime.js - svg - ESM
|
|
3
|
-
* @version v4.2.
|
|
3
|
+
* @version v4.2.2
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2025 - Julian Garnier
|
|
6
6
|
*/
|
|
@@ -22,36 +22,46 @@ import { getPath } from './helpers.js';
|
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* @param {SVGGeometryElement} $path
|
|
25
|
+
* @param {Number} totalLength
|
|
25
26
|
* @param {Number} progress
|
|
26
|
-
* @param {Number}lookup
|
|
27
|
+
* @param {Number} lookup
|
|
28
|
+
* @param {Boolean} shouldClamp
|
|
27
29
|
* @return {DOMPoint}
|
|
28
30
|
*/
|
|
29
|
-
const getPathPoint = ($path, progress, lookup
|
|
30
|
-
|
|
31
|
+
const getPathPoint = ($path, totalLength, progress, lookup, shouldClamp) => {
|
|
32
|
+
const point = progress + lookup;
|
|
33
|
+
const pointOnPath = shouldClamp
|
|
34
|
+
? Math.max(0, Math.min(point, totalLength)) // Clamp between 0 and totalLength
|
|
35
|
+
: (point % totalLength + totalLength) % totalLength; // Wrap around
|
|
36
|
+
return $path.getPointAtLength(pointOnPath);
|
|
31
37
|
};
|
|
32
38
|
|
|
33
39
|
/**
|
|
34
40
|
* @param {SVGGeometryElement} $path
|
|
35
41
|
* @param {String} pathProperty
|
|
42
|
+
* @param {Number} [offset=0]
|
|
36
43
|
* @return {FunctionValue}
|
|
37
44
|
*/
|
|
38
|
-
const getPathProgess = ($path, pathProperty) => {
|
|
45
|
+
const getPathProgess = ($path, pathProperty, offset = 0) => {
|
|
39
46
|
return $el => {
|
|
40
47
|
const totalLength = +($path.getTotalLength());
|
|
41
48
|
const inSvg = $el[isSvgSymbol];
|
|
42
49
|
const ctm = $path.getCTM();
|
|
50
|
+
const shouldClamp = offset === 0;
|
|
43
51
|
/** @type {TweenObjectValue} */
|
|
44
52
|
return {
|
|
45
53
|
from: 0,
|
|
46
54
|
to: totalLength,
|
|
47
55
|
/** @type {TweenModifier} */
|
|
48
56
|
modifier: progress => {
|
|
57
|
+
const offsetLength = offset * totalLength;
|
|
58
|
+
const newProgress = progress + offsetLength;
|
|
49
59
|
if (pathProperty === 'a') {
|
|
50
|
-
const p0 = getPathPoint($path,
|
|
51
|
-
const p1 = getPathPoint($path,
|
|
60
|
+
const p0 = getPathPoint($path, totalLength, newProgress, -1, shouldClamp);
|
|
61
|
+
const p1 = getPathPoint($path, totalLength, newProgress, 1, shouldClamp);
|
|
52
62
|
return atan2(p1.y - p0.y, p1.x - p0.x) * 180 / PI;
|
|
53
63
|
} else {
|
|
54
|
-
const p = getPathPoint($path,
|
|
64
|
+
const p = getPathPoint($path, totalLength, newProgress, 0, shouldClamp);
|
|
55
65
|
return pathProperty === 'x' ?
|
|
56
66
|
inSvg || !ctm ? p.x : p.x * ctm.a + p.y * ctm.c + ctm.e :
|
|
57
67
|
inSvg || !ctm ? p.y : p.x * ctm.b + p.y * ctm.d + ctm.f
|
|
@@ -63,14 +73,15 @@ const getPathProgess = ($path, pathProperty) => {
|
|
|
63
73
|
|
|
64
74
|
/**
|
|
65
75
|
* @param {TargetsParam} path
|
|
76
|
+
* @param {Number} [offset=0]
|
|
66
77
|
*/
|
|
67
|
-
const createMotionPath = path => {
|
|
78
|
+
const createMotionPath = (path, offset = 0) => {
|
|
68
79
|
const $path = getPath(path);
|
|
69
80
|
if (!$path) return;
|
|
70
81
|
return {
|
|
71
|
-
translateX: getPathProgess($path, 'x'),
|
|
72
|
-
translateY: getPathProgess($path, 'y'),
|
|
73
|
-
rotate: getPathProgess($path, 'a'),
|
|
82
|
+
translateX: getPathProgess($path, 'x', offset),
|
|
83
|
+
translateY: getPathProgess($path, 'y', offset),
|
|
84
|
+
rotate: getPathProgess($path, 'a', offset),
|
|
74
85
|
}
|
|
75
86
|
};
|
|
76
87
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Anime.js - timeline - CJS
|
|
3
|
-
* @version v4.2.
|
|
3
|
+
* @version v4.2.2
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2025 - Julian Garnier
|
|
6
6
|
*/
|
|
@@ -81,7 +81,7 @@ function addTlChild(childParams, tl, timePosition, targets, index, length) {
|
|
|
81
81
|
const tlChild = targets ?
|
|
82
82
|
new animation.JSAnimation(targets,/** @type {AnimationParams} */(childParams), tl, adjustedPosition, false, index, length) :
|
|
83
83
|
new timer.Timer(/** @type {TimerParams} */(childParams), tl, adjustedPosition);
|
|
84
|
-
tlChild.init(
|
|
84
|
+
tlChild.init(true);
|
|
85
85
|
// TODO: Might be better to insert at a position relative to startTime?
|
|
86
86
|
helpers.addChild(tl, tlChild);
|
|
87
87
|
helpers.forEachChildren(tl, (/** @type {Renderable} */child) => {
|
|
@@ -185,7 +185,7 @@ class Timeline extends timer.Timer {
|
|
|
185
185
|
position.parseTimelinePosition(this,a2),
|
|
186
186
|
);
|
|
187
187
|
}
|
|
188
|
-
return this.init(
|
|
188
|
+
return this.init(true);
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
191
|
|
|
@@ -294,8 +294,12 @@ class Timeline extends timer.Timer {
|
|
|
294
294
|
}
|
|
295
295
|
|
|
296
296
|
/**
|
|
297
|
-
* @
|
|
298
|
-
|
|
297
|
+
* @typedef {this & {then: null}} ResolvedTimeline
|
|
298
|
+
*/
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* @param {Callback<ResolvedTimeline>} [callback]
|
|
302
|
+
* @return Promise<this>
|
|
299
303
|
*/
|
|
300
304
|
then(callback) {
|
|
301
305
|
return super.then(callback);
|
|
@@ -144,10 +144,15 @@ export class Timeline extends Timer {
|
|
|
144
144
|
*/
|
|
145
145
|
revert(): this;
|
|
146
146
|
/**
|
|
147
|
-
* @
|
|
148
|
-
* @return {Promise}
|
|
147
|
+
* @typedef {this & {then: null}} ResolvedTimeline
|
|
149
148
|
*/
|
|
150
|
-
|
|
149
|
+
/**
|
|
150
|
+
* @param {Callback<ResolvedTimeline>} [callback]
|
|
151
|
+
* @return Promise<this>
|
|
152
|
+
*/
|
|
153
|
+
then(callback?: Callback<this & {
|
|
154
|
+
then: null;
|
|
155
|
+
}>): Promise<any>;
|
|
151
156
|
}
|
|
152
157
|
export function createTimeline(parameters?: TimelineParams): Timeline;
|
|
153
158
|
import { Timer } from '../timer/timer.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Anime.js - timeline - ESM
|
|
3
|
-
* @version v4.2.
|
|
3
|
+
* @version v4.2.2
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2025 - Julian Garnier
|
|
6
6
|
*/
|
|
@@ -79,7 +79,7 @@ function addTlChild(childParams, tl, timePosition, targets, index, length) {
|
|
|
79
79
|
const tlChild = targets ?
|
|
80
80
|
new JSAnimation(targets,/** @type {AnimationParams} */(childParams), tl, adjustedPosition, false, index, length) :
|
|
81
81
|
new Timer(/** @type {TimerParams} */(childParams), tl, adjustedPosition);
|
|
82
|
-
tlChild.init(
|
|
82
|
+
tlChild.init(true);
|
|
83
83
|
// TODO: Might be better to insert at a position relative to startTime?
|
|
84
84
|
addChild(tl, tlChild);
|
|
85
85
|
forEachChildren(tl, (/** @type {Renderable} */child) => {
|
|
@@ -183,7 +183,7 @@ class Timeline extends Timer {
|
|
|
183
183
|
parseTimelinePosition(this,a2),
|
|
184
184
|
);
|
|
185
185
|
}
|
|
186
|
-
return this.init(
|
|
186
|
+
return this.init(true);
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
|
|
@@ -292,8 +292,12 @@ class Timeline extends Timer {
|
|
|
292
292
|
}
|
|
293
293
|
|
|
294
294
|
/**
|
|
295
|
-
* @
|
|
296
|
-
|
|
295
|
+
* @typedef {this & {then: null}} ResolvedTimeline
|
|
296
|
+
*/
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* @param {Callback<ResolvedTimeline>} [callback]
|
|
300
|
+
* @return Promise<this>
|
|
297
301
|
*/
|
|
298
302
|
then(callback) {
|
|
299
303
|
return super.then(callback);
|