animejs 4.3.0-beta.2 → 4.3.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 +16 -17
- package/dist/bundles/anime.esm.js +446 -245
- package/dist/bundles/anime.esm.min.js +3 -3
- package/dist/bundles/anime.umd.js +446 -245
- package/dist/bundles/anime.umd.min.js +3 -3
- package/dist/modules/animatable/animatable.cjs +2 -2
- package/dist/modules/animatable/animatable.js +2 -2
- package/dist/modules/animatable/index.cjs +2 -2
- package/dist/modules/animatable/index.js +2 -2
- package/dist/modules/animation/additive.cjs +2 -2
- package/dist/modules/animation/additive.js +2 -2
- package/dist/modules/animation/animation.cjs +8 -5
- package/dist/modules/animation/animation.js +9 -6
- package/dist/modules/animation/composition.cjs +2 -2
- package/dist/modules/animation/composition.js +2 -2
- package/dist/modules/animation/index.cjs +2 -2
- package/dist/modules/animation/index.js +2 -2
- package/dist/modules/core/clock.cjs +2 -2
- package/dist/modules/core/clock.js +2 -2
- package/dist/modules/core/colors.cjs +2 -2
- package/dist/modules/core/colors.js +2 -2
- package/dist/modules/core/consts.cjs +2 -2
- package/dist/modules/core/consts.js +2 -2
- package/dist/modules/core/globals.cjs +3 -3
- package/dist/modules/core/globals.js +3 -3
- package/dist/modules/core/helpers.cjs +4 -4
- package/dist/modules/core/helpers.js +4 -4
- package/dist/modules/core/render.cjs +2 -2
- package/dist/modules/core/render.js +2 -2
- package/dist/modules/core/styles.cjs +2 -2
- package/dist/modules/core/styles.js +2 -2
- package/dist/modules/core/targets.cjs +2 -2
- package/dist/modules/core/targets.js +2 -2
- package/dist/modules/core/transforms.cjs +2 -2
- package/dist/modules/core/transforms.js +2 -2
- package/dist/modules/core/units.cjs +2 -2
- package/dist/modules/core/units.js +2 -2
- package/dist/modules/core/values.cjs +2 -2
- package/dist/modules/core/values.js +2 -2
- package/dist/modules/draggable/draggable.cjs +2 -2
- package/dist/modules/draggable/draggable.js +2 -2
- package/dist/modules/draggable/index.cjs +2 -2
- package/dist/modules/draggable/index.js +2 -2
- package/dist/modules/easings/cubic-bezier/index.cjs +2 -2
- package/dist/modules/easings/cubic-bezier/index.js +2 -2
- package/dist/modules/easings/eases/index.cjs +2 -2
- package/dist/modules/easings/eases/index.js +2 -2
- package/dist/modules/easings/eases/parser.cjs +2 -2
- package/dist/modules/easings/eases/parser.js +2 -2
- package/dist/modules/easings/index.cjs +2 -2
- package/dist/modules/easings/index.js +2 -2
- package/dist/modules/easings/irregular/index.cjs +2 -2
- package/dist/modules/easings/irregular/index.js +2 -2
- package/dist/modules/easings/linear/index.cjs +2 -2
- package/dist/modules/easings/linear/index.js +2 -2
- package/dist/modules/easings/none.cjs +2 -2
- package/dist/modules/easings/none.js +2 -2
- package/dist/modules/easings/spring/index.cjs +2 -2
- package/dist/modules/easings/spring/index.js +2 -2
- package/dist/modules/easings/steps/index.cjs +2 -2
- package/dist/modules/easings/steps/index.js +2 -2
- package/dist/modules/engine/engine.cjs +2 -2
- package/dist/modules/engine/engine.js +2 -2
- package/dist/modules/engine/index.cjs +2 -2
- package/dist/modules/engine/index.js +2 -2
- package/dist/modules/events/index.cjs +2 -2
- package/dist/modules/events/index.js +2 -2
- package/dist/modules/events/scroll.cjs +2 -2
- package/dist/modules/events/scroll.js +2 -2
- package/dist/modules/index.cjs +2 -2
- package/dist/modules/index.js +2 -2
- package/dist/modules/layout/index.cjs +2 -2
- package/dist/modules/layout/index.js +2 -2
- package/dist/modules/layout/layout.cjs +427 -228
- package/dist/modules/layout/layout.d.ts +44 -38
- package/dist/modules/layout/layout.js +429 -230
- package/dist/modules/scope/index.cjs +2 -2
- package/dist/modules/scope/index.js +2 -2
- package/dist/modules/scope/scope.cjs +2 -2
- package/dist/modules/scope/scope.js +2 -2
- package/dist/modules/svg/drawable.cjs +2 -2
- package/dist/modules/svg/drawable.js +2 -2
- package/dist/modules/svg/helpers.cjs +2 -2
- package/dist/modules/svg/helpers.js +2 -2
- package/dist/modules/svg/index.cjs +2 -2
- package/dist/modules/svg/index.js +2 -2
- package/dist/modules/svg/morphto.cjs +2 -2
- package/dist/modules/svg/morphto.js +2 -2
- package/dist/modules/svg/motionpath.cjs +2 -2
- package/dist/modules/svg/motionpath.js +2 -2
- package/dist/modules/text/index.cjs +2 -2
- package/dist/modules/text/index.js +2 -2
- package/dist/modules/text/split.cjs +2 -2
- package/dist/modules/text/split.js +2 -2
- package/dist/modules/timeline/index.cjs +2 -2
- package/dist/modules/timeline/index.js +2 -2
- package/dist/modules/timeline/position.cjs +2 -2
- package/dist/modules/timeline/position.js +2 -2
- package/dist/modules/timeline/timeline.cjs +2 -2
- package/dist/modules/timeline/timeline.js +2 -2
- package/dist/modules/timer/index.cjs +2 -2
- package/dist/modules/timer/index.js +2 -2
- package/dist/modules/timer/timer.cjs +5 -4
- package/dist/modules/timer/timer.d.ts +2 -1
- package/dist/modules/timer/timer.js +5 -4
- package/dist/modules/types/index.d.ts +6 -6
- package/dist/modules/utils/chainable.cjs +2 -2
- package/dist/modules/utils/chainable.js +2 -2
- package/dist/modules/utils/index.cjs +2 -2
- package/dist/modules/utils/index.js +2 -2
- package/dist/modules/utils/number.cjs +2 -2
- package/dist/modules/utils/number.js +2 -2
- package/dist/modules/utils/random.cjs +2 -2
- package/dist/modules/utils/random.js +2 -2
- package/dist/modules/utils/stagger.cjs +2 -2
- package/dist/modules/utils/stagger.js +2 -2
- package/dist/modules/utils/target.cjs +2 -2
- package/dist/modules/utils/target.js +2 -2
- package/dist/modules/utils/time.cjs +2 -2
- package/dist/modules/utils/time.js +2 -2
- package/dist/modules/waapi/composition.cjs +2 -2
- package/dist/modules/waapi/composition.js +2 -2
- package/dist/modules/waapi/index.cjs +2 -2
- package/dist/modules/waapi/index.js +2 -2
- package/dist/modules/waapi/waapi.cjs +12 -7
- package/dist/modules/waapi/waapi.js +12 -7
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Anime.js - waapi - CJS
|
|
3
|
-
* @version v4.3.0
|
|
3
|
+
* @version v4.3.0
|
|
4
4
|
* @license MIT
|
|
5
|
-
* @copyright
|
|
5
|
+
* @copyright 2026 - Julian Garnier
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
'use strict';
|
|
@@ -190,8 +190,6 @@ class WAAPIAnimation {
|
|
|
190
190
|
console.warn(`No target found. Make sure the element you're trying to animate is accessible before creating your animation.`);
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
-
const ease = values.setValue(params.ease, parseWAAPIEasing(globals.globals.defaults.ease));
|
|
194
|
-
const spring = /** @type {Spring} */(ease).ease && ease;
|
|
195
193
|
const autoplay = values.setValue(params.autoplay, globals.globals.defaults.autoplay);
|
|
196
194
|
const scroll = autoplay && /** @type {ScrollObserver} */(autoplay).link ? autoplay : false;
|
|
197
195
|
const alternate = params.alternate && /** @type {Boolean} */(params.alternate) === true;
|
|
@@ -202,8 +200,6 @@ class WAAPIAnimation {
|
|
|
202
200
|
const direction = alternate ? reversed ? 'alternate-reverse' : 'alternate' : reversed ? 'reverse' : 'normal';
|
|
203
201
|
/** @type {FillMode} */
|
|
204
202
|
const fill = 'both'; // We use 'both' here because the animation can be reversed during playback
|
|
205
|
-
/** @type {String} */
|
|
206
|
-
const easing = parseWAAPIEasing(ease);
|
|
207
203
|
const timeScale = (globals.globals.timeScale === 1 ? 1 : consts.K);
|
|
208
204
|
|
|
209
205
|
/** @type {DOMTargetsArray}] */
|
|
@@ -244,6 +240,15 @@ class WAAPIAnimation {
|
|
|
244
240
|
const elStyle = $el.style;
|
|
245
241
|
const inlineStyles = this._inlineStyles[i] = {};
|
|
246
242
|
|
|
243
|
+
const easeToParse = values.setValue(params.ease, globals.globals.defaults.ease);
|
|
244
|
+
|
|
245
|
+
const easeFunctionResult = values.getFunctionValue(easeToParse, $el, i, targetsLength);
|
|
246
|
+
const keyEasing = helpers.isFnc(easeFunctionResult) || helpers.isStr(easeFunctionResult) ? easeFunctionResult : easeToParse;
|
|
247
|
+
|
|
248
|
+
const spring = /** @type {Spring} */(easeToParse).ease && easeToParse;
|
|
249
|
+
/** @type {String} */
|
|
250
|
+
const easing = parseWAAPIEasing(keyEasing);
|
|
251
|
+
|
|
247
252
|
/** @type {Number} */
|
|
248
253
|
const duration = (spring ? /** @type {Spring} */(spring).settlingDuration : values.getFunctionValue(values.setValue(params.duration, globals.globals.defaults.duration), $el, i, targetsLength)) * timeScale;
|
|
249
254
|
/** @type {Number} */
|
|
@@ -268,7 +273,7 @@ class WAAPIAnimation {
|
|
|
268
273
|
let parsedPropertyValue;
|
|
269
274
|
if (helpers.isObj(propertyValue)) {
|
|
270
275
|
const tweenOptions = /** @type {WAAPITweenOptions} */(propertyValue);
|
|
271
|
-
const tweenOptionsEase = values.setValue(tweenOptions.ease,
|
|
276
|
+
const tweenOptionsEase = values.setValue(tweenOptions.ease, easing);
|
|
272
277
|
const tweenOptionsSpring = /** @type {Spring} */(tweenOptionsEase).ease && tweenOptionsEase;
|
|
273
278
|
const to = /** @type {WAAPITweenOptions} */(tweenOptions).to;
|
|
274
279
|
const from = /** @type {WAAPITweenOptions} */(tweenOptions).from;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Anime.js - waapi - ESM
|
|
3
|
-
* @version v4.3.0
|
|
3
|
+
* @version v4.3.0
|
|
4
4
|
* @license MIT
|
|
5
|
-
* @copyright
|
|
5
|
+
* @copyright 2026 - Julian Garnier
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { isNil, isUnd, stringStartsWith, isKey, isObj, isArr, isStr, toLowerCase, round, isFnc, isNum } from '../core/helpers.js';
|
|
@@ -188,8 +188,6 @@ class WAAPIAnimation {
|
|
|
188
188
|
console.warn(`No target found. Make sure the element you're trying to animate is accessible before creating your animation.`);
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
-
const ease = setValue(params.ease, parseWAAPIEasing(globals.defaults.ease));
|
|
192
|
-
const spring = /** @type {Spring} */(ease).ease && ease;
|
|
193
191
|
const autoplay = setValue(params.autoplay, globals.defaults.autoplay);
|
|
194
192
|
const scroll = autoplay && /** @type {ScrollObserver} */(autoplay).link ? autoplay : false;
|
|
195
193
|
const alternate = params.alternate && /** @type {Boolean} */(params.alternate) === true;
|
|
@@ -200,8 +198,6 @@ class WAAPIAnimation {
|
|
|
200
198
|
const direction = alternate ? reversed ? 'alternate-reverse' : 'alternate' : reversed ? 'reverse' : 'normal';
|
|
201
199
|
/** @type {FillMode} */
|
|
202
200
|
const fill = 'both'; // We use 'both' here because the animation can be reversed during playback
|
|
203
|
-
/** @type {String} */
|
|
204
|
-
const easing = parseWAAPIEasing(ease);
|
|
205
201
|
const timeScale = (globals.timeScale === 1 ? 1 : K);
|
|
206
202
|
|
|
207
203
|
/** @type {DOMTargetsArray}] */
|
|
@@ -242,6 +238,15 @@ class WAAPIAnimation {
|
|
|
242
238
|
const elStyle = $el.style;
|
|
243
239
|
const inlineStyles = this._inlineStyles[i] = {};
|
|
244
240
|
|
|
241
|
+
const easeToParse = setValue(params.ease, globals.defaults.ease);
|
|
242
|
+
|
|
243
|
+
const easeFunctionResult = getFunctionValue(easeToParse, $el, i, targetsLength);
|
|
244
|
+
const keyEasing = isFnc(easeFunctionResult) || isStr(easeFunctionResult) ? easeFunctionResult : easeToParse;
|
|
245
|
+
|
|
246
|
+
const spring = /** @type {Spring} */(easeToParse).ease && easeToParse;
|
|
247
|
+
/** @type {String} */
|
|
248
|
+
const easing = parseWAAPIEasing(keyEasing);
|
|
249
|
+
|
|
245
250
|
/** @type {Number} */
|
|
246
251
|
const duration = (spring ? /** @type {Spring} */(spring).settlingDuration : getFunctionValue(setValue(params.duration, globals.defaults.duration), $el, i, targetsLength)) * timeScale;
|
|
247
252
|
/** @type {Number} */
|
|
@@ -266,7 +271,7 @@ class WAAPIAnimation {
|
|
|
266
271
|
let parsedPropertyValue;
|
|
267
272
|
if (isObj(propertyValue)) {
|
|
268
273
|
const tweenOptions = /** @type {WAAPITweenOptions} */(propertyValue);
|
|
269
|
-
const tweenOptionsEase = setValue(tweenOptions.ease,
|
|
274
|
+
const tweenOptionsEase = setValue(tweenOptions.ease, easing);
|
|
270
275
|
const tweenOptionsSpring = /** @type {Spring} */(tweenOptionsEase).ease && tweenOptionsEase;
|
|
271
276
|
const to = /** @type {WAAPITweenOptions} */(tweenOptions).to;
|
|
272
277
|
const from = /** @type {WAAPITweenOptions} */(tweenOptions).from;
|