animejs 4.1.4 → 4.2.0
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 +17 -8
- package/{lib → dist/bundles}/anime.esm.js +6476 -6106
- package/dist/bundles/anime.esm.min.js +7 -0
- package/dist/bundles/anime.umd.js +8809 -0
- package/dist/bundles/anime.umd.min.js +7 -0
- package/dist/modules/animatable/animatable.cjs +150 -0
- package/dist/modules/animatable/animatable.d.ts +28 -0
- package/dist/modules/animatable/animatable.js +147 -0
- package/dist/modules/animatable/index.cjs +15 -0
- package/dist/modules/animatable/index.d.ts +1 -0
- package/dist/modules/animatable/index.js +8 -0
- package/dist/modules/animation/additive.cjs +82 -0
- package/dist/modules/animation/additive.d.ts +15 -0
- package/dist/modules/animation/additive.js +79 -0
- package/dist/modules/animation/animation.cjs +667 -0
- package/dist/modules/animation/animation.d.ts +45 -0
- package/dist/modules/animation/animation.js +664 -0
- package/dist/modules/animation/composition.cjs +383 -0
- package/dist/modules/animation/composition.d.ts +10 -0
- package/dist/modules/animation/composition.js +377 -0
- package/dist/modules/animation/index.cjs +15 -0
- package/dist/modules/animation/index.d.ts +1 -0
- package/dist/modules/animation/index.js +8 -0
- package/dist/modules/core/clock.cjs +110 -0
- package/dist/modules/core/clock.d.ts +51 -0
- package/dist/modules/core/clock.js +108 -0
- package/dist/modules/core/colors.cjs +102 -0
- package/dist/modules/core/colors.d.ts +2 -0
- package/dist/modules/core/colors.js +100 -0
- package/dist/modules/core/consts.cjs +159 -0
- package/dist/modules/core/consts.d.ts +61 -0
- package/dist/modules/core/consts.js +124 -0
- package/dist/modules/core/globals.cjs +78 -0
- package/dist/modules/core/globals.d.ts +29 -0
- package/dist/modules/core/globals.js +73 -0
- package/dist/modules/core/helpers.cjs +304 -0
- package/dist/modules/core/helpers.d.ts +43 -0
- package/dist/modules/core/helpers.js +261 -0
- package/dist/modules/core/render.cjs +391 -0
- package/dist/modules/core/render.d.ts +4 -0
- package/dist/modules/core/render.js +388 -0
- package/dist/modules/core/styles.cjs +116 -0
- package/dist/modules/core/styles.d.ts +5 -0
- package/dist/modules/core/styles.js +113 -0
- package/dist/modules/core/targets.cjs +136 -0
- package/dist/modules/core/targets.d.ts +118 -0
- package/dist/modules/core/targets.js +132 -0
- package/dist/modules/core/transforms.cjs +49 -0
- package/dist/modules/core/transforms.d.ts +2 -0
- package/dist/modules/core/transforms.js +47 -0
- package/dist/modules/core/units.cjs +67 -0
- package/dist/modules/core/units.d.ts +3 -0
- package/dist/modules/core/units.js +65 -0
- package/dist/modules/core/values.cjs +226 -0
- package/dist/modules/core/values.d.ts +14 -0
- package/dist/modules/core/values.js +216 -0
- package/dist/modules/draggable/draggable.cjs +1226 -0
- package/dist/modules/draggable/draggable.d.ts +272 -0
- package/dist/modules/draggable/draggable.js +1223 -0
- package/dist/modules/draggable/index.cjs +15 -0
- package/dist/modules/draggable/index.d.ts +1 -0
- package/dist/modules/draggable/index.js +8 -0
- package/dist/modules/easings/cubic-bezier/index.cjs +64 -0
- package/dist/modules/easings/cubic-bezier/index.d.ts +2 -0
- package/dist/modules/easings/cubic-bezier/index.js +62 -0
- package/dist/modules/easings/eases/index.cjs +14 -0
- package/dist/modules/easings/eases/index.d.ts +1 -0
- package/dist/modules/easings/eases/index.js +8 -0
- package/dist/modules/easings/eases/parser.cjs +191 -0
- package/dist/modules/easings/eases/parser.d.ts +125 -0
- package/dist/modules/easings/eases/parser.js +185 -0
- package/dist/modules/easings/index.cjs +26 -0
- package/dist/modules/easings/index.d.ts +6 -0
- package/dist/modules/easings/index.js +13 -0
- package/dist/modules/easings/irregular/index.cjs +41 -0
- package/dist/modules/easings/irregular/index.d.ts +2 -0
- package/dist/modules/easings/irregular/index.js +39 -0
- package/dist/modules/easings/linear/index.cjs +59 -0
- package/dist/modules/easings/linear/index.d.ts +2 -0
- package/dist/modules/easings/linear/index.js +57 -0
- package/dist/modules/easings/none.cjs +19 -0
- package/dist/modules/easings/none.d.ts +8 -0
- package/dist/modules/easings/none.js +17 -0
- package/dist/modules/easings/spring/index.cjs +255 -0
- package/dist/modules/easings/spring/index.d.ts +53 -0
- package/dist/modules/easings/spring/index.js +251 -0
- package/dist/modules/easings/steps/index.cjs +30 -0
- package/dist/modules/easings/steps/index.d.ts +2 -0
- package/dist/modules/easings/steps/index.js +28 -0
- package/dist/modules/engine/engine.cjs +168 -0
- package/dist/modules/engine/engine.d.ts +21 -0
- package/dist/modules/engine/engine.js +166 -0
- package/dist/modules/engine/index.cjs +14 -0
- package/dist/modules/engine/index.d.ts +1 -0
- package/dist/modules/engine/index.js +8 -0
- package/dist/modules/events/index.cjs +16 -0
- package/dist/modules/events/index.d.ts +1 -0
- package/dist/modules/events/index.js +8 -0
- package/dist/modules/events/scroll.cjs +940 -0
- package/dist/modules/events/scroll.d.ts +191 -0
- package/dist/modules/events/scroll.js +936 -0
- package/dist/modules/index.cjs +102 -0
- package/dist/modules/index.d.ts +18 -0
- package/dist/modules/index.js +41 -0
- package/dist/modules/scope/index.cjs +15 -0
- package/dist/modules/scope/index.d.ts +1 -0
- package/dist/modules/scope/index.js +8 -0
- package/dist/modules/scope/scope.cjs +254 -0
- package/dist/modules/scope/scope.d.ts +115 -0
- package/dist/modules/scope/scope.js +251 -0
- package/dist/modules/svg/drawable.cjs +119 -0
- package/dist/modules/svg/drawable.d.ts +3 -0
- package/dist/modules/svg/drawable.js +117 -0
- package/dist/modules/svg/helpers.cjs +30 -0
- package/dist/modules/svg/helpers.d.ts +2 -0
- package/dist/modules/svg/helpers.js +28 -0
- package/dist/modules/svg/index.cjs +18 -0
- package/dist/modules/svg/index.d.ts +3 -0
- package/dist/modules/svg/index.js +10 -0
- package/dist/modules/svg/morphto.cjs +58 -0
- package/dist/modules/svg/morphto.d.ts +3 -0
- package/dist/modules/svg/morphto.js +56 -0
- package/dist/modules/svg/motionpath.cjs +79 -0
- package/dist/modules/svg/motionpath.d.ts +7 -0
- package/dist/modules/svg/motionpath.js +77 -0
- package/dist/modules/text/index.cjs +16 -0
- package/dist/modules/text/index.d.ts +1 -0
- package/dist/modules/text/index.js +8 -0
- package/dist/modules/text/split.cjs +488 -0
- package/dist/modules/text/split.d.ts +62 -0
- package/dist/modules/text/split.js +484 -0
- package/dist/modules/timeline/index.cjs +15 -0
- package/dist/modules/timeline/index.d.ts +1 -0
- package/dist/modules/timeline/index.js +8 -0
- package/dist/modules/timeline/position.cjs +72 -0
- package/dist/modules/timeline/position.d.ts +3 -0
- package/dist/modules/timeline/position.js +70 -0
- package/dist/modules/timeline/timeline.cjs +312 -0
- package/dist/modules/timeline/timeline.d.ts +163 -0
- package/dist/modules/timeline/timeline.js +309 -0
- package/dist/modules/timer/index.cjs +15 -0
- package/dist/modules/timer/index.d.ts +1 -0
- package/dist/modules/timer/index.js +8 -0
- package/dist/modules/timer/timer.cjs +491 -0
- package/dist/modules/timer/timer.d.ts +141 -0
- package/dist/modules/timer/timer.js +488 -0
- package/dist/modules/types/index.d.ts +404 -0
- package/dist/modules/utils/chainable.cjs +190 -0
- package/dist/modules/utils/chainable.d.ts +135 -0
- package/dist/modules/utils/chainable.js +177 -0
- package/dist/modules/utils/index.cjs +43 -0
- package/dist/modules/utils/index.d.ts +5 -0
- package/dist/modules/utils/index.js +14 -0
- package/dist/modules/utils/number.cjs +97 -0
- package/dist/modules/utils/number.d.ts +9 -0
- package/dist/modules/utils/number.js +85 -0
- package/dist/modules/utils/random.cjs +77 -0
- package/dist/modules/utils/random.d.ts +22 -0
- package/dist/modules/utils/random.js +72 -0
- package/dist/modules/utils/stagger.cjs +122 -0
- package/dist/modules/utils/stagger.d.ts +30 -0
- package/dist/modules/utils/stagger.js +120 -0
- package/dist/modules/utils/target.cjs +130 -0
- package/dist/modules/utils/target.d.ts +126 -0
- package/dist/modules/utils/target.js +125 -0
- package/dist/modules/utils/time.cjs +57 -0
- package/dist/modules/utils/time.d.ts +5 -0
- package/dist/modules/utils/time.js +54 -0
- package/dist/modules/waapi/composition.cjs +95 -0
- package/dist/modules/waapi/composition.d.ts +4 -0
- package/dist/modules/waapi/composition.js +92 -0
- package/dist/modules/waapi/index.cjs +15 -0
- package/dist/modules/waapi/index.d.ts +1 -0
- package/dist/modules/waapi/index.js +8 -0
- package/dist/modules/waapi/waapi.cjs +492 -0
- package/dist/modules/waapi/waapi.d.ts +116 -0
- package/dist/modules/waapi/waapi.js +489 -0
- package/package.json +166 -33
- package/lib/anime.cjs +0 -9
- package/lib/anime.esm.min.js +0 -9
- package/lib/anime.iife.js +0 -9
- package/lib/anime.iife.min.js +0 -9
- package/lib/anime.min.cjs +0 -9
- package/lib/anime.umd.js +0 -9
- package/lib/anime.umd.min.js +0 -9
- package/lib/gui/index.js +0 -6341
- package/types/index.d.ts +0 -1127
- package/types/index.js +0 -7395
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Anime.js - animation - CJS
|
|
3
|
+
* @version v4.2.0
|
|
4
|
+
* @license MIT
|
|
5
|
+
* @copyright 2025 - Julian Garnier
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
'use strict';
|
|
9
|
+
|
|
10
|
+
var consts = require('../core/consts.cjs');
|
|
11
|
+
var helpers = require('../core/helpers.cjs');
|
|
12
|
+
var render = require('../core/render.cjs');
|
|
13
|
+
|
|
14
|
+
const additive = {
|
|
15
|
+
animation: null,
|
|
16
|
+
update: consts.noop,
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @import {
|
|
21
|
+
* Tween,
|
|
22
|
+
* TweenAdditiveLookups,
|
|
23
|
+
* } from '../types/index.js'
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @typedef AdditiveAnimation
|
|
28
|
+
* @property {Number} duration
|
|
29
|
+
* @property {Number} _offset
|
|
30
|
+
* @property {Number} _delay
|
|
31
|
+
* @property {Tween} _head
|
|
32
|
+
* @property {Tween} _tail
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @param {TweenAdditiveLookups} lookups
|
|
37
|
+
* @return {AdditiveAnimation}
|
|
38
|
+
*/
|
|
39
|
+
const addAdditiveAnimation = lookups => {
|
|
40
|
+
let animation = additive.animation;
|
|
41
|
+
if (!animation) {
|
|
42
|
+
animation = {
|
|
43
|
+
duration: consts.minValue,
|
|
44
|
+
computeDeltaTime: consts.noop,
|
|
45
|
+
_offset: 0,
|
|
46
|
+
_delay: 0,
|
|
47
|
+
_head: null,
|
|
48
|
+
_tail: null,
|
|
49
|
+
};
|
|
50
|
+
additive.animation = animation;
|
|
51
|
+
additive.update = () => {
|
|
52
|
+
lookups.forEach(propertyAnimation => {
|
|
53
|
+
for (let propertyName in propertyAnimation) {
|
|
54
|
+
const tweens = propertyAnimation[propertyName];
|
|
55
|
+
const lookupTween = tweens._head;
|
|
56
|
+
if (lookupTween) {
|
|
57
|
+
const valueType = lookupTween._valueType;
|
|
58
|
+
const additiveValues = valueType === consts.valueTypes.COMPLEX || valueType === consts.valueTypes.COLOR ? helpers.cloneArray(lookupTween._fromNumbers) : null;
|
|
59
|
+
let additiveValue = lookupTween._fromNumber;
|
|
60
|
+
let tween = tweens._tail;
|
|
61
|
+
while (tween && tween !== lookupTween) {
|
|
62
|
+
if (additiveValues) {
|
|
63
|
+
for (let i = 0, l = tween._numbers.length; i < l; i++) additiveValues[i] += tween._numbers[i];
|
|
64
|
+
} else {
|
|
65
|
+
additiveValue += tween._number;
|
|
66
|
+
}
|
|
67
|
+
tween = tween._prevAdd;
|
|
68
|
+
}
|
|
69
|
+
lookupTween._toNumber = additiveValue;
|
|
70
|
+
lookupTween._toNumbers = additiveValues;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
// TODO: Avoid polymorphism here, idealy the additive animation should be a regular animation with a higher priority in the render loop
|
|
75
|
+
render.render(animation, 1, 1, 0, consts.tickModes.FORCE);
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
return animation;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
exports.addAdditiveAnimation = addAdditiveAnimation;
|
|
82
|
+
exports.additive = additive;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export namespace additive {
|
|
2
|
+
export let animation: any;
|
|
3
|
+
export { noop as update };
|
|
4
|
+
}
|
|
5
|
+
export function addAdditiveAnimation(lookups: TweenAdditiveLookups): AdditiveAnimation;
|
|
6
|
+
export type AdditiveAnimation = {
|
|
7
|
+
duration: number;
|
|
8
|
+
_offset: number;
|
|
9
|
+
_delay: number;
|
|
10
|
+
_head: Tween;
|
|
11
|
+
_tail: Tween;
|
|
12
|
+
};
|
|
13
|
+
import { noop } from '../core/consts.js';
|
|
14
|
+
import type { TweenAdditiveLookups } from '../types/index.js';
|
|
15
|
+
import type { Tween } from '../types/index.js';
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Anime.js - animation - ESM
|
|
3
|
+
* @version v4.2.0
|
|
4
|
+
* @license MIT
|
|
5
|
+
* @copyright 2025 - Julian Garnier
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { noop, minValue, valueTypes, tickModes } from '../core/consts.js';
|
|
9
|
+
import { cloneArray } from '../core/helpers.js';
|
|
10
|
+
import { render } from '../core/render.js';
|
|
11
|
+
|
|
12
|
+
const additive = {
|
|
13
|
+
animation: null,
|
|
14
|
+
update: noop,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @import {
|
|
19
|
+
* Tween,
|
|
20
|
+
* TweenAdditiveLookups,
|
|
21
|
+
* } from '../types/index.js'
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @typedef AdditiveAnimation
|
|
26
|
+
* @property {Number} duration
|
|
27
|
+
* @property {Number} _offset
|
|
28
|
+
* @property {Number} _delay
|
|
29
|
+
* @property {Tween} _head
|
|
30
|
+
* @property {Tween} _tail
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @param {TweenAdditiveLookups} lookups
|
|
35
|
+
* @return {AdditiveAnimation}
|
|
36
|
+
*/
|
|
37
|
+
const addAdditiveAnimation = lookups => {
|
|
38
|
+
let animation = additive.animation;
|
|
39
|
+
if (!animation) {
|
|
40
|
+
animation = {
|
|
41
|
+
duration: minValue,
|
|
42
|
+
computeDeltaTime: noop,
|
|
43
|
+
_offset: 0,
|
|
44
|
+
_delay: 0,
|
|
45
|
+
_head: null,
|
|
46
|
+
_tail: null,
|
|
47
|
+
};
|
|
48
|
+
additive.animation = animation;
|
|
49
|
+
additive.update = () => {
|
|
50
|
+
lookups.forEach(propertyAnimation => {
|
|
51
|
+
for (let propertyName in propertyAnimation) {
|
|
52
|
+
const tweens = propertyAnimation[propertyName];
|
|
53
|
+
const lookupTween = tweens._head;
|
|
54
|
+
if (lookupTween) {
|
|
55
|
+
const valueType = lookupTween._valueType;
|
|
56
|
+
const additiveValues = valueType === valueTypes.COMPLEX || valueType === valueTypes.COLOR ? cloneArray(lookupTween._fromNumbers) : null;
|
|
57
|
+
let additiveValue = lookupTween._fromNumber;
|
|
58
|
+
let tween = tweens._tail;
|
|
59
|
+
while (tween && tween !== lookupTween) {
|
|
60
|
+
if (additiveValues) {
|
|
61
|
+
for (let i = 0, l = tween._numbers.length; i < l; i++) additiveValues[i] += tween._numbers[i];
|
|
62
|
+
} else {
|
|
63
|
+
additiveValue += tween._number;
|
|
64
|
+
}
|
|
65
|
+
tween = tween._prevAdd;
|
|
66
|
+
}
|
|
67
|
+
lookupTween._toNumber = additiveValue;
|
|
68
|
+
lookupTween._toNumbers = additiveValues;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
// TODO: Avoid polymorphism here, idealy the additive animation should be a regular animation with a higher priority in the render loop
|
|
73
|
+
render(animation, 1, 1, 0, tickModes.FORCE);
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
return animation;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export { addAdditiveAnimation, additive };
|