@t7blocks/ui 0.0.5 → 0.0.6
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/index.js +19 -4318
- package/dist/index.mjs +141 -4449
- package/package.json +7 -6
package/dist/index.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
"use strict";
|
|
3
|
+
var __create = Object.create;
|
|
2
4
|
var __defProp = Object.defineProperty;
|
|
3
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
9
|
var __export = (target, all) => {
|
|
7
10
|
for (var name in all)
|
|
@@ -15,6 +18,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
18
|
}
|
|
16
19
|
return to;
|
|
17
20
|
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
18
29
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
30
|
|
|
20
31
|
// src/index.ts
|
|
@@ -185,4295 +196,7 @@ function Dotlaunchbutton({
|
|
|
185
196
|
|
|
186
197
|
// src/hero/PopHero/PopHero.tsx
|
|
187
198
|
var import_react3 = require("react");
|
|
188
|
-
|
|
189
|
-
// ../../node_modules/.pnpm/gsap@3.14.2/node_modules/gsap/gsap-core.js
|
|
190
|
-
function _assertThisInitialized(self) {
|
|
191
|
-
if (self === void 0) {
|
|
192
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
193
|
-
}
|
|
194
|
-
return self;
|
|
195
|
-
}
|
|
196
|
-
function _inheritsLoose(subClass, superClass) {
|
|
197
|
-
subClass.prototype = Object.create(superClass.prototype);
|
|
198
|
-
subClass.prototype.constructor = subClass;
|
|
199
|
-
subClass.__proto__ = superClass;
|
|
200
|
-
}
|
|
201
|
-
var _config = {
|
|
202
|
-
autoSleep: 120,
|
|
203
|
-
force3D: "auto",
|
|
204
|
-
nullTargetWarn: 1,
|
|
205
|
-
units: {
|
|
206
|
-
lineHeight: ""
|
|
207
|
-
}
|
|
208
|
-
};
|
|
209
|
-
var _defaults = {
|
|
210
|
-
duration: 0.5,
|
|
211
|
-
overwrite: false,
|
|
212
|
-
delay: 0
|
|
213
|
-
};
|
|
214
|
-
var _suppressOverwrites;
|
|
215
|
-
var _reverting;
|
|
216
|
-
var _context;
|
|
217
|
-
var _bigNum = 1e8;
|
|
218
|
-
var _tinyNum = 1 / _bigNum;
|
|
219
|
-
var _2PI = Math.PI * 2;
|
|
220
|
-
var _HALF_PI = _2PI / 4;
|
|
221
|
-
var _gsID = 0;
|
|
222
|
-
var _sqrt = Math.sqrt;
|
|
223
|
-
var _cos = Math.cos;
|
|
224
|
-
var _sin = Math.sin;
|
|
225
|
-
var _isString = function _isString2(value) {
|
|
226
|
-
return typeof value === "string";
|
|
227
|
-
};
|
|
228
|
-
var _isFunction = function _isFunction2(value) {
|
|
229
|
-
return typeof value === "function";
|
|
230
|
-
};
|
|
231
|
-
var _isNumber = function _isNumber2(value) {
|
|
232
|
-
return typeof value === "number";
|
|
233
|
-
};
|
|
234
|
-
var _isUndefined = function _isUndefined2(value) {
|
|
235
|
-
return typeof value === "undefined";
|
|
236
|
-
};
|
|
237
|
-
var _isObject = function _isObject2(value) {
|
|
238
|
-
return typeof value === "object";
|
|
239
|
-
};
|
|
240
|
-
var _isNotFalse = function _isNotFalse2(value) {
|
|
241
|
-
return value !== false;
|
|
242
|
-
};
|
|
243
|
-
var _windowExists = function _windowExists2() {
|
|
244
|
-
return typeof window !== "undefined";
|
|
245
|
-
};
|
|
246
|
-
var _isFuncOrString = function _isFuncOrString2(value) {
|
|
247
|
-
return _isFunction(value) || _isString(value);
|
|
248
|
-
};
|
|
249
|
-
var _isTypedArray = typeof ArrayBuffer === "function" && ArrayBuffer.isView || function() {
|
|
250
|
-
};
|
|
251
|
-
var _isArray = Array.isArray;
|
|
252
|
-
var _randomExp = /random\([^)]+\)/g;
|
|
253
|
-
var _commaDelimExp = /,\s*/g;
|
|
254
|
-
var _strictNumExp = /(?:-?\.?\d|\.)+/gi;
|
|
255
|
-
var _numExp = /[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g;
|
|
256
|
-
var _numWithUnitExp = /[-+=.]*\d+[.e-]*\d*[a-z%]*/g;
|
|
257
|
-
var _complexStringNumExp = /[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi;
|
|
258
|
-
var _relExp = /[+-]=-?[.\d]+/;
|
|
259
|
-
var _delimitedValueExp = /[^,'"\[\]\s]+/gi;
|
|
260
|
-
var _unitExp = /^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i;
|
|
261
|
-
var _globalTimeline;
|
|
262
|
-
var _win;
|
|
263
|
-
var _coreInitted;
|
|
264
|
-
var _doc;
|
|
265
|
-
var _globals = {};
|
|
266
|
-
var _installScope = {};
|
|
267
|
-
var _coreReady;
|
|
268
|
-
var _install = function _install2(scope) {
|
|
269
|
-
return (_installScope = _merge(scope, _globals)) && gsap;
|
|
270
|
-
};
|
|
271
|
-
var _missingPlugin = function _missingPlugin2(property, value) {
|
|
272
|
-
return console.warn("Invalid property", property, "set to", value, "Missing plugin? gsap.registerPlugin()");
|
|
273
|
-
};
|
|
274
|
-
var _warn = function _warn2(message, suppress) {
|
|
275
|
-
return !suppress && console.warn(message);
|
|
276
|
-
};
|
|
277
|
-
var _addGlobal = function _addGlobal2(name, obj) {
|
|
278
|
-
return name && (_globals[name] = obj) && _installScope && (_installScope[name] = obj) || _globals;
|
|
279
|
-
};
|
|
280
|
-
var _emptyFunc = function _emptyFunc2() {
|
|
281
|
-
return 0;
|
|
282
|
-
};
|
|
283
|
-
var _startAtRevertConfig = {
|
|
284
|
-
suppressEvents: true,
|
|
285
|
-
isStart: true,
|
|
286
|
-
kill: false
|
|
287
|
-
};
|
|
288
|
-
var _revertConfigNoKill = {
|
|
289
|
-
suppressEvents: true,
|
|
290
|
-
kill: false
|
|
291
|
-
};
|
|
292
|
-
var _revertConfig = {
|
|
293
|
-
suppressEvents: true
|
|
294
|
-
};
|
|
295
|
-
var _reservedProps = {};
|
|
296
|
-
var _lazyTweens = [];
|
|
297
|
-
var _lazyLookup = {};
|
|
298
|
-
var _lastRenderedFrame;
|
|
299
|
-
var _plugins = {};
|
|
300
|
-
var _effects = {};
|
|
301
|
-
var _nextGCFrame = 30;
|
|
302
|
-
var _harnessPlugins = [];
|
|
303
|
-
var _callbackNames = "";
|
|
304
|
-
var _harness = function _harness2(targets) {
|
|
305
|
-
var target = targets[0], harnessPlugin, i;
|
|
306
|
-
_isObject(target) || _isFunction(target) || (targets = [targets]);
|
|
307
|
-
if (!(harnessPlugin = (target._gsap || {}).harness)) {
|
|
308
|
-
i = _harnessPlugins.length;
|
|
309
|
-
while (i-- && !_harnessPlugins[i].targetTest(target)) {
|
|
310
|
-
}
|
|
311
|
-
harnessPlugin = _harnessPlugins[i];
|
|
312
|
-
}
|
|
313
|
-
i = targets.length;
|
|
314
|
-
while (i--) {
|
|
315
|
-
targets[i] && (targets[i]._gsap || (targets[i]._gsap = new GSCache(targets[i], harnessPlugin))) || targets.splice(i, 1);
|
|
316
|
-
}
|
|
317
|
-
return targets;
|
|
318
|
-
};
|
|
319
|
-
var _getCache = function _getCache2(target) {
|
|
320
|
-
return target._gsap || _harness(toArray(target))[0]._gsap;
|
|
321
|
-
};
|
|
322
|
-
var _getProperty = function _getProperty2(target, property, v) {
|
|
323
|
-
return (v = target[property]) && _isFunction(v) ? target[property]() : _isUndefined(v) && target.getAttribute && target.getAttribute(property) || v;
|
|
324
|
-
};
|
|
325
|
-
var _forEachName = function _forEachName2(names, func) {
|
|
326
|
-
return (names = names.split(",")).forEach(func) || names;
|
|
327
|
-
};
|
|
328
|
-
var _round = function _round2(value) {
|
|
329
|
-
return Math.round(value * 1e5) / 1e5 || 0;
|
|
330
|
-
};
|
|
331
|
-
var _roundPrecise = function _roundPrecise2(value) {
|
|
332
|
-
return Math.round(value * 1e7) / 1e7 || 0;
|
|
333
|
-
};
|
|
334
|
-
var _parseRelative = function _parseRelative2(start, value) {
|
|
335
|
-
var operator = value.charAt(0), end = parseFloat(value.substr(2));
|
|
336
|
-
start = parseFloat(start);
|
|
337
|
-
return operator === "+" ? start + end : operator === "-" ? start - end : operator === "*" ? start * end : start / end;
|
|
338
|
-
};
|
|
339
|
-
var _arrayContainsAny = function _arrayContainsAny2(toSearch, toFind) {
|
|
340
|
-
var l = toFind.length, i = 0;
|
|
341
|
-
for (; toSearch.indexOf(toFind[i]) < 0 && ++i < l; ) {
|
|
342
|
-
}
|
|
343
|
-
return i < l;
|
|
344
|
-
};
|
|
345
|
-
var _lazyRender = function _lazyRender2() {
|
|
346
|
-
var l = _lazyTweens.length, a = _lazyTweens.slice(0), i, tween;
|
|
347
|
-
_lazyLookup = {};
|
|
348
|
-
_lazyTweens.length = 0;
|
|
349
|
-
for (i = 0; i < l; i++) {
|
|
350
|
-
tween = a[i];
|
|
351
|
-
tween && tween._lazy && (tween.render(tween._lazy[0], tween._lazy[1], true)._lazy = 0);
|
|
352
|
-
}
|
|
353
|
-
};
|
|
354
|
-
var _isRevertWorthy = function _isRevertWorthy2(animation) {
|
|
355
|
-
return !!(animation._initted || animation._startAt || animation.add);
|
|
356
|
-
};
|
|
357
|
-
var _lazySafeRender = function _lazySafeRender2(animation, time, suppressEvents, force) {
|
|
358
|
-
_lazyTweens.length && !_reverting && _lazyRender();
|
|
359
|
-
animation.render(time, suppressEvents, force || !!(_reverting && time < 0 && _isRevertWorthy(animation)));
|
|
360
|
-
_lazyTweens.length && !_reverting && _lazyRender();
|
|
361
|
-
};
|
|
362
|
-
var _numericIfPossible = function _numericIfPossible2(value) {
|
|
363
|
-
var n = parseFloat(value);
|
|
364
|
-
return (n || n === 0) && (value + "").match(_delimitedValueExp).length < 2 ? n : _isString(value) ? value.trim() : value;
|
|
365
|
-
};
|
|
366
|
-
var _passThrough = function _passThrough2(p) {
|
|
367
|
-
return p;
|
|
368
|
-
};
|
|
369
|
-
var _setDefaults = function _setDefaults2(obj, defaults2) {
|
|
370
|
-
for (var p in defaults2) {
|
|
371
|
-
p in obj || (obj[p] = defaults2[p]);
|
|
372
|
-
}
|
|
373
|
-
return obj;
|
|
374
|
-
};
|
|
375
|
-
var _setKeyframeDefaults = function _setKeyframeDefaults2(excludeDuration) {
|
|
376
|
-
return function(obj, defaults2) {
|
|
377
|
-
for (var p in defaults2) {
|
|
378
|
-
p in obj || p === "duration" && excludeDuration || p === "ease" || (obj[p] = defaults2[p]);
|
|
379
|
-
}
|
|
380
|
-
};
|
|
381
|
-
};
|
|
382
|
-
var _merge = function _merge2(base, toMerge) {
|
|
383
|
-
for (var p in toMerge) {
|
|
384
|
-
base[p] = toMerge[p];
|
|
385
|
-
}
|
|
386
|
-
return base;
|
|
387
|
-
};
|
|
388
|
-
var _mergeDeep = function _mergeDeep2(base, toMerge) {
|
|
389
|
-
for (var p in toMerge) {
|
|
390
|
-
p !== "__proto__" && p !== "constructor" && p !== "prototype" && (base[p] = _isObject(toMerge[p]) ? _mergeDeep2(base[p] || (base[p] = {}), toMerge[p]) : toMerge[p]);
|
|
391
|
-
}
|
|
392
|
-
return base;
|
|
393
|
-
};
|
|
394
|
-
var _copyExcluding = function _copyExcluding2(obj, excluding) {
|
|
395
|
-
var copy = {}, p;
|
|
396
|
-
for (p in obj) {
|
|
397
|
-
p in excluding || (copy[p] = obj[p]);
|
|
398
|
-
}
|
|
399
|
-
return copy;
|
|
400
|
-
};
|
|
401
|
-
var _inheritDefaults = function _inheritDefaults2(vars) {
|
|
402
|
-
var parent = vars.parent || _globalTimeline, func = vars.keyframes ? _setKeyframeDefaults(_isArray(vars.keyframes)) : _setDefaults;
|
|
403
|
-
if (_isNotFalse(vars.inherit)) {
|
|
404
|
-
while (parent) {
|
|
405
|
-
func(vars, parent.vars.defaults);
|
|
406
|
-
parent = parent.parent || parent._dp;
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
return vars;
|
|
410
|
-
};
|
|
411
|
-
var _arraysMatch = function _arraysMatch2(a1, a2) {
|
|
412
|
-
var i = a1.length, match = i === a2.length;
|
|
413
|
-
while (match && i-- && a1[i] === a2[i]) {
|
|
414
|
-
}
|
|
415
|
-
return i < 0;
|
|
416
|
-
};
|
|
417
|
-
var _addLinkedListItem = function _addLinkedListItem2(parent, child, firstProp, lastProp, sortBy) {
|
|
418
|
-
if (firstProp === void 0) {
|
|
419
|
-
firstProp = "_first";
|
|
420
|
-
}
|
|
421
|
-
if (lastProp === void 0) {
|
|
422
|
-
lastProp = "_last";
|
|
423
|
-
}
|
|
424
|
-
var prev = parent[lastProp], t;
|
|
425
|
-
if (sortBy) {
|
|
426
|
-
t = child[sortBy];
|
|
427
|
-
while (prev && prev[sortBy] > t) {
|
|
428
|
-
prev = prev._prev;
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
if (prev) {
|
|
432
|
-
child._next = prev._next;
|
|
433
|
-
prev._next = child;
|
|
434
|
-
} else {
|
|
435
|
-
child._next = parent[firstProp];
|
|
436
|
-
parent[firstProp] = child;
|
|
437
|
-
}
|
|
438
|
-
if (child._next) {
|
|
439
|
-
child._next._prev = child;
|
|
440
|
-
} else {
|
|
441
|
-
parent[lastProp] = child;
|
|
442
|
-
}
|
|
443
|
-
child._prev = prev;
|
|
444
|
-
child.parent = child._dp = parent;
|
|
445
|
-
return child;
|
|
446
|
-
};
|
|
447
|
-
var _removeLinkedListItem = function _removeLinkedListItem2(parent, child, firstProp, lastProp) {
|
|
448
|
-
if (firstProp === void 0) {
|
|
449
|
-
firstProp = "_first";
|
|
450
|
-
}
|
|
451
|
-
if (lastProp === void 0) {
|
|
452
|
-
lastProp = "_last";
|
|
453
|
-
}
|
|
454
|
-
var prev = child._prev, next = child._next;
|
|
455
|
-
if (prev) {
|
|
456
|
-
prev._next = next;
|
|
457
|
-
} else if (parent[firstProp] === child) {
|
|
458
|
-
parent[firstProp] = next;
|
|
459
|
-
}
|
|
460
|
-
if (next) {
|
|
461
|
-
next._prev = prev;
|
|
462
|
-
} else if (parent[lastProp] === child) {
|
|
463
|
-
parent[lastProp] = prev;
|
|
464
|
-
}
|
|
465
|
-
child._next = child._prev = child.parent = null;
|
|
466
|
-
};
|
|
467
|
-
var _removeFromParent = function _removeFromParent2(child, onlyIfParentHasAutoRemove) {
|
|
468
|
-
child.parent && (!onlyIfParentHasAutoRemove || child.parent.autoRemoveChildren) && child.parent.remove && child.parent.remove(child);
|
|
469
|
-
child._act = 0;
|
|
470
|
-
};
|
|
471
|
-
var _uncache = function _uncache2(animation, child) {
|
|
472
|
-
if (animation && (!child || child._end > animation._dur || child._start < 0)) {
|
|
473
|
-
var a = animation;
|
|
474
|
-
while (a) {
|
|
475
|
-
a._dirty = 1;
|
|
476
|
-
a = a.parent;
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
return animation;
|
|
480
|
-
};
|
|
481
|
-
var _recacheAncestors = function _recacheAncestors2(animation) {
|
|
482
|
-
var parent = animation.parent;
|
|
483
|
-
while (parent && parent.parent) {
|
|
484
|
-
parent._dirty = 1;
|
|
485
|
-
parent.totalDuration();
|
|
486
|
-
parent = parent.parent;
|
|
487
|
-
}
|
|
488
|
-
return animation;
|
|
489
|
-
};
|
|
490
|
-
var _rewindStartAt = function _rewindStartAt2(tween, totalTime, suppressEvents, force) {
|
|
491
|
-
return tween._startAt && (_reverting ? tween._startAt.revert(_revertConfigNoKill) : tween.vars.immediateRender && !tween.vars.autoRevert || tween._startAt.render(totalTime, true, force));
|
|
492
|
-
};
|
|
493
|
-
var _hasNoPausedAncestors = function _hasNoPausedAncestors2(animation) {
|
|
494
|
-
return !animation || animation._ts && _hasNoPausedAncestors2(animation.parent);
|
|
495
|
-
};
|
|
496
|
-
var _elapsedCycleDuration = function _elapsedCycleDuration2(animation) {
|
|
497
|
-
return animation._repeat ? _animationCycle(animation._tTime, animation = animation.duration() + animation._rDelay) * animation : 0;
|
|
498
|
-
};
|
|
499
|
-
var _animationCycle = function _animationCycle2(tTime, cycleDuration) {
|
|
500
|
-
var whole = Math.floor(tTime = _roundPrecise(tTime / cycleDuration));
|
|
501
|
-
return tTime && whole === tTime ? whole - 1 : whole;
|
|
502
|
-
};
|
|
503
|
-
var _parentToChildTotalTime = function _parentToChildTotalTime2(parentTime, child) {
|
|
504
|
-
return (parentTime - child._start) * child._ts + (child._ts >= 0 ? 0 : child._dirty ? child.totalDuration() : child._tDur);
|
|
505
|
-
};
|
|
506
|
-
var _setEnd = function _setEnd2(animation) {
|
|
507
|
-
return animation._end = _roundPrecise(animation._start + (animation._tDur / Math.abs(animation._ts || animation._rts || _tinyNum) || 0));
|
|
508
|
-
};
|
|
509
|
-
var _alignPlayhead = function _alignPlayhead2(animation, totalTime) {
|
|
510
|
-
var parent = animation._dp;
|
|
511
|
-
if (parent && parent.smoothChildTiming && animation._ts) {
|
|
512
|
-
animation._start = _roundPrecise(parent._time - (animation._ts > 0 ? totalTime / animation._ts : ((animation._dirty ? animation.totalDuration() : animation._tDur) - totalTime) / -animation._ts));
|
|
513
|
-
_setEnd(animation);
|
|
514
|
-
parent._dirty || _uncache(parent, animation);
|
|
515
|
-
}
|
|
516
|
-
return animation;
|
|
517
|
-
};
|
|
518
|
-
var _postAddChecks = function _postAddChecks2(timeline2, child) {
|
|
519
|
-
var t;
|
|
520
|
-
if (child._time || !child._dur && child._initted || child._start < timeline2._time && (child._dur || !child.add)) {
|
|
521
|
-
t = _parentToChildTotalTime(timeline2.rawTime(), child);
|
|
522
|
-
if (!child._dur || _clamp(0, child.totalDuration(), t) - child._tTime > _tinyNum) {
|
|
523
|
-
child.render(t, true);
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
if (_uncache(timeline2, child)._dp && timeline2._initted && timeline2._time >= timeline2._dur && timeline2._ts) {
|
|
527
|
-
if (timeline2._dur < timeline2.duration()) {
|
|
528
|
-
t = timeline2;
|
|
529
|
-
while (t._dp) {
|
|
530
|
-
t.rawTime() >= 0 && t.totalTime(t._tTime);
|
|
531
|
-
t = t._dp;
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
timeline2._zTime = -_tinyNum;
|
|
535
|
-
}
|
|
536
|
-
};
|
|
537
|
-
var _addToTimeline = function _addToTimeline2(timeline2, child, position, skipChecks) {
|
|
538
|
-
child.parent && _removeFromParent(child);
|
|
539
|
-
child._start = _roundPrecise((_isNumber(position) ? position : position || timeline2 !== _globalTimeline ? _parsePosition(timeline2, position, child) : timeline2._time) + child._delay);
|
|
540
|
-
child._end = _roundPrecise(child._start + (child.totalDuration() / Math.abs(child.timeScale()) || 0));
|
|
541
|
-
_addLinkedListItem(timeline2, child, "_first", "_last", timeline2._sort ? "_start" : 0);
|
|
542
|
-
_isFromOrFromStart(child) || (timeline2._recent = child);
|
|
543
|
-
skipChecks || _postAddChecks(timeline2, child);
|
|
544
|
-
timeline2._ts < 0 && _alignPlayhead(timeline2, timeline2._tTime);
|
|
545
|
-
return timeline2;
|
|
546
|
-
};
|
|
547
|
-
var _scrollTrigger = function _scrollTrigger2(animation, trigger) {
|
|
548
|
-
return (_globals.ScrollTrigger || _missingPlugin("scrollTrigger", trigger)) && _globals.ScrollTrigger.create(trigger, animation);
|
|
549
|
-
};
|
|
550
|
-
var _attemptInitTween = function _attemptInitTween2(tween, time, force, suppressEvents, tTime) {
|
|
551
|
-
_initTween(tween, time, tTime);
|
|
552
|
-
if (!tween._initted) {
|
|
553
|
-
return 1;
|
|
554
|
-
}
|
|
555
|
-
if (!force && tween._pt && !_reverting && (tween._dur && tween.vars.lazy !== false || !tween._dur && tween.vars.lazy) && _lastRenderedFrame !== _ticker.frame) {
|
|
556
|
-
_lazyTweens.push(tween);
|
|
557
|
-
tween._lazy = [tTime, suppressEvents];
|
|
558
|
-
return 1;
|
|
559
|
-
}
|
|
560
|
-
};
|
|
561
|
-
var _parentPlayheadIsBeforeStart = function _parentPlayheadIsBeforeStart2(_ref) {
|
|
562
|
-
var parent = _ref.parent;
|
|
563
|
-
return parent && parent._ts && parent._initted && !parent._lock && (parent.rawTime() < 0 || _parentPlayheadIsBeforeStart2(parent));
|
|
564
|
-
};
|
|
565
|
-
var _isFromOrFromStart = function _isFromOrFromStart2(_ref2) {
|
|
566
|
-
var data = _ref2.data;
|
|
567
|
-
return data === "isFromStart" || data === "isStart";
|
|
568
|
-
};
|
|
569
|
-
var _renderZeroDurationTween = function _renderZeroDurationTween2(tween, totalTime, suppressEvents, force) {
|
|
570
|
-
var prevRatio = tween.ratio, ratio = totalTime < 0 || !totalTime && (!tween._start && _parentPlayheadIsBeforeStart(tween) && !(!tween._initted && _isFromOrFromStart(tween)) || (tween._ts < 0 || tween._dp._ts < 0) && !_isFromOrFromStart(tween)) ? 0 : 1, repeatDelay = tween._rDelay, tTime = 0, pt, iteration, prevIteration;
|
|
571
|
-
if (repeatDelay && tween._repeat) {
|
|
572
|
-
tTime = _clamp(0, tween._tDur, totalTime);
|
|
573
|
-
iteration = _animationCycle(tTime, repeatDelay);
|
|
574
|
-
tween._yoyo && iteration & 1 && (ratio = 1 - ratio);
|
|
575
|
-
if (iteration !== _animationCycle(tween._tTime, repeatDelay)) {
|
|
576
|
-
prevRatio = 1 - ratio;
|
|
577
|
-
tween.vars.repeatRefresh && tween._initted && tween.invalidate();
|
|
578
|
-
}
|
|
579
|
-
}
|
|
580
|
-
if (ratio !== prevRatio || _reverting || force || tween._zTime === _tinyNum || !totalTime && tween._zTime) {
|
|
581
|
-
if (!tween._initted && _attemptInitTween(tween, totalTime, force, suppressEvents, tTime)) {
|
|
582
|
-
return;
|
|
583
|
-
}
|
|
584
|
-
prevIteration = tween._zTime;
|
|
585
|
-
tween._zTime = totalTime || (suppressEvents ? _tinyNum : 0);
|
|
586
|
-
suppressEvents || (suppressEvents = totalTime && !prevIteration);
|
|
587
|
-
tween.ratio = ratio;
|
|
588
|
-
tween._from && (ratio = 1 - ratio);
|
|
589
|
-
tween._time = 0;
|
|
590
|
-
tween._tTime = tTime;
|
|
591
|
-
pt = tween._pt;
|
|
592
|
-
while (pt) {
|
|
593
|
-
pt.r(ratio, pt.d);
|
|
594
|
-
pt = pt._next;
|
|
595
|
-
}
|
|
596
|
-
totalTime < 0 && _rewindStartAt(tween, totalTime, suppressEvents, true);
|
|
597
|
-
tween._onUpdate && !suppressEvents && _callback(tween, "onUpdate");
|
|
598
|
-
tTime && tween._repeat && !suppressEvents && tween.parent && _callback(tween, "onRepeat");
|
|
599
|
-
if ((totalTime >= tween._tDur || totalTime < 0) && tween.ratio === ratio) {
|
|
600
|
-
ratio && _removeFromParent(tween, 1);
|
|
601
|
-
if (!suppressEvents && !_reverting) {
|
|
602
|
-
_callback(tween, ratio ? "onComplete" : "onReverseComplete", true);
|
|
603
|
-
tween._prom && tween._prom();
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
} else if (!tween._zTime) {
|
|
607
|
-
tween._zTime = totalTime;
|
|
608
|
-
}
|
|
609
|
-
};
|
|
610
|
-
var _findNextPauseTween = function _findNextPauseTween2(animation, prevTime, time) {
|
|
611
|
-
var child;
|
|
612
|
-
if (time > prevTime) {
|
|
613
|
-
child = animation._first;
|
|
614
|
-
while (child && child._start <= time) {
|
|
615
|
-
if (child.data === "isPause" && child._start > prevTime) {
|
|
616
|
-
return child;
|
|
617
|
-
}
|
|
618
|
-
child = child._next;
|
|
619
|
-
}
|
|
620
|
-
} else {
|
|
621
|
-
child = animation._last;
|
|
622
|
-
while (child && child._start >= time) {
|
|
623
|
-
if (child.data === "isPause" && child._start < prevTime) {
|
|
624
|
-
return child;
|
|
625
|
-
}
|
|
626
|
-
child = child._prev;
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
};
|
|
630
|
-
var _setDuration = function _setDuration2(animation, duration, skipUncache, leavePlayhead) {
|
|
631
|
-
var repeat = animation._repeat, dur = _roundPrecise(duration) || 0, totalProgress = animation._tTime / animation._tDur;
|
|
632
|
-
totalProgress && !leavePlayhead && (animation._time *= dur / animation._dur);
|
|
633
|
-
animation._dur = dur;
|
|
634
|
-
animation._tDur = !repeat ? dur : repeat < 0 ? 1e10 : _roundPrecise(dur * (repeat + 1) + animation._rDelay * repeat);
|
|
635
|
-
totalProgress > 0 && !leavePlayhead && _alignPlayhead(animation, animation._tTime = animation._tDur * totalProgress);
|
|
636
|
-
animation.parent && _setEnd(animation);
|
|
637
|
-
skipUncache || _uncache(animation.parent, animation);
|
|
638
|
-
return animation;
|
|
639
|
-
};
|
|
640
|
-
var _onUpdateTotalDuration = function _onUpdateTotalDuration2(animation) {
|
|
641
|
-
return animation instanceof Timeline ? _uncache(animation) : _setDuration(animation, animation._dur);
|
|
642
|
-
};
|
|
643
|
-
var _zeroPosition = {
|
|
644
|
-
_start: 0,
|
|
645
|
-
endTime: _emptyFunc,
|
|
646
|
-
totalDuration: _emptyFunc
|
|
647
|
-
};
|
|
648
|
-
var _parsePosition = function _parsePosition2(animation, position, percentAnimation) {
|
|
649
|
-
var labels = animation.labels, recent = animation._recent || _zeroPosition, clippedDuration = animation.duration() >= _bigNum ? recent.endTime(false) : animation._dur, i, offset, isPercent;
|
|
650
|
-
if (_isString(position) && (isNaN(position) || position in labels)) {
|
|
651
|
-
offset = position.charAt(0);
|
|
652
|
-
isPercent = position.substr(-1) === "%";
|
|
653
|
-
i = position.indexOf("=");
|
|
654
|
-
if (offset === "<" || offset === ">") {
|
|
655
|
-
i >= 0 && (position = position.replace(/=/, ""));
|
|
656
|
-
return (offset === "<" ? recent._start : recent.endTime(recent._repeat >= 0)) + (parseFloat(position.substr(1)) || 0) * (isPercent ? (i < 0 ? recent : percentAnimation).totalDuration() / 100 : 1);
|
|
657
|
-
}
|
|
658
|
-
if (i < 0) {
|
|
659
|
-
position in labels || (labels[position] = clippedDuration);
|
|
660
|
-
return labels[position];
|
|
661
|
-
}
|
|
662
|
-
offset = parseFloat(position.charAt(i - 1) + position.substr(i + 1));
|
|
663
|
-
if (isPercent && percentAnimation) {
|
|
664
|
-
offset = offset / 100 * (_isArray(percentAnimation) ? percentAnimation[0] : percentAnimation).totalDuration();
|
|
665
|
-
}
|
|
666
|
-
return i > 1 ? _parsePosition2(animation, position.substr(0, i - 1), percentAnimation) + offset : clippedDuration + offset;
|
|
667
|
-
}
|
|
668
|
-
return position == null ? clippedDuration : +position;
|
|
669
|
-
};
|
|
670
|
-
var _createTweenType = function _createTweenType2(type, params, timeline2) {
|
|
671
|
-
var isLegacy = _isNumber(params[1]), varsIndex = (isLegacy ? 2 : 1) + (type < 2 ? 0 : 1), vars = params[varsIndex], irVars, parent;
|
|
672
|
-
isLegacy && (vars.duration = params[1]);
|
|
673
|
-
vars.parent = timeline2;
|
|
674
|
-
if (type) {
|
|
675
|
-
irVars = vars;
|
|
676
|
-
parent = timeline2;
|
|
677
|
-
while (parent && !("immediateRender" in irVars)) {
|
|
678
|
-
irVars = parent.vars.defaults || {};
|
|
679
|
-
parent = _isNotFalse(parent.vars.inherit) && parent.parent;
|
|
680
|
-
}
|
|
681
|
-
vars.immediateRender = _isNotFalse(irVars.immediateRender);
|
|
682
|
-
type < 2 ? vars.runBackwards = 1 : vars.startAt = params[varsIndex - 1];
|
|
683
|
-
}
|
|
684
|
-
return new Tween(params[0], vars, params[varsIndex + 1]);
|
|
685
|
-
};
|
|
686
|
-
var _conditionalReturn = function _conditionalReturn2(value, func) {
|
|
687
|
-
return value || value === 0 ? func(value) : func;
|
|
688
|
-
};
|
|
689
|
-
var _clamp = function _clamp2(min, max, value) {
|
|
690
|
-
return value < min ? min : value > max ? max : value;
|
|
691
|
-
};
|
|
692
|
-
var getUnit = function getUnit2(value, v) {
|
|
693
|
-
return !_isString(value) || !(v = _unitExp.exec(value)) ? "" : v[1];
|
|
694
|
-
};
|
|
695
|
-
var clamp = function clamp2(min, max, value) {
|
|
696
|
-
return _conditionalReturn(value, function(v) {
|
|
697
|
-
return _clamp(min, max, v);
|
|
698
|
-
});
|
|
699
|
-
};
|
|
700
|
-
var _slice = [].slice;
|
|
701
|
-
var _isArrayLike = function _isArrayLike2(value, nonEmpty) {
|
|
702
|
-
return value && _isObject(value) && "length" in value && (!nonEmpty && !value.length || value.length - 1 in value && _isObject(value[0])) && !value.nodeType && value !== _win;
|
|
703
|
-
};
|
|
704
|
-
var _flatten = function _flatten2(ar, leaveStrings, accumulator) {
|
|
705
|
-
if (accumulator === void 0) {
|
|
706
|
-
accumulator = [];
|
|
707
|
-
}
|
|
708
|
-
return ar.forEach(function(value) {
|
|
709
|
-
var _accumulator;
|
|
710
|
-
return _isString(value) && !leaveStrings || _isArrayLike(value, 1) ? (_accumulator = accumulator).push.apply(_accumulator, toArray(value)) : accumulator.push(value);
|
|
711
|
-
}) || accumulator;
|
|
712
|
-
};
|
|
713
|
-
var toArray = function toArray2(value, scope, leaveStrings) {
|
|
714
|
-
return _context && !scope && _context.selector ? _context.selector(value) : _isString(value) && !leaveStrings && (_coreInitted || !_wake()) ? _slice.call((scope || _doc).querySelectorAll(value), 0) : _isArray(value) ? _flatten(value, leaveStrings) : _isArrayLike(value) ? _slice.call(value, 0) : value ? [value] : [];
|
|
715
|
-
};
|
|
716
|
-
var selector = function selector2(value) {
|
|
717
|
-
value = toArray(value)[0] || _warn("Invalid scope") || {};
|
|
718
|
-
return function(v) {
|
|
719
|
-
var el = value.current || value.nativeElement || value;
|
|
720
|
-
return toArray(v, el.querySelectorAll ? el : el === value ? _warn("Invalid scope") || _doc.createElement("div") : value);
|
|
721
|
-
};
|
|
722
|
-
};
|
|
723
|
-
var shuffle = function shuffle2(a) {
|
|
724
|
-
return a.sort(function() {
|
|
725
|
-
return 0.5 - Math.random();
|
|
726
|
-
});
|
|
727
|
-
};
|
|
728
|
-
var distribute = function distribute2(v) {
|
|
729
|
-
if (_isFunction(v)) {
|
|
730
|
-
return v;
|
|
731
|
-
}
|
|
732
|
-
var vars = _isObject(v) ? v : {
|
|
733
|
-
each: v
|
|
734
|
-
}, ease = _parseEase(vars.ease), from = vars.from || 0, base = parseFloat(vars.base) || 0, cache = {}, isDecimal = from > 0 && from < 1, ratios = isNaN(from) || isDecimal, axis = vars.axis, ratioX = from, ratioY = from;
|
|
735
|
-
if (_isString(from)) {
|
|
736
|
-
ratioX = ratioY = {
|
|
737
|
-
center: 0.5,
|
|
738
|
-
edges: 0.5,
|
|
739
|
-
end: 1
|
|
740
|
-
}[from] || 0;
|
|
741
|
-
} else if (!isDecimal && ratios) {
|
|
742
|
-
ratioX = from[0];
|
|
743
|
-
ratioY = from[1];
|
|
744
|
-
}
|
|
745
|
-
return function(i, target, a) {
|
|
746
|
-
var l = (a || vars).length, distances = cache[l], originX, originY, x, y, d, j, max, min, wrapAt;
|
|
747
|
-
if (!distances) {
|
|
748
|
-
wrapAt = vars.grid === "auto" ? 0 : (vars.grid || [1, _bigNum])[1];
|
|
749
|
-
if (!wrapAt) {
|
|
750
|
-
max = -_bigNum;
|
|
751
|
-
while (max < (max = a[wrapAt++].getBoundingClientRect().left) && wrapAt < l) {
|
|
752
|
-
}
|
|
753
|
-
wrapAt < l && wrapAt--;
|
|
754
|
-
}
|
|
755
|
-
distances = cache[l] = [];
|
|
756
|
-
originX = ratios ? Math.min(wrapAt, l) * ratioX - 0.5 : from % wrapAt;
|
|
757
|
-
originY = wrapAt === _bigNum ? 0 : ratios ? l * ratioY / wrapAt - 0.5 : from / wrapAt | 0;
|
|
758
|
-
max = 0;
|
|
759
|
-
min = _bigNum;
|
|
760
|
-
for (j = 0; j < l; j++) {
|
|
761
|
-
x = j % wrapAt - originX;
|
|
762
|
-
y = originY - (j / wrapAt | 0);
|
|
763
|
-
distances[j] = d = !axis ? _sqrt(x * x + y * y) : Math.abs(axis === "y" ? y : x);
|
|
764
|
-
d > max && (max = d);
|
|
765
|
-
d < min && (min = d);
|
|
766
|
-
}
|
|
767
|
-
from === "random" && shuffle(distances);
|
|
768
|
-
distances.max = max - min;
|
|
769
|
-
distances.min = min;
|
|
770
|
-
distances.v = l = (parseFloat(vars.amount) || parseFloat(vars.each) * (wrapAt > l ? l - 1 : !axis ? Math.max(wrapAt, l / wrapAt) : axis === "y" ? l / wrapAt : wrapAt) || 0) * (from === "edges" ? -1 : 1);
|
|
771
|
-
distances.b = l < 0 ? base - l : base;
|
|
772
|
-
distances.u = getUnit(vars.amount || vars.each) || 0;
|
|
773
|
-
ease = ease && l < 0 ? _invertEase(ease) : ease;
|
|
774
|
-
}
|
|
775
|
-
l = (distances[i] - distances.min) / distances.max || 0;
|
|
776
|
-
return _roundPrecise(distances.b + (ease ? ease(l) : l) * distances.v) + distances.u;
|
|
777
|
-
};
|
|
778
|
-
};
|
|
779
|
-
var _roundModifier = function _roundModifier2(v) {
|
|
780
|
-
var p = Math.pow(10, ((v + "").split(".")[1] || "").length);
|
|
781
|
-
return function(raw) {
|
|
782
|
-
var n = _roundPrecise(Math.round(parseFloat(raw) / v) * v * p);
|
|
783
|
-
return (n - n % 1) / p + (_isNumber(raw) ? 0 : getUnit(raw));
|
|
784
|
-
};
|
|
785
|
-
};
|
|
786
|
-
var snap = function snap2(snapTo, value) {
|
|
787
|
-
var isArray = _isArray(snapTo), radius, is2D;
|
|
788
|
-
if (!isArray && _isObject(snapTo)) {
|
|
789
|
-
radius = isArray = snapTo.radius || _bigNum;
|
|
790
|
-
if (snapTo.values) {
|
|
791
|
-
snapTo = toArray(snapTo.values);
|
|
792
|
-
if (is2D = !_isNumber(snapTo[0])) {
|
|
793
|
-
radius *= radius;
|
|
794
|
-
}
|
|
795
|
-
} else {
|
|
796
|
-
snapTo = _roundModifier(snapTo.increment);
|
|
797
|
-
}
|
|
798
|
-
}
|
|
799
|
-
return _conditionalReturn(value, !isArray ? _roundModifier(snapTo) : _isFunction(snapTo) ? function(raw) {
|
|
800
|
-
is2D = snapTo(raw);
|
|
801
|
-
return Math.abs(is2D - raw) <= radius ? is2D : raw;
|
|
802
|
-
} : function(raw) {
|
|
803
|
-
var x = parseFloat(is2D ? raw.x : raw), y = parseFloat(is2D ? raw.y : 0), min = _bigNum, closest = 0, i = snapTo.length, dx, dy;
|
|
804
|
-
while (i--) {
|
|
805
|
-
if (is2D) {
|
|
806
|
-
dx = snapTo[i].x - x;
|
|
807
|
-
dy = snapTo[i].y - y;
|
|
808
|
-
dx = dx * dx + dy * dy;
|
|
809
|
-
} else {
|
|
810
|
-
dx = Math.abs(snapTo[i] - x);
|
|
811
|
-
}
|
|
812
|
-
if (dx < min) {
|
|
813
|
-
min = dx;
|
|
814
|
-
closest = i;
|
|
815
|
-
}
|
|
816
|
-
}
|
|
817
|
-
closest = !radius || min <= radius ? snapTo[closest] : raw;
|
|
818
|
-
return is2D || closest === raw || _isNumber(raw) ? closest : closest + getUnit(raw);
|
|
819
|
-
});
|
|
820
|
-
};
|
|
821
|
-
var random = function random2(min, max, roundingIncrement, returnFunction) {
|
|
822
|
-
return _conditionalReturn(_isArray(min) ? !max : roundingIncrement === true ? !!(roundingIncrement = 0) : !returnFunction, function() {
|
|
823
|
-
return _isArray(min) ? min[~~(Math.random() * min.length)] : (roundingIncrement = roundingIncrement || 1e-5) && (returnFunction = roundingIncrement < 1 ? Math.pow(10, (roundingIncrement + "").length - 2) : 1) && Math.floor(Math.round((min - roundingIncrement / 2 + Math.random() * (max - min + roundingIncrement * 0.99)) / roundingIncrement) * roundingIncrement * returnFunction) / returnFunction;
|
|
824
|
-
});
|
|
825
|
-
};
|
|
826
|
-
var pipe = function pipe2() {
|
|
827
|
-
for (var _len = arguments.length, functions = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
828
|
-
functions[_key] = arguments[_key];
|
|
829
|
-
}
|
|
830
|
-
return function(value) {
|
|
831
|
-
return functions.reduce(function(v, f) {
|
|
832
|
-
return f(v);
|
|
833
|
-
}, value);
|
|
834
|
-
};
|
|
835
|
-
};
|
|
836
|
-
var unitize = function unitize2(func, unit) {
|
|
837
|
-
return function(value) {
|
|
838
|
-
return func(parseFloat(value)) + (unit || getUnit(value));
|
|
839
|
-
};
|
|
840
|
-
};
|
|
841
|
-
var normalize = function normalize2(min, max, value) {
|
|
842
|
-
return mapRange(min, max, 0, 1, value);
|
|
843
|
-
};
|
|
844
|
-
var _wrapArray = function _wrapArray2(a, wrapper, value) {
|
|
845
|
-
return _conditionalReturn(value, function(index) {
|
|
846
|
-
return a[~~wrapper(index)];
|
|
847
|
-
});
|
|
848
|
-
};
|
|
849
|
-
var wrap = function wrap2(min, max, value) {
|
|
850
|
-
var range = max - min;
|
|
851
|
-
return _isArray(min) ? _wrapArray(min, wrap2(0, min.length), max) : _conditionalReturn(value, function(value2) {
|
|
852
|
-
return (range + (value2 - min) % range) % range + min;
|
|
853
|
-
});
|
|
854
|
-
};
|
|
855
|
-
var wrapYoyo = function wrapYoyo2(min, max, value) {
|
|
856
|
-
var range = max - min, total = range * 2;
|
|
857
|
-
return _isArray(min) ? _wrapArray(min, wrapYoyo2(0, min.length - 1), max) : _conditionalReturn(value, function(value2) {
|
|
858
|
-
value2 = (total + (value2 - min) % total) % total || 0;
|
|
859
|
-
return min + (value2 > range ? total - value2 : value2);
|
|
860
|
-
});
|
|
861
|
-
};
|
|
862
|
-
var _replaceRandom = function _replaceRandom2(s) {
|
|
863
|
-
return s.replace(_randomExp, function(match) {
|
|
864
|
-
var arIndex = match.indexOf("[") + 1, values = match.substring(arIndex || 7, arIndex ? match.indexOf("]") : match.length - 1).split(_commaDelimExp);
|
|
865
|
-
return random(arIndex ? values : +values[0], arIndex ? 0 : +values[1], +values[2] || 1e-5);
|
|
866
|
-
});
|
|
867
|
-
};
|
|
868
|
-
var mapRange = function mapRange2(inMin, inMax, outMin, outMax, value) {
|
|
869
|
-
var inRange = inMax - inMin, outRange = outMax - outMin;
|
|
870
|
-
return _conditionalReturn(value, function(value2) {
|
|
871
|
-
return outMin + ((value2 - inMin) / inRange * outRange || 0);
|
|
872
|
-
});
|
|
873
|
-
};
|
|
874
|
-
var interpolate = function interpolate2(start, end, progress, mutate) {
|
|
875
|
-
var func = isNaN(start + end) ? 0 : function(p2) {
|
|
876
|
-
return (1 - p2) * start + p2 * end;
|
|
877
|
-
};
|
|
878
|
-
if (!func) {
|
|
879
|
-
var isString = _isString(start), master = {}, p, i, interpolators, l, il;
|
|
880
|
-
progress === true && (mutate = 1) && (progress = null);
|
|
881
|
-
if (isString) {
|
|
882
|
-
start = {
|
|
883
|
-
p: start
|
|
884
|
-
};
|
|
885
|
-
end = {
|
|
886
|
-
p: end
|
|
887
|
-
};
|
|
888
|
-
} else if (_isArray(start) && !_isArray(end)) {
|
|
889
|
-
interpolators = [];
|
|
890
|
-
l = start.length;
|
|
891
|
-
il = l - 2;
|
|
892
|
-
for (i = 1; i < l; i++) {
|
|
893
|
-
interpolators.push(interpolate2(start[i - 1], start[i]));
|
|
894
|
-
}
|
|
895
|
-
l--;
|
|
896
|
-
func = function func2(p2) {
|
|
897
|
-
p2 *= l;
|
|
898
|
-
var i2 = Math.min(il, ~~p2);
|
|
899
|
-
return interpolators[i2](p2 - i2);
|
|
900
|
-
};
|
|
901
|
-
progress = end;
|
|
902
|
-
} else if (!mutate) {
|
|
903
|
-
start = _merge(_isArray(start) ? [] : {}, start);
|
|
904
|
-
}
|
|
905
|
-
if (!interpolators) {
|
|
906
|
-
for (p in end) {
|
|
907
|
-
_addPropTween.call(master, start, p, "get", end[p]);
|
|
908
|
-
}
|
|
909
|
-
func = function func2(p2) {
|
|
910
|
-
return _renderPropTweens(p2, master) || (isString ? start.p : start);
|
|
911
|
-
};
|
|
912
|
-
}
|
|
913
|
-
}
|
|
914
|
-
return _conditionalReturn(progress, func);
|
|
915
|
-
};
|
|
916
|
-
var _getLabelInDirection = function _getLabelInDirection2(timeline2, fromTime, backward) {
|
|
917
|
-
var labels = timeline2.labels, min = _bigNum, p, distance, label;
|
|
918
|
-
for (p in labels) {
|
|
919
|
-
distance = labels[p] - fromTime;
|
|
920
|
-
if (distance < 0 === !!backward && distance && min > (distance = Math.abs(distance))) {
|
|
921
|
-
label = p;
|
|
922
|
-
min = distance;
|
|
923
|
-
}
|
|
924
|
-
}
|
|
925
|
-
return label;
|
|
926
|
-
};
|
|
927
|
-
var _callback = function _callback2(animation, type, executeLazyFirst) {
|
|
928
|
-
var v = animation.vars, callback = v[type], prevContext = _context, context3 = animation._ctx, params, scope, result;
|
|
929
|
-
if (!callback) {
|
|
930
|
-
return;
|
|
931
|
-
}
|
|
932
|
-
params = v[type + "Params"];
|
|
933
|
-
scope = v.callbackScope || animation;
|
|
934
|
-
executeLazyFirst && _lazyTweens.length && _lazyRender();
|
|
935
|
-
context3 && (_context = context3);
|
|
936
|
-
result = params ? callback.apply(scope, params) : callback.call(scope);
|
|
937
|
-
_context = prevContext;
|
|
938
|
-
return result;
|
|
939
|
-
};
|
|
940
|
-
var _interrupt = function _interrupt2(animation) {
|
|
941
|
-
_removeFromParent(animation);
|
|
942
|
-
animation.scrollTrigger && animation.scrollTrigger.kill(!!_reverting);
|
|
943
|
-
animation.progress() < 1 && _callback(animation, "onInterrupt");
|
|
944
|
-
return animation;
|
|
945
|
-
};
|
|
946
|
-
var _quickTween;
|
|
947
|
-
var _registerPluginQueue = [];
|
|
948
|
-
var _createPlugin = function _createPlugin2(config3) {
|
|
949
|
-
if (!config3) return;
|
|
950
|
-
config3 = !config3.name && config3["default"] || config3;
|
|
951
|
-
if (_windowExists() || config3.headless) {
|
|
952
|
-
var name = config3.name, isFunc = _isFunction(config3), Plugin = name && !isFunc && config3.init ? function() {
|
|
953
|
-
this._props = [];
|
|
954
|
-
} : config3, instanceDefaults = {
|
|
955
|
-
init: _emptyFunc,
|
|
956
|
-
render: _renderPropTweens,
|
|
957
|
-
add: _addPropTween,
|
|
958
|
-
kill: _killPropTweensOf,
|
|
959
|
-
modifier: _addPluginModifier,
|
|
960
|
-
rawVars: 0
|
|
961
|
-
}, statics = {
|
|
962
|
-
targetTest: 0,
|
|
963
|
-
get: 0,
|
|
964
|
-
getSetter: _getSetter,
|
|
965
|
-
aliases: {},
|
|
966
|
-
register: 0
|
|
967
|
-
};
|
|
968
|
-
_wake();
|
|
969
|
-
if (config3 !== Plugin) {
|
|
970
|
-
if (_plugins[name]) {
|
|
971
|
-
return;
|
|
972
|
-
}
|
|
973
|
-
_setDefaults(Plugin, _setDefaults(_copyExcluding(config3, instanceDefaults), statics));
|
|
974
|
-
_merge(Plugin.prototype, _merge(instanceDefaults, _copyExcluding(config3, statics)));
|
|
975
|
-
_plugins[Plugin.prop = name] = Plugin;
|
|
976
|
-
if (config3.targetTest) {
|
|
977
|
-
_harnessPlugins.push(Plugin);
|
|
978
|
-
_reservedProps[name] = 1;
|
|
979
|
-
}
|
|
980
|
-
name = (name === "css" ? "CSS" : name.charAt(0).toUpperCase() + name.substr(1)) + "Plugin";
|
|
981
|
-
}
|
|
982
|
-
_addGlobal(name, Plugin);
|
|
983
|
-
config3.register && config3.register(gsap, Plugin, PropTween);
|
|
984
|
-
} else {
|
|
985
|
-
_registerPluginQueue.push(config3);
|
|
986
|
-
}
|
|
987
|
-
};
|
|
988
|
-
var _255 = 255;
|
|
989
|
-
var _colorLookup = {
|
|
990
|
-
aqua: [0, _255, _255],
|
|
991
|
-
lime: [0, _255, 0],
|
|
992
|
-
silver: [192, 192, 192],
|
|
993
|
-
black: [0, 0, 0],
|
|
994
|
-
maroon: [128, 0, 0],
|
|
995
|
-
teal: [0, 128, 128],
|
|
996
|
-
blue: [0, 0, _255],
|
|
997
|
-
navy: [0, 0, 128],
|
|
998
|
-
white: [_255, _255, _255],
|
|
999
|
-
olive: [128, 128, 0],
|
|
1000
|
-
yellow: [_255, _255, 0],
|
|
1001
|
-
orange: [_255, 165, 0],
|
|
1002
|
-
gray: [128, 128, 128],
|
|
1003
|
-
purple: [128, 0, 128],
|
|
1004
|
-
green: [0, 128, 0],
|
|
1005
|
-
red: [_255, 0, 0],
|
|
1006
|
-
pink: [_255, 192, 203],
|
|
1007
|
-
cyan: [0, _255, _255],
|
|
1008
|
-
transparent: [_255, _255, _255, 0]
|
|
1009
|
-
};
|
|
1010
|
-
var _hue = function _hue2(h, m1, m2) {
|
|
1011
|
-
h += h < 0 ? 1 : h > 1 ? -1 : 0;
|
|
1012
|
-
return (h * 6 < 1 ? m1 + (m2 - m1) * h * 6 : h < 0.5 ? m2 : h * 3 < 2 ? m1 + (m2 - m1) * (2 / 3 - h) * 6 : m1) * _255 + 0.5 | 0;
|
|
1013
|
-
};
|
|
1014
|
-
var splitColor = function splitColor2(v, toHSL, forceAlpha) {
|
|
1015
|
-
var a = !v ? _colorLookup.black : _isNumber(v) ? [v >> 16, v >> 8 & _255, v & _255] : 0, r, g, b, h, s, l, max, min, d, wasHSL;
|
|
1016
|
-
if (!a) {
|
|
1017
|
-
if (v.substr(-1) === ",") {
|
|
1018
|
-
v = v.substr(0, v.length - 1);
|
|
1019
|
-
}
|
|
1020
|
-
if (_colorLookup[v]) {
|
|
1021
|
-
a = _colorLookup[v];
|
|
1022
|
-
} else if (v.charAt(0) === "#") {
|
|
1023
|
-
if (v.length < 6) {
|
|
1024
|
-
r = v.charAt(1);
|
|
1025
|
-
g = v.charAt(2);
|
|
1026
|
-
b = v.charAt(3);
|
|
1027
|
-
v = "#" + r + r + g + g + b + b + (v.length === 5 ? v.charAt(4) + v.charAt(4) : "");
|
|
1028
|
-
}
|
|
1029
|
-
if (v.length === 9) {
|
|
1030
|
-
a = parseInt(v.substr(1, 6), 16);
|
|
1031
|
-
return [a >> 16, a >> 8 & _255, a & _255, parseInt(v.substr(7), 16) / 255];
|
|
1032
|
-
}
|
|
1033
|
-
v = parseInt(v.substr(1), 16);
|
|
1034
|
-
a = [v >> 16, v >> 8 & _255, v & _255];
|
|
1035
|
-
} else if (v.substr(0, 3) === "hsl") {
|
|
1036
|
-
a = wasHSL = v.match(_strictNumExp);
|
|
1037
|
-
if (!toHSL) {
|
|
1038
|
-
h = +a[0] % 360 / 360;
|
|
1039
|
-
s = +a[1] / 100;
|
|
1040
|
-
l = +a[2] / 100;
|
|
1041
|
-
g = l <= 0.5 ? l * (s + 1) : l + s - l * s;
|
|
1042
|
-
r = l * 2 - g;
|
|
1043
|
-
a.length > 3 && (a[3] *= 1);
|
|
1044
|
-
a[0] = _hue(h + 1 / 3, r, g);
|
|
1045
|
-
a[1] = _hue(h, r, g);
|
|
1046
|
-
a[2] = _hue(h - 1 / 3, r, g);
|
|
1047
|
-
} else if (~v.indexOf("=")) {
|
|
1048
|
-
a = v.match(_numExp);
|
|
1049
|
-
forceAlpha && a.length < 4 && (a[3] = 1);
|
|
1050
|
-
return a;
|
|
1051
|
-
}
|
|
1052
|
-
} else {
|
|
1053
|
-
a = v.match(_strictNumExp) || _colorLookup.transparent;
|
|
1054
|
-
}
|
|
1055
|
-
a = a.map(Number);
|
|
1056
|
-
}
|
|
1057
|
-
if (toHSL && !wasHSL) {
|
|
1058
|
-
r = a[0] / _255;
|
|
1059
|
-
g = a[1] / _255;
|
|
1060
|
-
b = a[2] / _255;
|
|
1061
|
-
max = Math.max(r, g, b);
|
|
1062
|
-
min = Math.min(r, g, b);
|
|
1063
|
-
l = (max + min) / 2;
|
|
1064
|
-
if (max === min) {
|
|
1065
|
-
h = s = 0;
|
|
1066
|
-
} else {
|
|
1067
|
-
d = max - min;
|
|
1068
|
-
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
|
|
1069
|
-
h = max === r ? (g - b) / d + (g < b ? 6 : 0) : max === g ? (b - r) / d + 2 : (r - g) / d + 4;
|
|
1070
|
-
h *= 60;
|
|
1071
|
-
}
|
|
1072
|
-
a[0] = ~~(h + 0.5);
|
|
1073
|
-
a[1] = ~~(s * 100 + 0.5);
|
|
1074
|
-
a[2] = ~~(l * 100 + 0.5);
|
|
1075
|
-
}
|
|
1076
|
-
forceAlpha && a.length < 4 && (a[3] = 1);
|
|
1077
|
-
return a;
|
|
1078
|
-
};
|
|
1079
|
-
var _colorOrderData = function _colorOrderData2(v) {
|
|
1080
|
-
var values = [], c = [], i = -1;
|
|
1081
|
-
v.split(_colorExp).forEach(function(v2) {
|
|
1082
|
-
var a = v2.match(_numWithUnitExp) || [];
|
|
1083
|
-
values.push.apply(values, a);
|
|
1084
|
-
c.push(i += a.length + 1);
|
|
1085
|
-
});
|
|
1086
|
-
values.c = c;
|
|
1087
|
-
return values;
|
|
1088
|
-
};
|
|
1089
|
-
var _formatColors = function _formatColors2(s, toHSL, orderMatchData) {
|
|
1090
|
-
var result = "", colors = (s + result).match(_colorExp), type = toHSL ? "hsla(" : "rgba(", i = 0, c, shell, d, l;
|
|
1091
|
-
if (!colors) {
|
|
1092
|
-
return s;
|
|
1093
|
-
}
|
|
1094
|
-
colors = colors.map(function(color) {
|
|
1095
|
-
return (color = splitColor(color, toHSL, 1)) && type + (toHSL ? color[0] + "," + color[1] + "%," + color[2] + "%," + color[3] : color.join(",")) + ")";
|
|
1096
|
-
});
|
|
1097
|
-
if (orderMatchData) {
|
|
1098
|
-
d = _colorOrderData(s);
|
|
1099
|
-
c = orderMatchData.c;
|
|
1100
|
-
if (c.join(result) !== d.c.join(result)) {
|
|
1101
|
-
shell = s.replace(_colorExp, "1").split(_numWithUnitExp);
|
|
1102
|
-
l = shell.length - 1;
|
|
1103
|
-
for (; i < l; i++) {
|
|
1104
|
-
result += shell[i] + (~c.indexOf(i) ? colors.shift() || type + "0,0,0,0)" : (d.length ? d : colors.length ? colors : orderMatchData).shift());
|
|
1105
|
-
}
|
|
1106
|
-
}
|
|
1107
|
-
}
|
|
1108
|
-
if (!shell) {
|
|
1109
|
-
shell = s.split(_colorExp);
|
|
1110
|
-
l = shell.length - 1;
|
|
1111
|
-
for (; i < l; i++) {
|
|
1112
|
-
result += shell[i] + colors[i];
|
|
1113
|
-
}
|
|
1114
|
-
}
|
|
1115
|
-
return result + shell[l];
|
|
1116
|
-
};
|
|
1117
|
-
var _colorExp = (function() {
|
|
1118
|
-
var s = "(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b", p;
|
|
1119
|
-
for (p in _colorLookup) {
|
|
1120
|
-
s += "|" + p + "\\b";
|
|
1121
|
-
}
|
|
1122
|
-
return new RegExp(s + ")", "gi");
|
|
1123
|
-
})();
|
|
1124
|
-
var _hslExp = /hsl[a]?\(/;
|
|
1125
|
-
var _colorStringFilter = function _colorStringFilter2(a) {
|
|
1126
|
-
var combined = a.join(" "), toHSL;
|
|
1127
|
-
_colorExp.lastIndex = 0;
|
|
1128
|
-
if (_colorExp.test(combined)) {
|
|
1129
|
-
toHSL = _hslExp.test(combined);
|
|
1130
|
-
a[1] = _formatColors(a[1], toHSL);
|
|
1131
|
-
a[0] = _formatColors(a[0], toHSL, _colorOrderData(a[1]));
|
|
1132
|
-
return true;
|
|
1133
|
-
}
|
|
1134
|
-
};
|
|
1135
|
-
var _tickerActive;
|
|
1136
|
-
var _ticker = (function() {
|
|
1137
|
-
var _getTime = Date.now, _lagThreshold = 500, _adjustedLag = 33, _startTime = _getTime(), _lastUpdate = _startTime, _gap = 1e3 / 240, _nextTime = _gap, _listeners2 = [], _id, _req, _raf, _self, _delta, _i, _tick = function _tick2(v) {
|
|
1138
|
-
var elapsed = _getTime() - _lastUpdate, manual = v === true, overlap, dispatch, time, frame;
|
|
1139
|
-
(elapsed > _lagThreshold || elapsed < 0) && (_startTime += elapsed - _adjustedLag);
|
|
1140
|
-
_lastUpdate += elapsed;
|
|
1141
|
-
time = _lastUpdate - _startTime;
|
|
1142
|
-
overlap = time - _nextTime;
|
|
1143
|
-
if (overlap > 0 || manual) {
|
|
1144
|
-
frame = ++_self.frame;
|
|
1145
|
-
_delta = time - _self.time * 1e3;
|
|
1146
|
-
_self.time = time = time / 1e3;
|
|
1147
|
-
_nextTime += overlap + (overlap >= _gap ? 4 : _gap - overlap);
|
|
1148
|
-
dispatch = 1;
|
|
1149
|
-
}
|
|
1150
|
-
manual || (_id = _req(_tick2));
|
|
1151
|
-
if (dispatch) {
|
|
1152
|
-
for (_i = 0; _i < _listeners2.length; _i++) {
|
|
1153
|
-
_listeners2[_i](time, _delta, frame, v);
|
|
1154
|
-
}
|
|
1155
|
-
}
|
|
1156
|
-
};
|
|
1157
|
-
_self = {
|
|
1158
|
-
time: 0,
|
|
1159
|
-
frame: 0,
|
|
1160
|
-
tick: function tick() {
|
|
1161
|
-
_tick(true);
|
|
1162
|
-
},
|
|
1163
|
-
deltaRatio: function deltaRatio(fps) {
|
|
1164
|
-
return _delta / (1e3 / (fps || 60));
|
|
1165
|
-
},
|
|
1166
|
-
wake: function wake() {
|
|
1167
|
-
if (_coreReady) {
|
|
1168
|
-
if (!_coreInitted && _windowExists()) {
|
|
1169
|
-
_win = _coreInitted = window;
|
|
1170
|
-
_doc = _win.document || {};
|
|
1171
|
-
_globals.gsap = gsap;
|
|
1172
|
-
(_win.gsapVersions || (_win.gsapVersions = [])).push(gsap.version);
|
|
1173
|
-
_install(_installScope || _win.GreenSockGlobals || !_win.gsap && _win || {});
|
|
1174
|
-
_registerPluginQueue.forEach(_createPlugin);
|
|
1175
|
-
}
|
|
1176
|
-
_raf = typeof requestAnimationFrame !== "undefined" && requestAnimationFrame;
|
|
1177
|
-
_id && _self.sleep();
|
|
1178
|
-
_req = _raf || function(f) {
|
|
1179
|
-
return setTimeout(f, _nextTime - _self.time * 1e3 + 1 | 0);
|
|
1180
|
-
};
|
|
1181
|
-
_tickerActive = 1;
|
|
1182
|
-
_tick(2);
|
|
1183
|
-
}
|
|
1184
|
-
},
|
|
1185
|
-
sleep: function sleep() {
|
|
1186
|
-
(_raf ? cancelAnimationFrame : clearTimeout)(_id);
|
|
1187
|
-
_tickerActive = 0;
|
|
1188
|
-
_req = _emptyFunc;
|
|
1189
|
-
},
|
|
1190
|
-
lagSmoothing: function lagSmoothing(threshold, adjustedLag) {
|
|
1191
|
-
_lagThreshold = threshold || Infinity;
|
|
1192
|
-
_adjustedLag = Math.min(adjustedLag || 33, _lagThreshold);
|
|
1193
|
-
},
|
|
1194
|
-
fps: function fps(_fps) {
|
|
1195
|
-
_gap = 1e3 / (_fps || 240);
|
|
1196
|
-
_nextTime = _self.time * 1e3 + _gap;
|
|
1197
|
-
},
|
|
1198
|
-
add: function add(callback, once, prioritize) {
|
|
1199
|
-
var func = once ? function(t, d, f, v) {
|
|
1200
|
-
callback(t, d, f, v);
|
|
1201
|
-
_self.remove(func);
|
|
1202
|
-
} : callback;
|
|
1203
|
-
_self.remove(callback);
|
|
1204
|
-
_listeners2[prioritize ? "unshift" : "push"](func);
|
|
1205
|
-
_wake();
|
|
1206
|
-
return func;
|
|
1207
|
-
},
|
|
1208
|
-
remove: function remove(callback, i) {
|
|
1209
|
-
~(i = _listeners2.indexOf(callback)) && _listeners2.splice(i, 1) && _i >= i && _i--;
|
|
1210
|
-
},
|
|
1211
|
-
_listeners: _listeners2
|
|
1212
|
-
};
|
|
1213
|
-
return _self;
|
|
1214
|
-
})();
|
|
1215
|
-
var _wake = function _wake2() {
|
|
1216
|
-
return !_tickerActive && _ticker.wake();
|
|
1217
|
-
};
|
|
1218
|
-
var _easeMap = {};
|
|
1219
|
-
var _customEaseExp = /^[\d.\-M][\d.\-,\s]/;
|
|
1220
|
-
var _quotesExp = /["']/g;
|
|
1221
|
-
var _parseObjectInString = function _parseObjectInString2(value) {
|
|
1222
|
-
var obj = {}, split = value.substr(1, value.length - 3).split(":"), key = split[0], i = 1, l = split.length, index, val, parsedVal;
|
|
1223
|
-
for (; i < l; i++) {
|
|
1224
|
-
val = split[i];
|
|
1225
|
-
index = i !== l - 1 ? val.lastIndexOf(",") : val.length;
|
|
1226
|
-
parsedVal = val.substr(0, index);
|
|
1227
|
-
obj[key] = isNaN(parsedVal) ? parsedVal.replace(_quotesExp, "").trim() : +parsedVal;
|
|
1228
|
-
key = val.substr(index + 1).trim();
|
|
1229
|
-
}
|
|
1230
|
-
return obj;
|
|
1231
|
-
};
|
|
1232
|
-
var _valueInParentheses = function _valueInParentheses2(value) {
|
|
1233
|
-
var open = value.indexOf("(") + 1, close = value.indexOf(")"), nested = value.indexOf("(", open);
|
|
1234
|
-
return value.substring(open, ~nested && nested < close ? value.indexOf(")", close + 1) : close);
|
|
1235
|
-
};
|
|
1236
|
-
var _configEaseFromString = function _configEaseFromString2(name) {
|
|
1237
|
-
var split = (name + "").split("("), ease = _easeMap[split[0]];
|
|
1238
|
-
return ease && split.length > 1 && ease.config ? ease.config.apply(null, ~name.indexOf("{") ? [_parseObjectInString(split[1])] : _valueInParentheses(name).split(",").map(_numericIfPossible)) : _easeMap._CE && _customEaseExp.test(name) ? _easeMap._CE("", name) : ease;
|
|
1239
|
-
};
|
|
1240
|
-
var _invertEase = function _invertEase2(ease) {
|
|
1241
|
-
return function(p) {
|
|
1242
|
-
return 1 - ease(1 - p);
|
|
1243
|
-
};
|
|
1244
|
-
};
|
|
1245
|
-
var _propagateYoyoEase = function _propagateYoyoEase2(timeline2, isYoyo) {
|
|
1246
|
-
var child = timeline2._first, ease;
|
|
1247
|
-
while (child) {
|
|
1248
|
-
if (child instanceof Timeline) {
|
|
1249
|
-
_propagateYoyoEase2(child, isYoyo);
|
|
1250
|
-
} else if (child.vars.yoyoEase && (!child._yoyo || !child._repeat) && child._yoyo !== isYoyo) {
|
|
1251
|
-
if (child.timeline) {
|
|
1252
|
-
_propagateYoyoEase2(child.timeline, isYoyo);
|
|
1253
|
-
} else {
|
|
1254
|
-
ease = child._ease;
|
|
1255
|
-
child._ease = child._yEase;
|
|
1256
|
-
child._yEase = ease;
|
|
1257
|
-
child._yoyo = isYoyo;
|
|
1258
|
-
}
|
|
1259
|
-
}
|
|
1260
|
-
child = child._next;
|
|
1261
|
-
}
|
|
1262
|
-
};
|
|
1263
|
-
var _parseEase = function _parseEase2(ease, defaultEase) {
|
|
1264
|
-
return !ease ? defaultEase : (_isFunction(ease) ? ease : _easeMap[ease] || _configEaseFromString(ease)) || defaultEase;
|
|
1265
|
-
};
|
|
1266
|
-
var _insertEase = function _insertEase2(names, easeIn, easeOut, easeInOut) {
|
|
1267
|
-
if (easeOut === void 0) {
|
|
1268
|
-
easeOut = function easeOut2(p) {
|
|
1269
|
-
return 1 - easeIn(1 - p);
|
|
1270
|
-
};
|
|
1271
|
-
}
|
|
1272
|
-
if (easeInOut === void 0) {
|
|
1273
|
-
easeInOut = function easeInOut2(p) {
|
|
1274
|
-
return p < 0.5 ? easeIn(p * 2) / 2 : 1 - easeIn((1 - p) * 2) / 2;
|
|
1275
|
-
};
|
|
1276
|
-
}
|
|
1277
|
-
var ease = {
|
|
1278
|
-
easeIn,
|
|
1279
|
-
easeOut,
|
|
1280
|
-
easeInOut
|
|
1281
|
-
}, lowercaseName;
|
|
1282
|
-
_forEachName(names, function(name) {
|
|
1283
|
-
_easeMap[name] = _globals[name] = ease;
|
|
1284
|
-
_easeMap[lowercaseName = name.toLowerCase()] = easeOut;
|
|
1285
|
-
for (var p in ease) {
|
|
1286
|
-
_easeMap[lowercaseName + (p === "easeIn" ? ".in" : p === "easeOut" ? ".out" : ".inOut")] = _easeMap[name + "." + p] = ease[p];
|
|
1287
|
-
}
|
|
1288
|
-
});
|
|
1289
|
-
return ease;
|
|
1290
|
-
};
|
|
1291
|
-
var _easeInOutFromOut = function _easeInOutFromOut2(easeOut) {
|
|
1292
|
-
return function(p) {
|
|
1293
|
-
return p < 0.5 ? (1 - easeOut(1 - p * 2)) / 2 : 0.5 + easeOut((p - 0.5) * 2) / 2;
|
|
1294
|
-
};
|
|
1295
|
-
};
|
|
1296
|
-
var _configElastic = function _configElastic2(type, amplitude, period) {
|
|
1297
|
-
var p1 = amplitude >= 1 ? amplitude : 1, p2 = (period || (type ? 0.3 : 0.45)) / (amplitude < 1 ? amplitude : 1), p3 = p2 / _2PI * (Math.asin(1 / p1) || 0), easeOut = function easeOut2(p) {
|
|
1298
|
-
return p === 1 ? 1 : p1 * Math.pow(2, -10 * p) * _sin((p - p3) * p2) + 1;
|
|
1299
|
-
}, ease = type === "out" ? easeOut : type === "in" ? function(p) {
|
|
1300
|
-
return 1 - easeOut(1 - p);
|
|
1301
|
-
} : _easeInOutFromOut(easeOut);
|
|
1302
|
-
p2 = _2PI / p2;
|
|
1303
|
-
ease.config = function(amplitude2, period2) {
|
|
1304
|
-
return _configElastic2(type, amplitude2, period2);
|
|
1305
|
-
};
|
|
1306
|
-
return ease;
|
|
1307
|
-
};
|
|
1308
|
-
var _configBack = function _configBack2(type, overshoot) {
|
|
1309
|
-
if (overshoot === void 0) {
|
|
1310
|
-
overshoot = 1.70158;
|
|
1311
|
-
}
|
|
1312
|
-
var easeOut = function easeOut2(p) {
|
|
1313
|
-
return p ? --p * p * ((overshoot + 1) * p + overshoot) + 1 : 0;
|
|
1314
|
-
}, ease = type === "out" ? easeOut : type === "in" ? function(p) {
|
|
1315
|
-
return 1 - easeOut(1 - p);
|
|
1316
|
-
} : _easeInOutFromOut(easeOut);
|
|
1317
|
-
ease.config = function(overshoot2) {
|
|
1318
|
-
return _configBack2(type, overshoot2);
|
|
1319
|
-
};
|
|
1320
|
-
return ease;
|
|
1321
|
-
};
|
|
1322
|
-
_forEachName("Linear,Quad,Cubic,Quart,Quint,Strong", function(name, i) {
|
|
1323
|
-
var power = i < 5 ? i + 1 : i;
|
|
1324
|
-
_insertEase(name + ",Power" + (power - 1), i ? function(p) {
|
|
1325
|
-
return Math.pow(p, power);
|
|
1326
|
-
} : function(p) {
|
|
1327
|
-
return p;
|
|
1328
|
-
}, function(p) {
|
|
1329
|
-
return 1 - Math.pow(1 - p, power);
|
|
1330
|
-
}, function(p) {
|
|
1331
|
-
return p < 0.5 ? Math.pow(p * 2, power) / 2 : 1 - Math.pow((1 - p) * 2, power) / 2;
|
|
1332
|
-
});
|
|
1333
|
-
});
|
|
1334
|
-
_easeMap.Linear.easeNone = _easeMap.none = _easeMap.Linear.easeIn;
|
|
1335
|
-
_insertEase("Elastic", _configElastic("in"), _configElastic("out"), _configElastic());
|
|
1336
|
-
(function(n, c) {
|
|
1337
|
-
var n1 = 1 / c, n2 = 2 * n1, n3 = 2.5 * n1, easeOut = function easeOut2(p) {
|
|
1338
|
-
return p < n1 ? n * p * p : p < n2 ? n * Math.pow(p - 1.5 / c, 2) + 0.75 : p < n3 ? n * (p -= 2.25 / c) * p + 0.9375 : n * Math.pow(p - 2.625 / c, 2) + 0.984375;
|
|
1339
|
-
};
|
|
1340
|
-
_insertEase("Bounce", function(p) {
|
|
1341
|
-
return 1 - easeOut(1 - p);
|
|
1342
|
-
}, easeOut);
|
|
1343
|
-
})(7.5625, 2.75);
|
|
1344
|
-
_insertEase("Expo", function(p) {
|
|
1345
|
-
return Math.pow(2, 10 * (p - 1)) * p + p * p * p * p * p * p * (1 - p);
|
|
1346
|
-
});
|
|
1347
|
-
_insertEase("Circ", function(p) {
|
|
1348
|
-
return -(_sqrt(1 - p * p) - 1);
|
|
1349
|
-
});
|
|
1350
|
-
_insertEase("Sine", function(p) {
|
|
1351
|
-
return p === 1 ? 1 : -_cos(p * _HALF_PI) + 1;
|
|
1352
|
-
});
|
|
1353
|
-
_insertEase("Back", _configBack("in"), _configBack("out"), _configBack());
|
|
1354
|
-
_easeMap.SteppedEase = _easeMap.steps = _globals.SteppedEase = {
|
|
1355
|
-
config: function config(steps, immediateStart) {
|
|
1356
|
-
if (steps === void 0) {
|
|
1357
|
-
steps = 1;
|
|
1358
|
-
}
|
|
1359
|
-
var p1 = 1 / steps, p2 = steps + (immediateStart ? 0 : 1), p3 = immediateStart ? 1 : 0, max = 1 - _tinyNum;
|
|
1360
|
-
return function(p) {
|
|
1361
|
-
return ((p2 * _clamp(0, max, p) | 0) + p3) * p1;
|
|
1362
|
-
};
|
|
1363
|
-
}
|
|
1364
|
-
};
|
|
1365
|
-
_defaults.ease = _easeMap["quad.out"];
|
|
1366
|
-
_forEachName("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt", function(name) {
|
|
1367
|
-
return _callbackNames += name + "," + name + "Params,";
|
|
1368
|
-
});
|
|
1369
|
-
var GSCache = function GSCache2(target, harness) {
|
|
1370
|
-
this.id = _gsID++;
|
|
1371
|
-
target._gsap = this;
|
|
1372
|
-
this.target = target;
|
|
1373
|
-
this.harness = harness;
|
|
1374
|
-
this.get = harness ? harness.get : _getProperty;
|
|
1375
|
-
this.set = harness ? harness.getSetter : _getSetter;
|
|
1376
|
-
};
|
|
1377
|
-
var Animation = /* @__PURE__ */ (function() {
|
|
1378
|
-
function Animation2(vars) {
|
|
1379
|
-
this.vars = vars;
|
|
1380
|
-
this._delay = +vars.delay || 0;
|
|
1381
|
-
if (this._repeat = vars.repeat === Infinity ? -2 : vars.repeat || 0) {
|
|
1382
|
-
this._rDelay = vars.repeatDelay || 0;
|
|
1383
|
-
this._yoyo = !!vars.yoyo || !!vars.yoyoEase;
|
|
1384
|
-
}
|
|
1385
|
-
this._ts = 1;
|
|
1386
|
-
_setDuration(this, +vars.duration, 1, 1);
|
|
1387
|
-
this.data = vars.data;
|
|
1388
|
-
if (_context) {
|
|
1389
|
-
this._ctx = _context;
|
|
1390
|
-
_context.data.push(this);
|
|
1391
|
-
}
|
|
1392
|
-
_tickerActive || _ticker.wake();
|
|
1393
|
-
}
|
|
1394
|
-
var _proto = Animation2.prototype;
|
|
1395
|
-
_proto.delay = function delay(value) {
|
|
1396
|
-
if (value || value === 0) {
|
|
1397
|
-
this.parent && this.parent.smoothChildTiming && this.startTime(this._start + value - this._delay);
|
|
1398
|
-
this._delay = value;
|
|
1399
|
-
return this;
|
|
1400
|
-
}
|
|
1401
|
-
return this._delay;
|
|
1402
|
-
};
|
|
1403
|
-
_proto.duration = function duration(value) {
|
|
1404
|
-
return arguments.length ? this.totalDuration(this._repeat > 0 ? value + (value + this._rDelay) * this._repeat : value) : this.totalDuration() && this._dur;
|
|
1405
|
-
};
|
|
1406
|
-
_proto.totalDuration = function totalDuration(value) {
|
|
1407
|
-
if (!arguments.length) {
|
|
1408
|
-
return this._tDur;
|
|
1409
|
-
}
|
|
1410
|
-
this._dirty = 0;
|
|
1411
|
-
return _setDuration(this, this._repeat < 0 ? value : (value - this._repeat * this._rDelay) / (this._repeat + 1));
|
|
1412
|
-
};
|
|
1413
|
-
_proto.totalTime = function totalTime(_totalTime, suppressEvents) {
|
|
1414
|
-
_wake();
|
|
1415
|
-
if (!arguments.length) {
|
|
1416
|
-
return this._tTime;
|
|
1417
|
-
}
|
|
1418
|
-
var parent = this._dp;
|
|
1419
|
-
if (parent && parent.smoothChildTiming && this._ts) {
|
|
1420
|
-
_alignPlayhead(this, _totalTime);
|
|
1421
|
-
!parent._dp || parent.parent || _postAddChecks(parent, this);
|
|
1422
|
-
while (parent && parent.parent) {
|
|
1423
|
-
if (parent.parent._time !== parent._start + (parent._ts >= 0 ? parent._tTime / parent._ts : (parent.totalDuration() - parent._tTime) / -parent._ts)) {
|
|
1424
|
-
parent.totalTime(parent._tTime, true);
|
|
1425
|
-
}
|
|
1426
|
-
parent = parent.parent;
|
|
1427
|
-
}
|
|
1428
|
-
if (!this.parent && this._dp.autoRemoveChildren && (this._ts > 0 && _totalTime < this._tDur || this._ts < 0 && _totalTime > 0 || !this._tDur && !_totalTime)) {
|
|
1429
|
-
_addToTimeline(this._dp, this, this._start - this._delay);
|
|
1430
|
-
}
|
|
1431
|
-
}
|
|
1432
|
-
if (this._tTime !== _totalTime || !this._dur && !suppressEvents || this._initted && Math.abs(this._zTime) === _tinyNum || !this._initted && this._dur && _totalTime || !_totalTime && !this._initted && (this.add || this._ptLookup)) {
|
|
1433
|
-
this._ts || (this._pTime = _totalTime);
|
|
1434
|
-
_lazySafeRender(this, _totalTime, suppressEvents);
|
|
1435
|
-
}
|
|
1436
|
-
return this;
|
|
1437
|
-
};
|
|
1438
|
-
_proto.time = function time(value, suppressEvents) {
|
|
1439
|
-
return arguments.length ? this.totalTime(Math.min(this.totalDuration(), value + _elapsedCycleDuration(this)) % (this._dur + this._rDelay) || (value ? this._dur : 0), suppressEvents) : this._time;
|
|
1440
|
-
};
|
|
1441
|
-
_proto.totalProgress = function totalProgress(value, suppressEvents) {
|
|
1442
|
-
return arguments.length ? this.totalTime(this.totalDuration() * value, suppressEvents) : this.totalDuration() ? Math.min(1, this._tTime / this._tDur) : this.rawTime() >= 0 && this._initted ? 1 : 0;
|
|
1443
|
-
};
|
|
1444
|
-
_proto.progress = function progress(value, suppressEvents) {
|
|
1445
|
-
return arguments.length ? this.totalTime(this.duration() * (this._yoyo && !(this.iteration() & 1) ? 1 - value : value) + _elapsedCycleDuration(this), suppressEvents) : this.duration() ? Math.min(1, this._time / this._dur) : this.rawTime() > 0 ? 1 : 0;
|
|
1446
|
-
};
|
|
1447
|
-
_proto.iteration = function iteration(value, suppressEvents) {
|
|
1448
|
-
var cycleDuration = this.duration() + this._rDelay;
|
|
1449
|
-
return arguments.length ? this.totalTime(this._time + (value - 1) * cycleDuration, suppressEvents) : this._repeat ? _animationCycle(this._tTime, cycleDuration) + 1 : 1;
|
|
1450
|
-
};
|
|
1451
|
-
_proto.timeScale = function timeScale(value, suppressEvents) {
|
|
1452
|
-
if (!arguments.length) {
|
|
1453
|
-
return this._rts === -_tinyNum ? 0 : this._rts;
|
|
1454
|
-
}
|
|
1455
|
-
if (this._rts === value) {
|
|
1456
|
-
return this;
|
|
1457
|
-
}
|
|
1458
|
-
var tTime = this.parent && this._ts ? _parentToChildTotalTime(this.parent._time, this) : this._tTime;
|
|
1459
|
-
this._rts = +value || 0;
|
|
1460
|
-
this._ts = this._ps || value === -_tinyNum ? 0 : this._rts;
|
|
1461
|
-
this.totalTime(_clamp(-Math.abs(this._delay), this.totalDuration(), tTime), suppressEvents !== false);
|
|
1462
|
-
_setEnd(this);
|
|
1463
|
-
return _recacheAncestors(this);
|
|
1464
|
-
};
|
|
1465
|
-
_proto.paused = function paused(value) {
|
|
1466
|
-
if (!arguments.length) {
|
|
1467
|
-
return this._ps;
|
|
1468
|
-
}
|
|
1469
|
-
if (this._ps !== value) {
|
|
1470
|
-
this._ps = value;
|
|
1471
|
-
if (value) {
|
|
1472
|
-
this._pTime = this._tTime || Math.max(-this._delay, this.rawTime());
|
|
1473
|
-
this._ts = this._act = 0;
|
|
1474
|
-
} else {
|
|
1475
|
-
_wake();
|
|
1476
|
-
this._ts = this._rts;
|
|
1477
|
-
this.totalTime(this.parent && !this.parent.smoothChildTiming ? this.rawTime() : this._tTime || this._pTime, this.progress() === 1 && Math.abs(this._zTime) !== _tinyNum && (this._tTime -= _tinyNum));
|
|
1478
|
-
}
|
|
1479
|
-
}
|
|
1480
|
-
return this;
|
|
1481
|
-
};
|
|
1482
|
-
_proto.startTime = function startTime(value) {
|
|
1483
|
-
if (arguments.length) {
|
|
1484
|
-
this._start = _roundPrecise(value);
|
|
1485
|
-
var parent = this.parent || this._dp;
|
|
1486
|
-
parent && (parent._sort || !this.parent) && _addToTimeline(parent, this, this._start - this._delay);
|
|
1487
|
-
return this;
|
|
1488
|
-
}
|
|
1489
|
-
return this._start;
|
|
1490
|
-
};
|
|
1491
|
-
_proto.endTime = function endTime(includeRepeats) {
|
|
1492
|
-
return this._start + (_isNotFalse(includeRepeats) ? this.totalDuration() : this.duration()) / Math.abs(this._ts || 1);
|
|
1493
|
-
};
|
|
1494
|
-
_proto.rawTime = function rawTime(wrapRepeats) {
|
|
1495
|
-
var parent = this.parent || this._dp;
|
|
1496
|
-
return !parent ? this._tTime : wrapRepeats && (!this._ts || this._repeat && this._time && this.totalProgress() < 1) ? this._tTime % (this._dur + this._rDelay) : !this._ts ? this._tTime : _parentToChildTotalTime(parent.rawTime(wrapRepeats), this);
|
|
1497
|
-
};
|
|
1498
|
-
_proto.revert = function revert(config3) {
|
|
1499
|
-
if (config3 === void 0) {
|
|
1500
|
-
config3 = _revertConfig;
|
|
1501
|
-
}
|
|
1502
|
-
var prevIsReverting = _reverting;
|
|
1503
|
-
_reverting = config3;
|
|
1504
|
-
if (_isRevertWorthy(this)) {
|
|
1505
|
-
this.timeline && this.timeline.revert(config3);
|
|
1506
|
-
this.totalTime(-0.01, config3.suppressEvents);
|
|
1507
|
-
}
|
|
1508
|
-
this.data !== "nested" && config3.kill !== false && this.kill();
|
|
1509
|
-
_reverting = prevIsReverting;
|
|
1510
|
-
return this;
|
|
1511
|
-
};
|
|
1512
|
-
_proto.globalTime = function globalTime(rawTime) {
|
|
1513
|
-
var animation = this, time = arguments.length ? rawTime : animation.rawTime();
|
|
1514
|
-
while (animation) {
|
|
1515
|
-
time = animation._start + time / (Math.abs(animation._ts) || 1);
|
|
1516
|
-
animation = animation._dp;
|
|
1517
|
-
}
|
|
1518
|
-
return !this.parent && this._sat ? this._sat.globalTime(rawTime) : time;
|
|
1519
|
-
};
|
|
1520
|
-
_proto.repeat = function repeat(value) {
|
|
1521
|
-
if (arguments.length) {
|
|
1522
|
-
this._repeat = value === Infinity ? -2 : value;
|
|
1523
|
-
return _onUpdateTotalDuration(this);
|
|
1524
|
-
}
|
|
1525
|
-
return this._repeat === -2 ? Infinity : this._repeat;
|
|
1526
|
-
};
|
|
1527
|
-
_proto.repeatDelay = function repeatDelay(value) {
|
|
1528
|
-
if (arguments.length) {
|
|
1529
|
-
var time = this._time;
|
|
1530
|
-
this._rDelay = value;
|
|
1531
|
-
_onUpdateTotalDuration(this);
|
|
1532
|
-
return time ? this.time(time) : this;
|
|
1533
|
-
}
|
|
1534
|
-
return this._rDelay;
|
|
1535
|
-
};
|
|
1536
|
-
_proto.yoyo = function yoyo(value) {
|
|
1537
|
-
if (arguments.length) {
|
|
1538
|
-
this._yoyo = value;
|
|
1539
|
-
return this;
|
|
1540
|
-
}
|
|
1541
|
-
return this._yoyo;
|
|
1542
|
-
};
|
|
1543
|
-
_proto.seek = function seek(position, suppressEvents) {
|
|
1544
|
-
return this.totalTime(_parsePosition(this, position), _isNotFalse(suppressEvents));
|
|
1545
|
-
};
|
|
1546
|
-
_proto.restart = function restart(includeDelay, suppressEvents) {
|
|
1547
|
-
this.play().totalTime(includeDelay ? -this._delay : 0, _isNotFalse(suppressEvents));
|
|
1548
|
-
this._dur || (this._zTime = -_tinyNum);
|
|
1549
|
-
return this;
|
|
1550
|
-
};
|
|
1551
|
-
_proto.play = function play(from, suppressEvents) {
|
|
1552
|
-
from != null && this.seek(from, suppressEvents);
|
|
1553
|
-
return this.reversed(false).paused(false);
|
|
1554
|
-
};
|
|
1555
|
-
_proto.reverse = function reverse(from, suppressEvents) {
|
|
1556
|
-
from != null && this.seek(from || this.totalDuration(), suppressEvents);
|
|
1557
|
-
return this.reversed(true).paused(false);
|
|
1558
|
-
};
|
|
1559
|
-
_proto.pause = function pause(atTime, suppressEvents) {
|
|
1560
|
-
atTime != null && this.seek(atTime, suppressEvents);
|
|
1561
|
-
return this.paused(true);
|
|
1562
|
-
};
|
|
1563
|
-
_proto.resume = function resume() {
|
|
1564
|
-
return this.paused(false);
|
|
1565
|
-
};
|
|
1566
|
-
_proto.reversed = function reversed(value) {
|
|
1567
|
-
if (arguments.length) {
|
|
1568
|
-
!!value !== this.reversed() && this.timeScale(-this._rts || (value ? -_tinyNum : 0));
|
|
1569
|
-
return this;
|
|
1570
|
-
}
|
|
1571
|
-
return this._rts < 0;
|
|
1572
|
-
};
|
|
1573
|
-
_proto.invalidate = function invalidate() {
|
|
1574
|
-
this._initted = this._act = 0;
|
|
1575
|
-
this._zTime = -_tinyNum;
|
|
1576
|
-
return this;
|
|
1577
|
-
};
|
|
1578
|
-
_proto.isActive = function isActive() {
|
|
1579
|
-
var parent = this.parent || this._dp, start = this._start, rawTime;
|
|
1580
|
-
return !!(!parent || this._ts && this._initted && parent.isActive() && (rawTime = parent.rawTime(true)) >= start && rawTime < this.endTime(true) - _tinyNum);
|
|
1581
|
-
};
|
|
1582
|
-
_proto.eventCallback = function eventCallback(type, callback, params) {
|
|
1583
|
-
var vars = this.vars;
|
|
1584
|
-
if (arguments.length > 1) {
|
|
1585
|
-
if (!callback) {
|
|
1586
|
-
delete vars[type];
|
|
1587
|
-
} else {
|
|
1588
|
-
vars[type] = callback;
|
|
1589
|
-
params && (vars[type + "Params"] = params);
|
|
1590
|
-
type === "onUpdate" && (this._onUpdate = callback);
|
|
1591
|
-
}
|
|
1592
|
-
return this;
|
|
1593
|
-
}
|
|
1594
|
-
return vars[type];
|
|
1595
|
-
};
|
|
1596
|
-
_proto.then = function then(onFulfilled) {
|
|
1597
|
-
var self = this, prevProm = self._prom;
|
|
1598
|
-
return new Promise(function(resolve) {
|
|
1599
|
-
var f = _isFunction(onFulfilled) ? onFulfilled : _passThrough, _resolve = function _resolve2() {
|
|
1600
|
-
var _then = self.then;
|
|
1601
|
-
self.then = null;
|
|
1602
|
-
prevProm && prevProm();
|
|
1603
|
-
_isFunction(f) && (f = f(self)) && (f.then || f === self) && (self.then = _then);
|
|
1604
|
-
resolve(f);
|
|
1605
|
-
self.then = _then;
|
|
1606
|
-
};
|
|
1607
|
-
if (self._initted && self.totalProgress() === 1 && self._ts >= 0 || !self._tTime && self._ts < 0) {
|
|
1608
|
-
_resolve();
|
|
1609
|
-
} else {
|
|
1610
|
-
self._prom = _resolve;
|
|
1611
|
-
}
|
|
1612
|
-
});
|
|
1613
|
-
};
|
|
1614
|
-
_proto.kill = function kill() {
|
|
1615
|
-
_interrupt(this);
|
|
1616
|
-
};
|
|
1617
|
-
return Animation2;
|
|
1618
|
-
})();
|
|
1619
|
-
_setDefaults(Animation.prototype, {
|
|
1620
|
-
_time: 0,
|
|
1621
|
-
_start: 0,
|
|
1622
|
-
_end: 0,
|
|
1623
|
-
_tTime: 0,
|
|
1624
|
-
_tDur: 0,
|
|
1625
|
-
_dirty: 0,
|
|
1626
|
-
_repeat: 0,
|
|
1627
|
-
_yoyo: false,
|
|
1628
|
-
parent: null,
|
|
1629
|
-
_initted: false,
|
|
1630
|
-
_rDelay: 0,
|
|
1631
|
-
_ts: 1,
|
|
1632
|
-
_dp: 0,
|
|
1633
|
-
ratio: 0,
|
|
1634
|
-
_zTime: -_tinyNum,
|
|
1635
|
-
_prom: 0,
|
|
1636
|
-
_ps: false,
|
|
1637
|
-
_rts: 1
|
|
1638
|
-
});
|
|
1639
|
-
var Timeline = /* @__PURE__ */ (function(_Animation) {
|
|
1640
|
-
_inheritsLoose(Timeline2, _Animation);
|
|
1641
|
-
function Timeline2(vars, position) {
|
|
1642
|
-
var _this;
|
|
1643
|
-
if (vars === void 0) {
|
|
1644
|
-
vars = {};
|
|
1645
|
-
}
|
|
1646
|
-
_this = _Animation.call(this, vars) || this;
|
|
1647
|
-
_this.labels = {};
|
|
1648
|
-
_this.smoothChildTiming = !!vars.smoothChildTiming;
|
|
1649
|
-
_this.autoRemoveChildren = !!vars.autoRemoveChildren;
|
|
1650
|
-
_this._sort = _isNotFalse(vars.sortChildren);
|
|
1651
|
-
_globalTimeline && _addToTimeline(vars.parent || _globalTimeline, _assertThisInitialized(_this), position);
|
|
1652
|
-
vars.reversed && _this.reverse();
|
|
1653
|
-
vars.paused && _this.paused(true);
|
|
1654
|
-
vars.scrollTrigger && _scrollTrigger(_assertThisInitialized(_this), vars.scrollTrigger);
|
|
1655
|
-
return _this;
|
|
1656
|
-
}
|
|
1657
|
-
var _proto2 = Timeline2.prototype;
|
|
1658
|
-
_proto2.to = function to(targets, vars, position) {
|
|
1659
|
-
_createTweenType(0, arguments, this);
|
|
1660
|
-
return this;
|
|
1661
|
-
};
|
|
1662
|
-
_proto2.from = function from(targets, vars, position) {
|
|
1663
|
-
_createTweenType(1, arguments, this);
|
|
1664
|
-
return this;
|
|
1665
|
-
};
|
|
1666
|
-
_proto2.fromTo = function fromTo(targets, fromVars, toVars, position) {
|
|
1667
|
-
_createTweenType(2, arguments, this);
|
|
1668
|
-
return this;
|
|
1669
|
-
};
|
|
1670
|
-
_proto2.set = function set(targets, vars, position) {
|
|
1671
|
-
vars.duration = 0;
|
|
1672
|
-
vars.parent = this;
|
|
1673
|
-
_inheritDefaults(vars).repeatDelay || (vars.repeat = 0);
|
|
1674
|
-
vars.immediateRender = !!vars.immediateRender;
|
|
1675
|
-
new Tween(targets, vars, _parsePosition(this, position), 1);
|
|
1676
|
-
return this;
|
|
1677
|
-
};
|
|
1678
|
-
_proto2.call = function call(callback, params, position) {
|
|
1679
|
-
return _addToTimeline(this, Tween.delayedCall(0, callback, params), position);
|
|
1680
|
-
};
|
|
1681
|
-
_proto2.staggerTo = function staggerTo(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams) {
|
|
1682
|
-
vars.duration = duration;
|
|
1683
|
-
vars.stagger = vars.stagger || stagger;
|
|
1684
|
-
vars.onComplete = onCompleteAll;
|
|
1685
|
-
vars.onCompleteParams = onCompleteAllParams;
|
|
1686
|
-
vars.parent = this;
|
|
1687
|
-
new Tween(targets, vars, _parsePosition(this, position));
|
|
1688
|
-
return this;
|
|
1689
|
-
};
|
|
1690
|
-
_proto2.staggerFrom = function staggerFrom(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams) {
|
|
1691
|
-
vars.runBackwards = 1;
|
|
1692
|
-
_inheritDefaults(vars).immediateRender = _isNotFalse(vars.immediateRender);
|
|
1693
|
-
return this.staggerTo(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams);
|
|
1694
|
-
};
|
|
1695
|
-
_proto2.staggerFromTo = function staggerFromTo(targets, duration, fromVars, toVars, stagger, position, onCompleteAll, onCompleteAllParams) {
|
|
1696
|
-
toVars.startAt = fromVars;
|
|
1697
|
-
_inheritDefaults(toVars).immediateRender = _isNotFalse(toVars.immediateRender);
|
|
1698
|
-
return this.staggerTo(targets, duration, toVars, stagger, position, onCompleteAll, onCompleteAllParams);
|
|
1699
|
-
};
|
|
1700
|
-
_proto2.render = function render3(totalTime, suppressEvents, force) {
|
|
1701
|
-
var prevTime = this._time, tDur = this._dirty ? this.totalDuration() : this._tDur, dur = this._dur, tTime = totalTime <= 0 ? 0 : _roundPrecise(totalTime), crossingStart = this._zTime < 0 !== totalTime < 0 && (this._initted || !dur), time, child, next, iteration, cycleDuration, prevPaused, pauseTween, timeScale, prevStart, prevIteration, yoyo, isYoyo;
|
|
1702
|
-
this !== _globalTimeline && tTime > tDur && totalTime >= 0 && (tTime = tDur);
|
|
1703
|
-
if (tTime !== this._tTime || force || crossingStart) {
|
|
1704
|
-
if (prevTime !== this._time && dur) {
|
|
1705
|
-
tTime += this._time - prevTime;
|
|
1706
|
-
totalTime += this._time - prevTime;
|
|
1707
|
-
}
|
|
1708
|
-
time = tTime;
|
|
1709
|
-
prevStart = this._start;
|
|
1710
|
-
timeScale = this._ts;
|
|
1711
|
-
prevPaused = !timeScale;
|
|
1712
|
-
if (crossingStart) {
|
|
1713
|
-
dur || (prevTime = this._zTime);
|
|
1714
|
-
(totalTime || !suppressEvents) && (this._zTime = totalTime);
|
|
1715
|
-
}
|
|
1716
|
-
if (this._repeat) {
|
|
1717
|
-
yoyo = this._yoyo;
|
|
1718
|
-
cycleDuration = dur + this._rDelay;
|
|
1719
|
-
if (this._repeat < -1 && totalTime < 0) {
|
|
1720
|
-
return this.totalTime(cycleDuration * 100 + totalTime, suppressEvents, force);
|
|
1721
|
-
}
|
|
1722
|
-
time = _roundPrecise(tTime % cycleDuration);
|
|
1723
|
-
if (tTime === tDur) {
|
|
1724
|
-
iteration = this._repeat;
|
|
1725
|
-
time = dur;
|
|
1726
|
-
} else {
|
|
1727
|
-
prevIteration = _roundPrecise(tTime / cycleDuration);
|
|
1728
|
-
iteration = ~~prevIteration;
|
|
1729
|
-
if (iteration && iteration === prevIteration) {
|
|
1730
|
-
time = dur;
|
|
1731
|
-
iteration--;
|
|
1732
|
-
}
|
|
1733
|
-
time > dur && (time = dur);
|
|
1734
|
-
}
|
|
1735
|
-
prevIteration = _animationCycle(this._tTime, cycleDuration);
|
|
1736
|
-
!prevTime && this._tTime && prevIteration !== iteration && this._tTime - prevIteration * cycleDuration - this._dur <= 0 && (prevIteration = iteration);
|
|
1737
|
-
if (yoyo && iteration & 1) {
|
|
1738
|
-
time = dur - time;
|
|
1739
|
-
isYoyo = 1;
|
|
1740
|
-
}
|
|
1741
|
-
if (iteration !== prevIteration && !this._lock) {
|
|
1742
|
-
var rewinding = yoyo && prevIteration & 1, doesWrap = rewinding === (yoyo && iteration & 1);
|
|
1743
|
-
iteration < prevIteration && (rewinding = !rewinding);
|
|
1744
|
-
prevTime = rewinding ? 0 : tTime % dur ? dur : tTime;
|
|
1745
|
-
this._lock = 1;
|
|
1746
|
-
this.render(prevTime || (isYoyo ? 0 : _roundPrecise(iteration * cycleDuration)), suppressEvents, !dur)._lock = 0;
|
|
1747
|
-
this._tTime = tTime;
|
|
1748
|
-
!suppressEvents && this.parent && _callback(this, "onRepeat");
|
|
1749
|
-
if (this.vars.repeatRefresh && !isYoyo) {
|
|
1750
|
-
this.invalidate()._lock = 1;
|
|
1751
|
-
prevIteration = iteration;
|
|
1752
|
-
}
|
|
1753
|
-
if (prevTime && prevTime !== this._time || prevPaused !== !this._ts || this.vars.onRepeat && !this.parent && !this._act) {
|
|
1754
|
-
return this;
|
|
1755
|
-
}
|
|
1756
|
-
dur = this._dur;
|
|
1757
|
-
tDur = this._tDur;
|
|
1758
|
-
if (doesWrap) {
|
|
1759
|
-
this._lock = 2;
|
|
1760
|
-
prevTime = rewinding ? dur : -1e-4;
|
|
1761
|
-
this.render(prevTime, true);
|
|
1762
|
-
this.vars.repeatRefresh && !isYoyo && this.invalidate();
|
|
1763
|
-
}
|
|
1764
|
-
this._lock = 0;
|
|
1765
|
-
if (!this._ts && !prevPaused) {
|
|
1766
|
-
return this;
|
|
1767
|
-
}
|
|
1768
|
-
_propagateYoyoEase(this, isYoyo);
|
|
1769
|
-
}
|
|
1770
|
-
}
|
|
1771
|
-
if (this._hasPause && !this._forcing && this._lock < 2) {
|
|
1772
|
-
pauseTween = _findNextPauseTween(this, _roundPrecise(prevTime), _roundPrecise(time));
|
|
1773
|
-
if (pauseTween) {
|
|
1774
|
-
tTime -= time - (time = pauseTween._start);
|
|
1775
|
-
}
|
|
1776
|
-
}
|
|
1777
|
-
this._tTime = tTime;
|
|
1778
|
-
this._time = time;
|
|
1779
|
-
this._act = !timeScale;
|
|
1780
|
-
if (!this._initted) {
|
|
1781
|
-
this._onUpdate = this.vars.onUpdate;
|
|
1782
|
-
this._initted = 1;
|
|
1783
|
-
this._zTime = totalTime;
|
|
1784
|
-
prevTime = 0;
|
|
1785
|
-
}
|
|
1786
|
-
if (!prevTime && tTime && dur && !suppressEvents && !prevIteration) {
|
|
1787
|
-
_callback(this, "onStart");
|
|
1788
|
-
if (this._tTime !== tTime) {
|
|
1789
|
-
return this;
|
|
1790
|
-
}
|
|
1791
|
-
}
|
|
1792
|
-
if (time >= prevTime && totalTime >= 0) {
|
|
1793
|
-
child = this._first;
|
|
1794
|
-
while (child) {
|
|
1795
|
-
next = child._next;
|
|
1796
|
-
if ((child._act || time >= child._start) && child._ts && pauseTween !== child) {
|
|
1797
|
-
if (child.parent !== this) {
|
|
1798
|
-
return this.render(totalTime, suppressEvents, force);
|
|
1799
|
-
}
|
|
1800
|
-
child.render(child._ts > 0 ? (time - child._start) * child._ts : (child._dirty ? child.totalDuration() : child._tDur) + (time - child._start) * child._ts, suppressEvents, force);
|
|
1801
|
-
if (time !== this._time || !this._ts && !prevPaused) {
|
|
1802
|
-
pauseTween = 0;
|
|
1803
|
-
next && (tTime += this._zTime = -_tinyNum);
|
|
1804
|
-
break;
|
|
1805
|
-
}
|
|
1806
|
-
}
|
|
1807
|
-
child = next;
|
|
1808
|
-
}
|
|
1809
|
-
} else {
|
|
1810
|
-
child = this._last;
|
|
1811
|
-
var adjustedTime = totalTime < 0 ? totalTime : time;
|
|
1812
|
-
while (child) {
|
|
1813
|
-
next = child._prev;
|
|
1814
|
-
if ((child._act || adjustedTime <= child._end) && child._ts && pauseTween !== child) {
|
|
1815
|
-
if (child.parent !== this) {
|
|
1816
|
-
return this.render(totalTime, suppressEvents, force);
|
|
1817
|
-
}
|
|
1818
|
-
child.render(child._ts > 0 ? (adjustedTime - child._start) * child._ts : (child._dirty ? child.totalDuration() : child._tDur) + (adjustedTime - child._start) * child._ts, suppressEvents, force || _reverting && _isRevertWorthy(child));
|
|
1819
|
-
if (time !== this._time || !this._ts && !prevPaused) {
|
|
1820
|
-
pauseTween = 0;
|
|
1821
|
-
next && (tTime += this._zTime = adjustedTime ? -_tinyNum : _tinyNum);
|
|
1822
|
-
break;
|
|
1823
|
-
}
|
|
1824
|
-
}
|
|
1825
|
-
child = next;
|
|
1826
|
-
}
|
|
1827
|
-
}
|
|
1828
|
-
if (pauseTween && !suppressEvents) {
|
|
1829
|
-
this.pause();
|
|
1830
|
-
pauseTween.render(time >= prevTime ? 0 : -_tinyNum)._zTime = time >= prevTime ? 1 : -1;
|
|
1831
|
-
if (this._ts) {
|
|
1832
|
-
this._start = prevStart;
|
|
1833
|
-
_setEnd(this);
|
|
1834
|
-
return this.render(totalTime, suppressEvents, force);
|
|
1835
|
-
}
|
|
1836
|
-
}
|
|
1837
|
-
this._onUpdate && !suppressEvents && _callback(this, "onUpdate", true);
|
|
1838
|
-
if (tTime === tDur && this._tTime >= this.totalDuration() || !tTime && prevTime) {
|
|
1839
|
-
if (prevStart === this._start || Math.abs(timeScale) !== Math.abs(this._ts)) {
|
|
1840
|
-
if (!this._lock) {
|
|
1841
|
-
(totalTime || !dur) && (tTime === tDur && this._ts > 0 || !tTime && this._ts < 0) && _removeFromParent(this, 1);
|
|
1842
|
-
if (!suppressEvents && !(totalTime < 0 && !prevTime) && (tTime || prevTime || !tDur)) {
|
|
1843
|
-
_callback(this, tTime === tDur && totalTime >= 0 ? "onComplete" : "onReverseComplete", true);
|
|
1844
|
-
this._prom && !(tTime < tDur && this.timeScale() > 0) && this._prom();
|
|
1845
|
-
}
|
|
1846
|
-
}
|
|
1847
|
-
}
|
|
1848
|
-
}
|
|
1849
|
-
}
|
|
1850
|
-
return this;
|
|
1851
|
-
};
|
|
1852
|
-
_proto2.add = function add(child, position) {
|
|
1853
|
-
var _this2 = this;
|
|
1854
|
-
_isNumber(position) || (position = _parsePosition(this, position, child));
|
|
1855
|
-
if (!(child instanceof Animation)) {
|
|
1856
|
-
if (_isArray(child)) {
|
|
1857
|
-
child.forEach(function(obj) {
|
|
1858
|
-
return _this2.add(obj, position);
|
|
1859
|
-
});
|
|
1860
|
-
return this;
|
|
1861
|
-
}
|
|
1862
|
-
if (_isString(child)) {
|
|
1863
|
-
return this.addLabel(child, position);
|
|
1864
|
-
}
|
|
1865
|
-
if (_isFunction(child)) {
|
|
1866
|
-
child = Tween.delayedCall(0, child);
|
|
1867
|
-
} else {
|
|
1868
|
-
return this;
|
|
1869
|
-
}
|
|
1870
|
-
}
|
|
1871
|
-
return this !== child ? _addToTimeline(this, child, position) : this;
|
|
1872
|
-
};
|
|
1873
|
-
_proto2.getChildren = function getChildren(nested, tweens, timelines, ignoreBeforeTime) {
|
|
1874
|
-
if (nested === void 0) {
|
|
1875
|
-
nested = true;
|
|
1876
|
-
}
|
|
1877
|
-
if (tweens === void 0) {
|
|
1878
|
-
tweens = true;
|
|
1879
|
-
}
|
|
1880
|
-
if (timelines === void 0) {
|
|
1881
|
-
timelines = true;
|
|
1882
|
-
}
|
|
1883
|
-
if (ignoreBeforeTime === void 0) {
|
|
1884
|
-
ignoreBeforeTime = -_bigNum;
|
|
1885
|
-
}
|
|
1886
|
-
var a = [], child = this._first;
|
|
1887
|
-
while (child) {
|
|
1888
|
-
if (child._start >= ignoreBeforeTime) {
|
|
1889
|
-
if (child instanceof Tween) {
|
|
1890
|
-
tweens && a.push(child);
|
|
1891
|
-
} else {
|
|
1892
|
-
timelines && a.push(child);
|
|
1893
|
-
nested && a.push.apply(a, child.getChildren(true, tweens, timelines));
|
|
1894
|
-
}
|
|
1895
|
-
}
|
|
1896
|
-
child = child._next;
|
|
1897
|
-
}
|
|
1898
|
-
return a;
|
|
1899
|
-
};
|
|
1900
|
-
_proto2.getById = function getById2(id) {
|
|
1901
|
-
var animations = this.getChildren(1, 1, 1), i = animations.length;
|
|
1902
|
-
while (i--) {
|
|
1903
|
-
if (animations[i].vars.id === id) {
|
|
1904
|
-
return animations[i];
|
|
1905
|
-
}
|
|
1906
|
-
}
|
|
1907
|
-
};
|
|
1908
|
-
_proto2.remove = function remove(child) {
|
|
1909
|
-
if (_isString(child)) {
|
|
1910
|
-
return this.removeLabel(child);
|
|
1911
|
-
}
|
|
1912
|
-
if (_isFunction(child)) {
|
|
1913
|
-
return this.killTweensOf(child);
|
|
1914
|
-
}
|
|
1915
|
-
child.parent === this && _removeLinkedListItem(this, child);
|
|
1916
|
-
if (child === this._recent) {
|
|
1917
|
-
this._recent = this._last;
|
|
1918
|
-
}
|
|
1919
|
-
return _uncache(this);
|
|
1920
|
-
};
|
|
1921
|
-
_proto2.totalTime = function totalTime(_totalTime2, suppressEvents) {
|
|
1922
|
-
if (!arguments.length) {
|
|
1923
|
-
return this._tTime;
|
|
1924
|
-
}
|
|
1925
|
-
this._forcing = 1;
|
|
1926
|
-
if (!this._dp && this._ts) {
|
|
1927
|
-
this._start = _roundPrecise(_ticker.time - (this._ts > 0 ? _totalTime2 / this._ts : (this.totalDuration() - _totalTime2) / -this._ts));
|
|
1928
|
-
}
|
|
1929
|
-
_Animation.prototype.totalTime.call(this, _totalTime2, suppressEvents);
|
|
1930
|
-
this._forcing = 0;
|
|
1931
|
-
return this;
|
|
1932
|
-
};
|
|
1933
|
-
_proto2.addLabel = function addLabel(label, position) {
|
|
1934
|
-
this.labels[label] = _parsePosition(this, position);
|
|
1935
|
-
return this;
|
|
1936
|
-
};
|
|
1937
|
-
_proto2.removeLabel = function removeLabel(label) {
|
|
1938
|
-
delete this.labels[label];
|
|
1939
|
-
return this;
|
|
1940
|
-
};
|
|
1941
|
-
_proto2.addPause = function addPause(position, callback, params) {
|
|
1942
|
-
var t = Tween.delayedCall(0, callback || _emptyFunc, params);
|
|
1943
|
-
t.data = "isPause";
|
|
1944
|
-
this._hasPause = 1;
|
|
1945
|
-
return _addToTimeline(this, t, _parsePosition(this, position));
|
|
1946
|
-
};
|
|
1947
|
-
_proto2.removePause = function removePause(position) {
|
|
1948
|
-
var child = this._first;
|
|
1949
|
-
position = _parsePosition(this, position);
|
|
1950
|
-
while (child) {
|
|
1951
|
-
if (child._start === position && child.data === "isPause") {
|
|
1952
|
-
_removeFromParent(child);
|
|
1953
|
-
}
|
|
1954
|
-
child = child._next;
|
|
1955
|
-
}
|
|
1956
|
-
};
|
|
1957
|
-
_proto2.killTweensOf = function killTweensOf(targets, props, onlyActive) {
|
|
1958
|
-
var tweens = this.getTweensOf(targets, onlyActive), i = tweens.length;
|
|
1959
|
-
while (i--) {
|
|
1960
|
-
_overwritingTween !== tweens[i] && tweens[i].kill(targets, props);
|
|
1961
|
-
}
|
|
1962
|
-
return this;
|
|
1963
|
-
};
|
|
1964
|
-
_proto2.getTweensOf = function getTweensOf2(targets, onlyActive) {
|
|
1965
|
-
var a = [], parsedTargets = toArray(targets), child = this._first, isGlobalTime = _isNumber(onlyActive), children;
|
|
1966
|
-
while (child) {
|
|
1967
|
-
if (child instanceof Tween) {
|
|
1968
|
-
if (_arrayContainsAny(child._targets, parsedTargets) && (isGlobalTime ? (!_overwritingTween || child._initted && child._ts) && child.globalTime(0) <= onlyActive && child.globalTime(child.totalDuration()) > onlyActive : !onlyActive || child.isActive())) {
|
|
1969
|
-
a.push(child);
|
|
1970
|
-
}
|
|
1971
|
-
} else if ((children = child.getTweensOf(parsedTargets, onlyActive)).length) {
|
|
1972
|
-
a.push.apply(a, children);
|
|
1973
|
-
}
|
|
1974
|
-
child = child._next;
|
|
1975
|
-
}
|
|
1976
|
-
return a;
|
|
1977
|
-
};
|
|
1978
|
-
_proto2.tweenTo = function tweenTo(position, vars) {
|
|
1979
|
-
vars = vars || {};
|
|
1980
|
-
var tl = this, endTime = _parsePosition(tl, position), _vars = vars, startAt = _vars.startAt, _onStart = _vars.onStart, onStartParams = _vars.onStartParams, immediateRender = _vars.immediateRender, initted, tween = Tween.to(tl, _setDefaults({
|
|
1981
|
-
ease: vars.ease || "none",
|
|
1982
|
-
lazy: false,
|
|
1983
|
-
immediateRender: false,
|
|
1984
|
-
time: endTime,
|
|
1985
|
-
overwrite: "auto",
|
|
1986
|
-
duration: vars.duration || Math.abs((endTime - (startAt && "time" in startAt ? startAt.time : tl._time)) / tl.timeScale()) || _tinyNum,
|
|
1987
|
-
onStart: function onStart() {
|
|
1988
|
-
tl.pause();
|
|
1989
|
-
if (!initted) {
|
|
1990
|
-
var duration = vars.duration || Math.abs((endTime - (startAt && "time" in startAt ? startAt.time : tl._time)) / tl.timeScale());
|
|
1991
|
-
tween._dur !== duration && _setDuration(tween, duration, 0, 1).render(tween._time, true, true);
|
|
1992
|
-
initted = 1;
|
|
1993
|
-
}
|
|
1994
|
-
_onStart && _onStart.apply(tween, onStartParams || []);
|
|
1995
|
-
}
|
|
1996
|
-
}, vars));
|
|
1997
|
-
return immediateRender ? tween.render(0) : tween;
|
|
1998
|
-
};
|
|
1999
|
-
_proto2.tweenFromTo = function tweenFromTo(fromPosition, toPosition, vars) {
|
|
2000
|
-
return this.tweenTo(toPosition, _setDefaults({
|
|
2001
|
-
startAt: {
|
|
2002
|
-
time: _parsePosition(this, fromPosition)
|
|
2003
|
-
}
|
|
2004
|
-
}, vars));
|
|
2005
|
-
};
|
|
2006
|
-
_proto2.recent = function recent() {
|
|
2007
|
-
return this._recent;
|
|
2008
|
-
};
|
|
2009
|
-
_proto2.nextLabel = function nextLabel(afterTime) {
|
|
2010
|
-
if (afterTime === void 0) {
|
|
2011
|
-
afterTime = this._time;
|
|
2012
|
-
}
|
|
2013
|
-
return _getLabelInDirection(this, _parsePosition(this, afterTime));
|
|
2014
|
-
};
|
|
2015
|
-
_proto2.previousLabel = function previousLabel(beforeTime) {
|
|
2016
|
-
if (beforeTime === void 0) {
|
|
2017
|
-
beforeTime = this._time;
|
|
2018
|
-
}
|
|
2019
|
-
return _getLabelInDirection(this, _parsePosition(this, beforeTime), 1);
|
|
2020
|
-
};
|
|
2021
|
-
_proto2.currentLabel = function currentLabel(value) {
|
|
2022
|
-
return arguments.length ? this.seek(value, true) : this.previousLabel(this._time + _tinyNum);
|
|
2023
|
-
};
|
|
2024
|
-
_proto2.shiftChildren = function shiftChildren(amount, adjustLabels, ignoreBeforeTime) {
|
|
2025
|
-
if (ignoreBeforeTime === void 0) {
|
|
2026
|
-
ignoreBeforeTime = 0;
|
|
2027
|
-
}
|
|
2028
|
-
var child = this._first, labels = this.labels, p;
|
|
2029
|
-
amount = _roundPrecise(amount);
|
|
2030
|
-
while (child) {
|
|
2031
|
-
if (child._start >= ignoreBeforeTime) {
|
|
2032
|
-
child._start += amount;
|
|
2033
|
-
child._end += amount;
|
|
2034
|
-
}
|
|
2035
|
-
child = child._next;
|
|
2036
|
-
}
|
|
2037
|
-
if (adjustLabels) {
|
|
2038
|
-
for (p in labels) {
|
|
2039
|
-
if (labels[p] >= ignoreBeforeTime) {
|
|
2040
|
-
labels[p] += amount;
|
|
2041
|
-
}
|
|
2042
|
-
}
|
|
2043
|
-
}
|
|
2044
|
-
return _uncache(this);
|
|
2045
|
-
};
|
|
2046
|
-
_proto2.invalidate = function invalidate(soft) {
|
|
2047
|
-
var child = this._first;
|
|
2048
|
-
this._lock = 0;
|
|
2049
|
-
while (child) {
|
|
2050
|
-
child.invalidate(soft);
|
|
2051
|
-
child = child._next;
|
|
2052
|
-
}
|
|
2053
|
-
return _Animation.prototype.invalidate.call(this, soft);
|
|
2054
|
-
};
|
|
2055
|
-
_proto2.clear = function clear(includeLabels) {
|
|
2056
|
-
if (includeLabels === void 0) {
|
|
2057
|
-
includeLabels = true;
|
|
2058
|
-
}
|
|
2059
|
-
var child = this._first, next;
|
|
2060
|
-
while (child) {
|
|
2061
|
-
next = child._next;
|
|
2062
|
-
this.remove(child);
|
|
2063
|
-
child = next;
|
|
2064
|
-
}
|
|
2065
|
-
this._dp && (this._time = this._tTime = this._pTime = 0);
|
|
2066
|
-
includeLabels && (this.labels = {});
|
|
2067
|
-
return _uncache(this);
|
|
2068
|
-
};
|
|
2069
|
-
_proto2.totalDuration = function totalDuration(value) {
|
|
2070
|
-
var max = 0, self = this, child = self._last, prevStart = _bigNum, prev, start, parent;
|
|
2071
|
-
if (arguments.length) {
|
|
2072
|
-
return self.timeScale((self._repeat < 0 ? self.duration() : self.totalDuration()) / (self.reversed() ? -value : value));
|
|
2073
|
-
}
|
|
2074
|
-
if (self._dirty) {
|
|
2075
|
-
parent = self.parent;
|
|
2076
|
-
while (child) {
|
|
2077
|
-
prev = child._prev;
|
|
2078
|
-
child._dirty && child.totalDuration();
|
|
2079
|
-
start = child._start;
|
|
2080
|
-
if (start > prevStart && self._sort && child._ts && !self._lock) {
|
|
2081
|
-
self._lock = 1;
|
|
2082
|
-
_addToTimeline(self, child, start - child._delay, 1)._lock = 0;
|
|
2083
|
-
} else {
|
|
2084
|
-
prevStart = start;
|
|
2085
|
-
}
|
|
2086
|
-
if (start < 0 && child._ts) {
|
|
2087
|
-
max -= start;
|
|
2088
|
-
if (!parent && !self._dp || parent && parent.smoothChildTiming) {
|
|
2089
|
-
self._start += _roundPrecise(start / self._ts);
|
|
2090
|
-
self._time -= start;
|
|
2091
|
-
self._tTime -= start;
|
|
2092
|
-
}
|
|
2093
|
-
self.shiftChildren(-start, false, -Infinity);
|
|
2094
|
-
prevStart = 0;
|
|
2095
|
-
}
|
|
2096
|
-
child._end > max && child._ts && (max = child._end);
|
|
2097
|
-
child = prev;
|
|
2098
|
-
}
|
|
2099
|
-
_setDuration(self, self === _globalTimeline && self._time > max ? self._time : max, 1, 1);
|
|
2100
|
-
self._dirty = 0;
|
|
2101
|
-
}
|
|
2102
|
-
return self._tDur;
|
|
2103
|
-
};
|
|
2104
|
-
Timeline2.updateRoot = function updateRoot(time) {
|
|
2105
|
-
if (_globalTimeline._ts) {
|
|
2106
|
-
_lazySafeRender(_globalTimeline, _parentToChildTotalTime(time, _globalTimeline));
|
|
2107
|
-
_lastRenderedFrame = _ticker.frame;
|
|
2108
|
-
}
|
|
2109
|
-
if (_ticker.frame >= _nextGCFrame) {
|
|
2110
|
-
_nextGCFrame += _config.autoSleep || 120;
|
|
2111
|
-
var child = _globalTimeline._first;
|
|
2112
|
-
if (!child || !child._ts) {
|
|
2113
|
-
if (_config.autoSleep && _ticker._listeners.length < 2) {
|
|
2114
|
-
while (child && !child._ts) {
|
|
2115
|
-
child = child._next;
|
|
2116
|
-
}
|
|
2117
|
-
child || _ticker.sleep();
|
|
2118
|
-
}
|
|
2119
|
-
}
|
|
2120
|
-
}
|
|
2121
|
-
};
|
|
2122
|
-
return Timeline2;
|
|
2123
|
-
})(Animation);
|
|
2124
|
-
_setDefaults(Timeline.prototype, {
|
|
2125
|
-
_lock: 0,
|
|
2126
|
-
_hasPause: 0,
|
|
2127
|
-
_forcing: 0
|
|
2128
|
-
});
|
|
2129
|
-
var _addComplexStringPropTween = function _addComplexStringPropTween2(target, prop, start, end, setter, stringFilter, funcParam) {
|
|
2130
|
-
var pt = new PropTween(this._pt, target, prop, 0, 1, _renderComplexString, null, setter), index = 0, matchIndex = 0, result, startNums, color, endNum, chunk, startNum, hasRandom, a;
|
|
2131
|
-
pt.b = start;
|
|
2132
|
-
pt.e = end;
|
|
2133
|
-
start += "";
|
|
2134
|
-
end += "";
|
|
2135
|
-
if (hasRandom = ~end.indexOf("random(")) {
|
|
2136
|
-
end = _replaceRandom(end);
|
|
2137
|
-
}
|
|
2138
|
-
if (stringFilter) {
|
|
2139
|
-
a = [start, end];
|
|
2140
|
-
stringFilter(a, target, prop);
|
|
2141
|
-
start = a[0];
|
|
2142
|
-
end = a[1];
|
|
2143
|
-
}
|
|
2144
|
-
startNums = start.match(_complexStringNumExp) || [];
|
|
2145
|
-
while (result = _complexStringNumExp.exec(end)) {
|
|
2146
|
-
endNum = result[0];
|
|
2147
|
-
chunk = end.substring(index, result.index);
|
|
2148
|
-
if (color) {
|
|
2149
|
-
color = (color + 1) % 5;
|
|
2150
|
-
} else if (chunk.substr(-5) === "rgba(") {
|
|
2151
|
-
color = 1;
|
|
2152
|
-
}
|
|
2153
|
-
if (endNum !== startNums[matchIndex++]) {
|
|
2154
|
-
startNum = parseFloat(startNums[matchIndex - 1]) || 0;
|
|
2155
|
-
pt._pt = {
|
|
2156
|
-
_next: pt._pt,
|
|
2157
|
-
p: chunk || matchIndex === 1 ? chunk : ",",
|
|
2158
|
-
//note: SVG spec allows omission of comma/space when a negative sign is wedged between two numbers, like 2.5-5.3 instead of 2.5,-5.3 but when tweening, the negative value may switch to positive, so we insert the comma just in case.
|
|
2159
|
-
s: startNum,
|
|
2160
|
-
c: endNum.charAt(1) === "=" ? _parseRelative(startNum, endNum) - startNum : parseFloat(endNum) - startNum,
|
|
2161
|
-
m: color && color < 4 ? Math.round : 0
|
|
2162
|
-
};
|
|
2163
|
-
index = _complexStringNumExp.lastIndex;
|
|
2164
|
-
}
|
|
2165
|
-
}
|
|
2166
|
-
pt.c = index < end.length ? end.substring(index, end.length) : "";
|
|
2167
|
-
pt.fp = funcParam;
|
|
2168
|
-
if (_relExp.test(end) || hasRandom) {
|
|
2169
|
-
pt.e = 0;
|
|
2170
|
-
}
|
|
2171
|
-
this._pt = pt;
|
|
2172
|
-
return pt;
|
|
2173
|
-
};
|
|
2174
|
-
var _addPropTween = function _addPropTween2(target, prop, start, end, index, targets, modifier, stringFilter, funcParam, optional) {
|
|
2175
|
-
_isFunction(end) && (end = end(index || 0, target, targets));
|
|
2176
|
-
var currentValue = target[prop], parsedStart = start !== "get" ? start : !_isFunction(currentValue) ? currentValue : funcParam ? target[prop.indexOf("set") || !_isFunction(target["get" + prop.substr(3)]) ? prop : "get" + prop.substr(3)](funcParam) : target[prop](), setter = !_isFunction(currentValue) ? _setterPlain : funcParam ? _setterFuncWithParam : _setterFunc, pt;
|
|
2177
|
-
if (_isString(end)) {
|
|
2178
|
-
if (~end.indexOf("random(")) {
|
|
2179
|
-
end = _replaceRandom(end);
|
|
2180
|
-
}
|
|
2181
|
-
if (end.charAt(1) === "=") {
|
|
2182
|
-
pt = _parseRelative(parsedStart, end) + (getUnit(parsedStart) || 0);
|
|
2183
|
-
if (pt || pt === 0) {
|
|
2184
|
-
end = pt;
|
|
2185
|
-
}
|
|
2186
|
-
}
|
|
2187
|
-
}
|
|
2188
|
-
if (!optional || parsedStart !== end || _forceAllPropTweens) {
|
|
2189
|
-
if (!isNaN(parsedStart * end) && end !== "") {
|
|
2190
|
-
pt = new PropTween(this._pt, target, prop, +parsedStart || 0, end - (parsedStart || 0), typeof currentValue === "boolean" ? _renderBoolean : _renderPlain, 0, setter);
|
|
2191
|
-
funcParam && (pt.fp = funcParam);
|
|
2192
|
-
modifier && pt.modifier(modifier, this, target);
|
|
2193
|
-
return this._pt = pt;
|
|
2194
|
-
}
|
|
2195
|
-
!currentValue && !(prop in target) && _missingPlugin(prop, end);
|
|
2196
|
-
return _addComplexStringPropTween.call(this, target, prop, parsedStart, end, setter, stringFilter || _config.stringFilter, funcParam);
|
|
2197
|
-
}
|
|
2198
|
-
};
|
|
2199
|
-
var _processVars = function _processVars2(vars, index, target, targets, tween) {
|
|
2200
|
-
_isFunction(vars) && (vars = _parseFuncOrString(vars, tween, index, target, targets));
|
|
2201
|
-
if (!_isObject(vars) || vars.style && vars.nodeType || _isArray(vars) || _isTypedArray(vars)) {
|
|
2202
|
-
return _isString(vars) ? _parseFuncOrString(vars, tween, index, target, targets) : vars;
|
|
2203
|
-
}
|
|
2204
|
-
var copy = {}, p;
|
|
2205
|
-
for (p in vars) {
|
|
2206
|
-
copy[p] = _parseFuncOrString(vars[p], tween, index, target, targets);
|
|
2207
|
-
}
|
|
2208
|
-
return copy;
|
|
2209
|
-
};
|
|
2210
|
-
var _checkPlugin = function _checkPlugin2(property, vars, tween, index, target, targets) {
|
|
2211
|
-
var plugin, pt, ptLookup, i;
|
|
2212
|
-
if (_plugins[property] && (plugin = new _plugins[property]()).init(target, plugin.rawVars ? vars[property] : _processVars(vars[property], index, target, targets, tween), tween, index, targets) !== false) {
|
|
2213
|
-
tween._pt = pt = new PropTween(tween._pt, target, property, 0, 1, plugin.render, plugin, 0, plugin.priority);
|
|
2214
|
-
if (tween !== _quickTween) {
|
|
2215
|
-
ptLookup = tween._ptLookup[tween._targets.indexOf(target)];
|
|
2216
|
-
i = plugin._props.length;
|
|
2217
|
-
while (i--) {
|
|
2218
|
-
ptLookup[plugin._props[i]] = pt;
|
|
2219
|
-
}
|
|
2220
|
-
}
|
|
2221
|
-
}
|
|
2222
|
-
return plugin;
|
|
2223
|
-
};
|
|
2224
|
-
var _overwritingTween;
|
|
2225
|
-
var _forceAllPropTweens;
|
|
2226
|
-
var _initTween = function _initTween2(tween, time, tTime) {
|
|
2227
|
-
var vars = tween.vars, ease = vars.ease, startAt = vars.startAt, immediateRender = vars.immediateRender, lazy = vars.lazy, onUpdate = vars.onUpdate, runBackwards = vars.runBackwards, yoyoEase = vars.yoyoEase, keyframes = vars.keyframes, autoRevert = vars.autoRevert, dur = tween._dur, prevStartAt = tween._startAt, targets = tween._targets, parent = tween.parent, fullTargets = parent && parent.data === "nested" ? parent.vars.targets : targets, autoOverwrite = tween._overwrite === "auto" && !_suppressOverwrites, tl = tween.timeline, cleanVars, i, p, pt, target, hasPriority, gsData, harness, plugin, ptLookup, index, harnessVars, overwritten;
|
|
2228
|
-
tl && (!keyframes || !ease) && (ease = "none");
|
|
2229
|
-
tween._ease = _parseEase(ease, _defaults.ease);
|
|
2230
|
-
tween._yEase = yoyoEase ? _invertEase(_parseEase(yoyoEase === true ? ease : yoyoEase, _defaults.ease)) : 0;
|
|
2231
|
-
if (yoyoEase && tween._yoyo && !tween._repeat) {
|
|
2232
|
-
yoyoEase = tween._yEase;
|
|
2233
|
-
tween._yEase = tween._ease;
|
|
2234
|
-
tween._ease = yoyoEase;
|
|
2235
|
-
}
|
|
2236
|
-
tween._from = !tl && !!vars.runBackwards;
|
|
2237
|
-
if (!tl || keyframes && !vars.stagger) {
|
|
2238
|
-
harness = targets[0] ? _getCache(targets[0]).harness : 0;
|
|
2239
|
-
harnessVars = harness && vars[harness.prop];
|
|
2240
|
-
cleanVars = _copyExcluding(vars, _reservedProps);
|
|
2241
|
-
if (prevStartAt) {
|
|
2242
|
-
prevStartAt._zTime < 0 && prevStartAt.progress(1);
|
|
2243
|
-
time < 0 && runBackwards && immediateRender && !autoRevert ? prevStartAt.render(-1, true) : prevStartAt.revert(runBackwards && dur ? _revertConfigNoKill : _startAtRevertConfig);
|
|
2244
|
-
prevStartAt._lazy = 0;
|
|
2245
|
-
}
|
|
2246
|
-
if (startAt) {
|
|
2247
|
-
_removeFromParent(tween._startAt = Tween.set(targets, _setDefaults({
|
|
2248
|
-
data: "isStart",
|
|
2249
|
-
overwrite: false,
|
|
2250
|
-
parent,
|
|
2251
|
-
immediateRender: true,
|
|
2252
|
-
lazy: !prevStartAt && _isNotFalse(lazy),
|
|
2253
|
-
startAt: null,
|
|
2254
|
-
delay: 0,
|
|
2255
|
-
onUpdate: onUpdate && function() {
|
|
2256
|
-
return _callback(tween, "onUpdate");
|
|
2257
|
-
},
|
|
2258
|
-
stagger: 0
|
|
2259
|
-
}, startAt)));
|
|
2260
|
-
tween._startAt._dp = 0;
|
|
2261
|
-
tween._startAt._sat = tween;
|
|
2262
|
-
time < 0 && (_reverting || !immediateRender && !autoRevert) && tween._startAt.revert(_revertConfigNoKill);
|
|
2263
|
-
if (immediateRender) {
|
|
2264
|
-
if (dur && time <= 0 && tTime <= 0) {
|
|
2265
|
-
time && (tween._zTime = time);
|
|
2266
|
-
return;
|
|
2267
|
-
}
|
|
2268
|
-
}
|
|
2269
|
-
} else if (runBackwards && dur) {
|
|
2270
|
-
if (!prevStartAt) {
|
|
2271
|
-
time && (immediateRender = false);
|
|
2272
|
-
p = _setDefaults({
|
|
2273
|
-
overwrite: false,
|
|
2274
|
-
data: "isFromStart",
|
|
2275
|
-
//we tag the tween with as "isFromStart" so that if [inside a plugin] we need to only do something at the very END of a tween, we have a way of identifying this tween as merely the one that's setting the beginning values for a "from()" tween. For example, clearProps in CSSPlugin should only get applied at the very END of a tween and without this tag, from(...{height:100, clearProps:"height", delay:1}) would wipe the height at the beginning of the tween and after 1 second, it'd kick back in.
|
|
2276
|
-
lazy: immediateRender && !prevStartAt && _isNotFalse(lazy),
|
|
2277
|
-
immediateRender,
|
|
2278
|
-
//zero-duration tweens render immediately by default, but if we're not specifically instructed to render this tween immediately, we should skip this and merely _init() to record the starting values (rendering them immediately would push them to completion which is wasteful in that case - we'd have to render(-1) immediately after)
|
|
2279
|
-
stagger: 0,
|
|
2280
|
-
parent
|
|
2281
|
-
//ensures that nested tweens that had a stagger are handled properly, like gsap.from(".class", {y: gsap.utils.wrap([-100,100]), stagger: 0.5})
|
|
2282
|
-
}, cleanVars);
|
|
2283
|
-
harnessVars && (p[harness.prop] = harnessVars);
|
|
2284
|
-
_removeFromParent(tween._startAt = Tween.set(targets, p));
|
|
2285
|
-
tween._startAt._dp = 0;
|
|
2286
|
-
tween._startAt._sat = tween;
|
|
2287
|
-
time < 0 && (_reverting ? tween._startAt.revert(_revertConfigNoKill) : tween._startAt.render(-1, true));
|
|
2288
|
-
tween._zTime = time;
|
|
2289
|
-
if (!immediateRender) {
|
|
2290
|
-
_initTween2(tween._startAt, _tinyNum, _tinyNum);
|
|
2291
|
-
} else if (!time) {
|
|
2292
|
-
return;
|
|
2293
|
-
}
|
|
2294
|
-
}
|
|
2295
|
-
}
|
|
2296
|
-
tween._pt = tween._ptCache = 0;
|
|
2297
|
-
lazy = dur && _isNotFalse(lazy) || lazy && !dur;
|
|
2298
|
-
for (i = 0; i < targets.length; i++) {
|
|
2299
|
-
target = targets[i];
|
|
2300
|
-
gsData = target._gsap || _harness(targets)[i]._gsap;
|
|
2301
|
-
tween._ptLookup[i] = ptLookup = {};
|
|
2302
|
-
_lazyLookup[gsData.id] && _lazyTweens.length && _lazyRender();
|
|
2303
|
-
index = fullTargets === targets ? i : fullTargets.indexOf(target);
|
|
2304
|
-
if (harness && (plugin = new harness()).init(target, harnessVars || cleanVars, tween, index, fullTargets) !== false) {
|
|
2305
|
-
tween._pt = pt = new PropTween(tween._pt, target, plugin.name, 0, 1, plugin.render, plugin, 0, plugin.priority);
|
|
2306
|
-
plugin._props.forEach(function(name) {
|
|
2307
|
-
ptLookup[name] = pt;
|
|
2308
|
-
});
|
|
2309
|
-
plugin.priority && (hasPriority = 1);
|
|
2310
|
-
}
|
|
2311
|
-
if (!harness || harnessVars) {
|
|
2312
|
-
for (p in cleanVars) {
|
|
2313
|
-
if (_plugins[p] && (plugin = _checkPlugin(p, cleanVars, tween, index, target, fullTargets))) {
|
|
2314
|
-
plugin.priority && (hasPriority = 1);
|
|
2315
|
-
} else {
|
|
2316
|
-
ptLookup[p] = pt = _addPropTween.call(tween, target, p, "get", cleanVars[p], index, fullTargets, 0, vars.stringFilter);
|
|
2317
|
-
}
|
|
2318
|
-
}
|
|
2319
|
-
}
|
|
2320
|
-
tween._op && tween._op[i] && tween.kill(target, tween._op[i]);
|
|
2321
|
-
if (autoOverwrite && tween._pt) {
|
|
2322
|
-
_overwritingTween = tween;
|
|
2323
|
-
_globalTimeline.killTweensOf(target, ptLookup, tween.globalTime(time));
|
|
2324
|
-
overwritten = !tween.parent;
|
|
2325
|
-
_overwritingTween = 0;
|
|
2326
|
-
}
|
|
2327
|
-
tween._pt && lazy && (_lazyLookup[gsData.id] = 1);
|
|
2328
|
-
}
|
|
2329
|
-
hasPriority && _sortPropTweensByPriority(tween);
|
|
2330
|
-
tween._onInit && tween._onInit(tween);
|
|
2331
|
-
}
|
|
2332
|
-
tween._onUpdate = onUpdate;
|
|
2333
|
-
tween._initted = (!tween._op || tween._pt) && !overwritten;
|
|
2334
|
-
keyframes && time <= 0 && tl.render(_bigNum, true, true);
|
|
2335
|
-
};
|
|
2336
|
-
var _updatePropTweens = function _updatePropTweens2(tween, property, value, start, startIsRelative, ratio, time, skipRecursion) {
|
|
2337
|
-
var ptCache = (tween._pt && tween._ptCache || (tween._ptCache = {}))[property], pt, rootPT, lookup, i;
|
|
2338
|
-
if (!ptCache) {
|
|
2339
|
-
ptCache = tween._ptCache[property] = [];
|
|
2340
|
-
lookup = tween._ptLookup;
|
|
2341
|
-
i = tween._targets.length;
|
|
2342
|
-
while (i--) {
|
|
2343
|
-
pt = lookup[i][property];
|
|
2344
|
-
if (pt && pt.d && pt.d._pt) {
|
|
2345
|
-
pt = pt.d._pt;
|
|
2346
|
-
while (pt && pt.p !== property && pt.fp !== property) {
|
|
2347
|
-
pt = pt._next;
|
|
2348
|
-
}
|
|
2349
|
-
}
|
|
2350
|
-
if (!pt) {
|
|
2351
|
-
_forceAllPropTweens = 1;
|
|
2352
|
-
tween.vars[property] = "+=0";
|
|
2353
|
-
_initTween(tween, time);
|
|
2354
|
-
_forceAllPropTweens = 0;
|
|
2355
|
-
return skipRecursion ? _warn(property + " not eligible for reset") : 1;
|
|
2356
|
-
}
|
|
2357
|
-
ptCache.push(pt);
|
|
2358
|
-
}
|
|
2359
|
-
}
|
|
2360
|
-
i = ptCache.length;
|
|
2361
|
-
while (i--) {
|
|
2362
|
-
rootPT = ptCache[i];
|
|
2363
|
-
pt = rootPT._pt || rootPT;
|
|
2364
|
-
pt.s = (start || start === 0) && !startIsRelative ? start : pt.s + (start || 0) + ratio * pt.c;
|
|
2365
|
-
pt.c = value - pt.s;
|
|
2366
|
-
rootPT.e && (rootPT.e = _round(value) + getUnit(rootPT.e));
|
|
2367
|
-
rootPT.b && (rootPT.b = pt.s + getUnit(rootPT.b));
|
|
2368
|
-
}
|
|
2369
|
-
};
|
|
2370
|
-
var _addAliasesToVars = function _addAliasesToVars2(targets, vars) {
|
|
2371
|
-
var harness = targets[0] ? _getCache(targets[0]).harness : 0, propertyAliases = harness && harness.aliases, copy, p, i, aliases;
|
|
2372
|
-
if (!propertyAliases) {
|
|
2373
|
-
return vars;
|
|
2374
|
-
}
|
|
2375
|
-
copy = _merge({}, vars);
|
|
2376
|
-
for (p in propertyAliases) {
|
|
2377
|
-
if (p in copy) {
|
|
2378
|
-
aliases = propertyAliases[p].split(",");
|
|
2379
|
-
i = aliases.length;
|
|
2380
|
-
while (i--) {
|
|
2381
|
-
copy[aliases[i]] = copy[p];
|
|
2382
|
-
}
|
|
2383
|
-
}
|
|
2384
|
-
}
|
|
2385
|
-
return copy;
|
|
2386
|
-
};
|
|
2387
|
-
var _parseKeyframe = function _parseKeyframe2(prop, obj, allProps, easeEach) {
|
|
2388
|
-
var ease = obj.ease || easeEach || "power1.inOut", p, a;
|
|
2389
|
-
if (_isArray(obj)) {
|
|
2390
|
-
a = allProps[prop] || (allProps[prop] = []);
|
|
2391
|
-
obj.forEach(function(value, i) {
|
|
2392
|
-
return a.push({
|
|
2393
|
-
t: i / (obj.length - 1) * 100,
|
|
2394
|
-
v: value,
|
|
2395
|
-
e: ease
|
|
2396
|
-
});
|
|
2397
|
-
});
|
|
2398
|
-
} else {
|
|
2399
|
-
for (p in obj) {
|
|
2400
|
-
a = allProps[p] || (allProps[p] = []);
|
|
2401
|
-
p === "ease" || a.push({
|
|
2402
|
-
t: parseFloat(prop),
|
|
2403
|
-
v: obj[p],
|
|
2404
|
-
e: ease
|
|
2405
|
-
});
|
|
2406
|
-
}
|
|
2407
|
-
}
|
|
2408
|
-
};
|
|
2409
|
-
var _parseFuncOrString = function _parseFuncOrString2(value, tween, i, target, targets) {
|
|
2410
|
-
return _isFunction(value) ? value.call(tween, i, target, targets) : _isString(value) && ~value.indexOf("random(") ? _replaceRandom(value) : value;
|
|
2411
|
-
};
|
|
2412
|
-
var _staggerTweenProps = _callbackNames + "repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert";
|
|
2413
|
-
var _staggerPropsToSkip = {};
|
|
2414
|
-
_forEachName(_staggerTweenProps + ",id,stagger,delay,duration,paused,scrollTrigger", function(name) {
|
|
2415
|
-
return _staggerPropsToSkip[name] = 1;
|
|
2416
|
-
});
|
|
2417
|
-
var Tween = /* @__PURE__ */ (function(_Animation2) {
|
|
2418
|
-
_inheritsLoose(Tween2, _Animation2);
|
|
2419
|
-
function Tween2(targets, vars, position, skipInherit) {
|
|
2420
|
-
var _this3;
|
|
2421
|
-
if (typeof vars === "number") {
|
|
2422
|
-
position.duration = vars;
|
|
2423
|
-
vars = position;
|
|
2424
|
-
position = null;
|
|
2425
|
-
}
|
|
2426
|
-
_this3 = _Animation2.call(this, skipInherit ? vars : _inheritDefaults(vars)) || this;
|
|
2427
|
-
var _this3$vars = _this3.vars, duration = _this3$vars.duration, delay = _this3$vars.delay, immediateRender = _this3$vars.immediateRender, stagger = _this3$vars.stagger, overwrite = _this3$vars.overwrite, keyframes = _this3$vars.keyframes, defaults2 = _this3$vars.defaults, scrollTrigger = _this3$vars.scrollTrigger, yoyoEase = _this3$vars.yoyoEase, parent = vars.parent || _globalTimeline, parsedTargets = (_isArray(targets) || _isTypedArray(targets) ? _isNumber(targets[0]) : "length" in vars) ? [targets] : toArray(targets), tl, i, copy, l, p, curTarget, staggerFunc, staggerVarsToMerge;
|
|
2428
|
-
_this3._targets = parsedTargets.length ? _harness(parsedTargets) : _warn("GSAP target " + targets + " not found. https://gsap.com", !_config.nullTargetWarn) || [];
|
|
2429
|
-
_this3._ptLookup = [];
|
|
2430
|
-
_this3._overwrite = overwrite;
|
|
2431
|
-
if (keyframes || stagger || _isFuncOrString(duration) || _isFuncOrString(delay)) {
|
|
2432
|
-
vars = _this3.vars;
|
|
2433
|
-
tl = _this3.timeline = new Timeline({
|
|
2434
|
-
data: "nested",
|
|
2435
|
-
defaults: defaults2 || {},
|
|
2436
|
-
targets: parent && parent.data === "nested" ? parent.vars.targets : parsedTargets
|
|
2437
|
-
});
|
|
2438
|
-
tl.kill();
|
|
2439
|
-
tl.parent = tl._dp = _assertThisInitialized(_this3);
|
|
2440
|
-
tl._start = 0;
|
|
2441
|
-
if (stagger || _isFuncOrString(duration) || _isFuncOrString(delay)) {
|
|
2442
|
-
l = parsedTargets.length;
|
|
2443
|
-
staggerFunc = stagger && distribute(stagger);
|
|
2444
|
-
if (_isObject(stagger)) {
|
|
2445
|
-
for (p in stagger) {
|
|
2446
|
-
if (~_staggerTweenProps.indexOf(p)) {
|
|
2447
|
-
staggerVarsToMerge || (staggerVarsToMerge = {});
|
|
2448
|
-
staggerVarsToMerge[p] = stagger[p];
|
|
2449
|
-
}
|
|
2450
|
-
}
|
|
2451
|
-
}
|
|
2452
|
-
for (i = 0; i < l; i++) {
|
|
2453
|
-
copy = _copyExcluding(vars, _staggerPropsToSkip);
|
|
2454
|
-
copy.stagger = 0;
|
|
2455
|
-
yoyoEase && (copy.yoyoEase = yoyoEase);
|
|
2456
|
-
staggerVarsToMerge && _merge(copy, staggerVarsToMerge);
|
|
2457
|
-
curTarget = parsedTargets[i];
|
|
2458
|
-
copy.duration = +_parseFuncOrString(duration, _assertThisInitialized(_this3), i, curTarget, parsedTargets);
|
|
2459
|
-
copy.delay = (+_parseFuncOrString(delay, _assertThisInitialized(_this3), i, curTarget, parsedTargets) || 0) - _this3._delay;
|
|
2460
|
-
if (!stagger && l === 1 && copy.delay) {
|
|
2461
|
-
_this3._delay = delay = copy.delay;
|
|
2462
|
-
_this3._start += delay;
|
|
2463
|
-
copy.delay = 0;
|
|
2464
|
-
}
|
|
2465
|
-
tl.to(curTarget, copy, staggerFunc ? staggerFunc(i, curTarget, parsedTargets) : 0);
|
|
2466
|
-
tl._ease = _easeMap.none;
|
|
2467
|
-
}
|
|
2468
|
-
tl.duration() ? duration = delay = 0 : _this3.timeline = 0;
|
|
2469
|
-
} else if (keyframes) {
|
|
2470
|
-
_inheritDefaults(_setDefaults(tl.vars.defaults, {
|
|
2471
|
-
ease: "none"
|
|
2472
|
-
}));
|
|
2473
|
-
tl._ease = _parseEase(keyframes.ease || vars.ease || "none");
|
|
2474
|
-
var time = 0, a, kf, v;
|
|
2475
|
-
if (_isArray(keyframes)) {
|
|
2476
|
-
keyframes.forEach(function(frame) {
|
|
2477
|
-
return tl.to(parsedTargets, frame, ">");
|
|
2478
|
-
});
|
|
2479
|
-
tl.duration();
|
|
2480
|
-
} else {
|
|
2481
|
-
copy = {};
|
|
2482
|
-
for (p in keyframes) {
|
|
2483
|
-
p === "ease" || p === "easeEach" || _parseKeyframe(p, keyframes[p], copy, keyframes.easeEach);
|
|
2484
|
-
}
|
|
2485
|
-
for (p in copy) {
|
|
2486
|
-
a = copy[p].sort(function(a2, b) {
|
|
2487
|
-
return a2.t - b.t;
|
|
2488
|
-
});
|
|
2489
|
-
time = 0;
|
|
2490
|
-
for (i = 0; i < a.length; i++) {
|
|
2491
|
-
kf = a[i];
|
|
2492
|
-
v = {
|
|
2493
|
-
ease: kf.e,
|
|
2494
|
-
duration: (kf.t - (i ? a[i - 1].t : 0)) / 100 * duration
|
|
2495
|
-
};
|
|
2496
|
-
v[p] = kf.v;
|
|
2497
|
-
tl.to(parsedTargets, v, time);
|
|
2498
|
-
time += v.duration;
|
|
2499
|
-
}
|
|
2500
|
-
}
|
|
2501
|
-
tl.duration() < duration && tl.to({}, {
|
|
2502
|
-
duration: duration - tl.duration()
|
|
2503
|
-
});
|
|
2504
|
-
}
|
|
2505
|
-
}
|
|
2506
|
-
duration || _this3.duration(duration = tl.duration());
|
|
2507
|
-
} else {
|
|
2508
|
-
_this3.timeline = 0;
|
|
2509
|
-
}
|
|
2510
|
-
if (overwrite === true && !_suppressOverwrites) {
|
|
2511
|
-
_overwritingTween = _assertThisInitialized(_this3);
|
|
2512
|
-
_globalTimeline.killTweensOf(parsedTargets);
|
|
2513
|
-
_overwritingTween = 0;
|
|
2514
|
-
}
|
|
2515
|
-
_addToTimeline(parent, _assertThisInitialized(_this3), position);
|
|
2516
|
-
vars.reversed && _this3.reverse();
|
|
2517
|
-
vars.paused && _this3.paused(true);
|
|
2518
|
-
if (immediateRender || !duration && !keyframes && _this3._start === _roundPrecise(parent._time) && _isNotFalse(immediateRender) && _hasNoPausedAncestors(_assertThisInitialized(_this3)) && parent.data !== "nested") {
|
|
2519
|
-
_this3._tTime = -_tinyNum;
|
|
2520
|
-
_this3.render(Math.max(0, -delay) || 0);
|
|
2521
|
-
}
|
|
2522
|
-
scrollTrigger && _scrollTrigger(_assertThisInitialized(_this3), scrollTrigger);
|
|
2523
|
-
return _this3;
|
|
2524
|
-
}
|
|
2525
|
-
var _proto3 = Tween2.prototype;
|
|
2526
|
-
_proto3.render = function render3(totalTime, suppressEvents, force) {
|
|
2527
|
-
var prevTime = this._time, tDur = this._tDur, dur = this._dur, isNegative = totalTime < 0, tTime = totalTime > tDur - _tinyNum && !isNegative ? tDur : totalTime < _tinyNum ? 0 : totalTime, time, pt, iteration, cycleDuration, prevIteration, isYoyo, ratio, timeline2, yoyoEase;
|
|
2528
|
-
if (!dur) {
|
|
2529
|
-
_renderZeroDurationTween(this, totalTime, suppressEvents, force);
|
|
2530
|
-
} else if (tTime !== this._tTime || !totalTime || force || !this._initted && this._tTime || this._startAt && this._zTime < 0 !== isNegative || this._lazy) {
|
|
2531
|
-
time = tTime;
|
|
2532
|
-
timeline2 = this.timeline;
|
|
2533
|
-
if (this._repeat) {
|
|
2534
|
-
cycleDuration = dur + this._rDelay;
|
|
2535
|
-
if (this._repeat < -1 && isNegative) {
|
|
2536
|
-
return this.totalTime(cycleDuration * 100 + totalTime, suppressEvents, force);
|
|
2537
|
-
}
|
|
2538
|
-
time = _roundPrecise(tTime % cycleDuration);
|
|
2539
|
-
if (tTime === tDur) {
|
|
2540
|
-
iteration = this._repeat;
|
|
2541
|
-
time = dur;
|
|
2542
|
-
} else {
|
|
2543
|
-
prevIteration = _roundPrecise(tTime / cycleDuration);
|
|
2544
|
-
iteration = ~~prevIteration;
|
|
2545
|
-
if (iteration && iteration === prevIteration) {
|
|
2546
|
-
time = dur;
|
|
2547
|
-
iteration--;
|
|
2548
|
-
} else if (time > dur) {
|
|
2549
|
-
time = dur;
|
|
2550
|
-
}
|
|
2551
|
-
}
|
|
2552
|
-
isYoyo = this._yoyo && iteration & 1;
|
|
2553
|
-
if (isYoyo) {
|
|
2554
|
-
yoyoEase = this._yEase;
|
|
2555
|
-
time = dur - time;
|
|
2556
|
-
}
|
|
2557
|
-
prevIteration = _animationCycle(this._tTime, cycleDuration);
|
|
2558
|
-
if (time === prevTime && !force && this._initted && iteration === prevIteration) {
|
|
2559
|
-
this._tTime = tTime;
|
|
2560
|
-
return this;
|
|
2561
|
-
}
|
|
2562
|
-
if (iteration !== prevIteration) {
|
|
2563
|
-
timeline2 && this._yEase && _propagateYoyoEase(timeline2, isYoyo);
|
|
2564
|
-
if (this.vars.repeatRefresh && !isYoyo && !this._lock && time !== cycleDuration && this._initted) {
|
|
2565
|
-
this._lock = force = 1;
|
|
2566
|
-
this.render(_roundPrecise(cycleDuration * iteration), true).invalidate()._lock = 0;
|
|
2567
|
-
}
|
|
2568
|
-
}
|
|
2569
|
-
}
|
|
2570
|
-
if (!this._initted) {
|
|
2571
|
-
if (_attemptInitTween(this, isNegative ? totalTime : time, force, suppressEvents, tTime)) {
|
|
2572
|
-
this._tTime = 0;
|
|
2573
|
-
return this;
|
|
2574
|
-
}
|
|
2575
|
-
if (prevTime !== this._time && !(force && this.vars.repeatRefresh && iteration !== prevIteration)) {
|
|
2576
|
-
return this;
|
|
2577
|
-
}
|
|
2578
|
-
if (dur !== this._dur) {
|
|
2579
|
-
return this.render(totalTime, suppressEvents, force);
|
|
2580
|
-
}
|
|
2581
|
-
}
|
|
2582
|
-
this._tTime = tTime;
|
|
2583
|
-
this._time = time;
|
|
2584
|
-
if (!this._act && this._ts) {
|
|
2585
|
-
this._act = 1;
|
|
2586
|
-
this._lazy = 0;
|
|
2587
|
-
}
|
|
2588
|
-
this.ratio = ratio = (yoyoEase || this._ease)(time / dur);
|
|
2589
|
-
if (this._from) {
|
|
2590
|
-
this.ratio = ratio = 1 - ratio;
|
|
2591
|
-
}
|
|
2592
|
-
if (!prevTime && tTime && !suppressEvents && !prevIteration) {
|
|
2593
|
-
_callback(this, "onStart");
|
|
2594
|
-
if (this._tTime !== tTime) {
|
|
2595
|
-
return this;
|
|
2596
|
-
}
|
|
2597
|
-
}
|
|
2598
|
-
pt = this._pt;
|
|
2599
|
-
while (pt) {
|
|
2600
|
-
pt.r(ratio, pt.d);
|
|
2601
|
-
pt = pt._next;
|
|
2602
|
-
}
|
|
2603
|
-
timeline2 && timeline2.render(totalTime < 0 ? totalTime : timeline2._dur * timeline2._ease(time / this._dur), suppressEvents, force) || this._startAt && (this._zTime = totalTime);
|
|
2604
|
-
if (this._onUpdate && !suppressEvents) {
|
|
2605
|
-
isNegative && _rewindStartAt(this, totalTime, suppressEvents, force);
|
|
2606
|
-
_callback(this, "onUpdate");
|
|
2607
|
-
}
|
|
2608
|
-
this._repeat && iteration !== prevIteration && this.vars.onRepeat && !suppressEvents && this.parent && _callback(this, "onRepeat");
|
|
2609
|
-
if ((tTime === this._tDur || !tTime) && this._tTime === tTime) {
|
|
2610
|
-
isNegative && !this._onUpdate && _rewindStartAt(this, totalTime, true, true);
|
|
2611
|
-
(totalTime || !dur) && (tTime === this._tDur && this._ts > 0 || !tTime && this._ts < 0) && _removeFromParent(this, 1);
|
|
2612
|
-
if (!suppressEvents && !(isNegative && !prevTime) && (tTime || prevTime || isYoyo)) {
|
|
2613
|
-
_callback(this, tTime === tDur ? "onComplete" : "onReverseComplete", true);
|
|
2614
|
-
this._prom && !(tTime < tDur && this.timeScale() > 0) && this._prom();
|
|
2615
|
-
}
|
|
2616
|
-
}
|
|
2617
|
-
}
|
|
2618
|
-
return this;
|
|
2619
|
-
};
|
|
2620
|
-
_proto3.targets = function targets() {
|
|
2621
|
-
return this._targets;
|
|
2622
|
-
};
|
|
2623
|
-
_proto3.invalidate = function invalidate(soft) {
|
|
2624
|
-
(!soft || !this.vars.runBackwards) && (this._startAt = 0);
|
|
2625
|
-
this._pt = this._op = this._onUpdate = this._lazy = this.ratio = 0;
|
|
2626
|
-
this._ptLookup = [];
|
|
2627
|
-
this.timeline && this.timeline.invalidate(soft);
|
|
2628
|
-
return _Animation2.prototype.invalidate.call(this, soft);
|
|
2629
|
-
};
|
|
2630
|
-
_proto3.resetTo = function resetTo(property, value, start, startIsRelative, skipRecursion) {
|
|
2631
|
-
_tickerActive || _ticker.wake();
|
|
2632
|
-
this._ts || this.play();
|
|
2633
|
-
var time = Math.min(this._dur, (this._dp._time - this._start) * this._ts), ratio;
|
|
2634
|
-
this._initted || _initTween(this, time);
|
|
2635
|
-
ratio = this._ease(time / this._dur);
|
|
2636
|
-
if (_updatePropTweens(this, property, value, start, startIsRelative, ratio, time, skipRecursion)) {
|
|
2637
|
-
return this.resetTo(property, value, start, startIsRelative, 1);
|
|
2638
|
-
}
|
|
2639
|
-
_alignPlayhead(this, 0);
|
|
2640
|
-
this.parent || _addLinkedListItem(this._dp, this, "_first", "_last", this._dp._sort ? "_start" : 0);
|
|
2641
|
-
return this.render(0);
|
|
2642
|
-
};
|
|
2643
|
-
_proto3.kill = function kill(targets, vars) {
|
|
2644
|
-
if (vars === void 0) {
|
|
2645
|
-
vars = "all";
|
|
2646
|
-
}
|
|
2647
|
-
if (!targets && (!vars || vars === "all")) {
|
|
2648
|
-
this._lazy = this._pt = 0;
|
|
2649
|
-
this.parent ? _interrupt(this) : this.scrollTrigger && this.scrollTrigger.kill(!!_reverting);
|
|
2650
|
-
return this;
|
|
2651
|
-
}
|
|
2652
|
-
if (this.timeline) {
|
|
2653
|
-
var tDur = this.timeline.totalDuration();
|
|
2654
|
-
this.timeline.killTweensOf(targets, vars, _overwritingTween && _overwritingTween.vars.overwrite !== true)._first || _interrupt(this);
|
|
2655
|
-
this.parent && tDur !== this.timeline.totalDuration() && _setDuration(this, this._dur * this.timeline._tDur / tDur, 0, 1);
|
|
2656
|
-
return this;
|
|
2657
|
-
}
|
|
2658
|
-
var parsedTargets = this._targets, killingTargets = targets ? toArray(targets) : parsedTargets, propTweenLookup = this._ptLookup, firstPT = this._pt, overwrittenProps, curLookup, curOverwriteProps, props, p, pt, i;
|
|
2659
|
-
if ((!vars || vars === "all") && _arraysMatch(parsedTargets, killingTargets)) {
|
|
2660
|
-
vars === "all" && (this._pt = 0);
|
|
2661
|
-
return _interrupt(this);
|
|
2662
|
-
}
|
|
2663
|
-
overwrittenProps = this._op = this._op || [];
|
|
2664
|
-
if (vars !== "all") {
|
|
2665
|
-
if (_isString(vars)) {
|
|
2666
|
-
p = {};
|
|
2667
|
-
_forEachName(vars, function(name) {
|
|
2668
|
-
return p[name] = 1;
|
|
2669
|
-
});
|
|
2670
|
-
vars = p;
|
|
2671
|
-
}
|
|
2672
|
-
vars = _addAliasesToVars(parsedTargets, vars);
|
|
2673
|
-
}
|
|
2674
|
-
i = parsedTargets.length;
|
|
2675
|
-
while (i--) {
|
|
2676
|
-
if (~killingTargets.indexOf(parsedTargets[i])) {
|
|
2677
|
-
curLookup = propTweenLookup[i];
|
|
2678
|
-
if (vars === "all") {
|
|
2679
|
-
overwrittenProps[i] = vars;
|
|
2680
|
-
props = curLookup;
|
|
2681
|
-
curOverwriteProps = {};
|
|
2682
|
-
} else {
|
|
2683
|
-
curOverwriteProps = overwrittenProps[i] = overwrittenProps[i] || {};
|
|
2684
|
-
props = vars;
|
|
2685
|
-
}
|
|
2686
|
-
for (p in props) {
|
|
2687
|
-
pt = curLookup && curLookup[p];
|
|
2688
|
-
if (pt) {
|
|
2689
|
-
if (!("kill" in pt.d) || pt.d.kill(p) === true) {
|
|
2690
|
-
_removeLinkedListItem(this, pt, "_pt");
|
|
2691
|
-
}
|
|
2692
|
-
delete curLookup[p];
|
|
2693
|
-
}
|
|
2694
|
-
if (curOverwriteProps !== "all") {
|
|
2695
|
-
curOverwriteProps[p] = 1;
|
|
2696
|
-
}
|
|
2697
|
-
}
|
|
2698
|
-
}
|
|
2699
|
-
}
|
|
2700
|
-
this._initted && !this._pt && firstPT && _interrupt(this);
|
|
2701
|
-
return this;
|
|
2702
|
-
};
|
|
2703
|
-
Tween2.to = function to(targets, vars) {
|
|
2704
|
-
return new Tween2(targets, vars, arguments[2]);
|
|
2705
|
-
};
|
|
2706
|
-
Tween2.from = function from(targets, vars) {
|
|
2707
|
-
return _createTweenType(1, arguments);
|
|
2708
|
-
};
|
|
2709
|
-
Tween2.delayedCall = function delayedCall(delay, callback, params, scope) {
|
|
2710
|
-
return new Tween2(callback, 0, {
|
|
2711
|
-
immediateRender: false,
|
|
2712
|
-
lazy: false,
|
|
2713
|
-
overwrite: false,
|
|
2714
|
-
delay,
|
|
2715
|
-
onComplete: callback,
|
|
2716
|
-
onReverseComplete: callback,
|
|
2717
|
-
onCompleteParams: params,
|
|
2718
|
-
onReverseCompleteParams: params,
|
|
2719
|
-
callbackScope: scope
|
|
2720
|
-
});
|
|
2721
|
-
};
|
|
2722
|
-
Tween2.fromTo = function fromTo(targets, fromVars, toVars) {
|
|
2723
|
-
return _createTweenType(2, arguments);
|
|
2724
|
-
};
|
|
2725
|
-
Tween2.set = function set(targets, vars) {
|
|
2726
|
-
vars.duration = 0;
|
|
2727
|
-
vars.repeatDelay || (vars.repeat = 0);
|
|
2728
|
-
return new Tween2(targets, vars);
|
|
2729
|
-
};
|
|
2730
|
-
Tween2.killTweensOf = function killTweensOf(targets, props, onlyActive) {
|
|
2731
|
-
return _globalTimeline.killTweensOf(targets, props, onlyActive);
|
|
2732
|
-
};
|
|
2733
|
-
return Tween2;
|
|
2734
|
-
})(Animation);
|
|
2735
|
-
_setDefaults(Tween.prototype, {
|
|
2736
|
-
_targets: [],
|
|
2737
|
-
_lazy: 0,
|
|
2738
|
-
_startAt: 0,
|
|
2739
|
-
_op: 0,
|
|
2740
|
-
_onInit: 0
|
|
2741
|
-
});
|
|
2742
|
-
_forEachName("staggerTo,staggerFrom,staggerFromTo", function(name) {
|
|
2743
|
-
Tween[name] = function() {
|
|
2744
|
-
var tl = new Timeline(), params = _slice.call(arguments, 0);
|
|
2745
|
-
params.splice(name === "staggerFromTo" ? 5 : 4, 0, 0);
|
|
2746
|
-
return tl[name].apply(tl, params);
|
|
2747
|
-
};
|
|
2748
|
-
});
|
|
2749
|
-
var _setterPlain = function _setterPlain2(target, property, value) {
|
|
2750
|
-
return target[property] = value;
|
|
2751
|
-
};
|
|
2752
|
-
var _setterFunc = function _setterFunc2(target, property, value) {
|
|
2753
|
-
return target[property](value);
|
|
2754
|
-
};
|
|
2755
|
-
var _setterFuncWithParam = function _setterFuncWithParam2(target, property, value, data) {
|
|
2756
|
-
return target[property](data.fp, value);
|
|
2757
|
-
};
|
|
2758
|
-
var _setterAttribute = function _setterAttribute2(target, property, value) {
|
|
2759
|
-
return target.setAttribute(property, value);
|
|
2760
|
-
};
|
|
2761
|
-
var _getSetter = function _getSetter2(target, property) {
|
|
2762
|
-
return _isFunction(target[property]) ? _setterFunc : _isUndefined(target[property]) && target.setAttribute ? _setterAttribute : _setterPlain;
|
|
2763
|
-
};
|
|
2764
|
-
var _renderPlain = function _renderPlain2(ratio, data) {
|
|
2765
|
-
return data.set(data.t, data.p, Math.round((data.s + data.c * ratio) * 1e6) / 1e6, data);
|
|
2766
|
-
};
|
|
2767
|
-
var _renderBoolean = function _renderBoolean2(ratio, data) {
|
|
2768
|
-
return data.set(data.t, data.p, !!(data.s + data.c * ratio), data);
|
|
2769
|
-
};
|
|
2770
|
-
var _renderComplexString = function _renderComplexString2(ratio, data) {
|
|
2771
|
-
var pt = data._pt, s = "";
|
|
2772
|
-
if (!ratio && data.b) {
|
|
2773
|
-
s = data.b;
|
|
2774
|
-
} else if (ratio === 1 && data.e) {
|
|
2775
|
-
s = data.e;
|
|
2776
|
-
} else {
|
|
2777
|
-
while (pt) {
|
|
2778
|
-
s = pt.p + (pt.m ? pt.m(pt.s + pt.c * ratio) : Math.round((pt.s + pt.c * ratio) * 1e4) / 1e4) + s;
|
|
2779
|
-
pt = pt._next;
|
|
2780
|
-
}
|
|
2781
|
-
s += data.c;
|
|
2782
|
-
}
|
|
2783
|
-
data.set(data.t, data.p, s, data);
|
|
2784
|
-
};
|
|
2785
|
-
var _renderPropTweens = function _renderPropTweens2(ratio, data) {
|
|
2786
|
-
var pt = data._pt;
|
|
2787
|
-
while (pt) {
|
|
2788
|
-
pt.r(ratio, pt.d);
|
|
2789
|
-
pt = pt._next;
|
|
2790
|
-
}
|
|
2791
|
-
};
|
|
2792
|
-
var _addPluginModifier = function _addPluginModifier2(modifier, tween, target, property) {
|
|
2793
|
-
var pt = this._pt, next;
|
|
2794
|
-
while (pt) {
|
|
2795
|
-
next = pt._next;
|
|
2796
|
-
pt.p === property && pt.modifier(modifier, tween, target);
|
|
2797
|
-
pt = next;
|
|
2798
|
-
}
|
|
2799
|
-
};
|
|
2800
|
-
var _killPropTweensOf = function _killPropTweensOf2(property) {
|
|
2801
|
-
var pt = this._pt, hasNonDependentRemaining, next;
|
|
2802
|
-
while (pt) {
|
|
2803
|
-
next = pt._next;
|
|
2804
|
-
if (pt.p === property && !pt.op || pt.op === property) {
|
|
2805
|
-
_removeLinkedListItem(this, pt, "_pt");
|
|
2806
|
-
} else if (!pt.dep) {
|
|
2807
|
-
hasNonDependentRemaining = 1;
|
|
2808
|
-
}
|
|
2809
|
-
pt = next;
|
|
2810
|
-
}
|
|
2811
|
-
return !hasNonDependentRemaining;
|
|
2812
|
-
};
|
|
2813
|
-
var _setterWithModifier = function _setterWithModifier2(target, property, value, data) {
|
|
2814
|
-
data.mSet(target, property, data.m.call(data.tween, value, data.mt), data);
|
|
2815
|
-
};
|
|
2816
|
-
var _sortPropTweensByPriority = function _sortPropTweensByPriority2(parent) {
|
|
2817
|
-
var pt = parent._pt, next, pt2, first, last;
|
|
2818
|
-
while (pt) {
|
|
2819
|
-
next = pt._next;
|
|
2820
|
-
pt2 = first;
|
|
2821
|
-
while (pt2 && pt2.pr > pt.pr) {
|
|
2822
|
-
pt2 = pt2._next;
|
|
2823
|
-
}
|
|
2824
|
-
if (pt._prev = pt2 ? pt2._prev : last) {
|
|
2825
|
-
pt._prev._next = pt;
|
|
2826
|
-
} else {
|
|
2827
|
-
first = pt;
|
|
2828
|
-
}
|
|
2829
|
-
if (pt._next = pt2) {
|
|
2830
|
-
pt2._prev = pt;
|
|
2831
|
-
} else {
|
|
2832
|
-
last = pt;
|
|
2833
|
-
}
|
|
2834
|
-
pt = next;
|
|
2835
|
-
}
|
|
2836
|
-
parent._pt = first;
|
|
2837
|
-
};
|
|
2838
|
-
var PropTween = /* @__PURE__ */ (function() {
|
|
2839
|
-
function PropTween2(next, target, prop, start, change, renderer, data, setter, priority) {
|
|
2840
|
-
this.t = target;
|
|
2841
|
-
this.s = start;
|
|
2842
|
-
this.c = change;
|
|
2843
|
-
this.p = prop;
|
|
2844
|
-
this.r = renderer || _renderPlain;
|
|
2845
|
-
this.d = data || this;
|
|
2846
|
-
this.set = setter || _setterPlain;
|
|
2847
|
-
this.pr = priority || 0;
|
|
2848
|
-
this._next = next;
|
|
2849
|
-
if (next) {
|
|
2850
|
-
next._prev = this;
|
|
2851
|
-
}
|
|
2852
|
-
}
|
|
2853
|
-
var _proto4 = PropTween2.prototype;
|
|
2854
|
-
_proto4.modifier = function modifier(func, tween, target) {
|
|
2855
|
-
this.mSet = this.mSet || this.set;
|
|
2856
|
-
this.set = _setterWithModifier;
|
|
2857
|
-
this.m = func;
|
|
2858
|
-
this.mt = target;
|
|
2859
|
-
this.tween = tween;
|
|
2860
|
-
};
|
|
2861
|
-
return PropTween2;
|
|
2862
|
-
})();
|
|
2863
|
-
_forEachName(_callbackNames + "parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger", function(name) {
|
|
2864
|
-
return _reservedProps[name] = 1;
|
|
2865
|
-
});
|
|
2866
|
-
_globals.TweenMax = _globals.TweenLite = Tween;
|
|
2867
|
-
_globals.TimelineLite = _globals.TimelineMax = Timeline;
|
|
2868
|
-
_globalTimeline = new Timeline({
|
|
2869
|
-
sortChildren: false,
|
|
2870
|
-
defaults: _defaults,
|
|
2871
|
-
autoRemoveChildren: true,
|
|
2872
|
-
id: "root",
|
|
2873
|
-
smoothChildTiming: true
|
|
2874
|
-
});
|
|
2875
|
-
_config.stringFilter = _colorStringFilter;
|
|
2876
|
-
var _media = [];
|
|
2877
|
-
var _listeners = {};
|
|
2878
|
-
var _emptyArray = [];
|
|
2879
|
-
var _lastMediaTime = 0;
|
|
2880
|
-
var _contextID = 0;
|
|
2881
|
-
var _dispatch = function _dispatch2(type) {
|
|
2882
|
-
return (_listeners[type] || _emptyArray).map(function(f) {
|
|
2883
|
-
return f();
|
|
2884
|
-
});
|
|
2885
|
-
};
|
|
2886
|
-
var _onMediaChange = function _onMediaChange2() {
|
|
2887
|
-
var time = Date.now(), matches = [];
|
|
2888
|
-
if (time - _lastMediaTime > 2) {
|
|
2889
|
-
_dispatch("matchMediaInit");
|
|
2890
|
-
_media.forEach(function(c) {
|
|
2891
|
-
var queries = c.queries, conditions = c.conditions, match, p, anyMatch, toggled;
|
|
2892
|
-
for (p in queries) {
|
|
2893
|
-
match = _win.matchMedia(queries[p]).matches;
|
|
2894
|
-
match && (anyMatch = 1);
|
|
2895
|
-
if (match !== conditions[p]) {
|
|
2896
|
-
conditions[p] = match;
|
|
2897
|
-
toggled = 1;
|
|
2898
|
-
}
|
|
2899
|
-
}
|
|
2900
|
-
if (toggled) {
|
|
2901
|
-
c.revert();
|
|
2902
|
-
anyMatch && matches.push(c);
|
|
2903
|
-
}
|
|
2904
|
-
});
|
|
2905
|
-
_dispatch("matchMediaRevert");
|
|
2906
|
-
matches.forEach(function(c) {
|
|
2907
|
-
return c.onMatch(c, function(func) {
|
|
2908
|
-
return c.add(null, func);
|
|
2909
|
-
});
|
|
2910
|
-
});
|
|
2911
|
-
_lastMediaTime = time;
|
|
2912
|
-
_dispatch("matchMedia");
|
|
2913
|
-
}
|
|
2914
|
-
};
|
|
2915
|
-
var Context = /* @__PURE__ */ (function() {
|
|
2916
|
-
function Context2(func, scope) {
|
|
2917
|
-
this.selector = scope && selector(scope);
|
|
2918
|
-
this.data = [];
|
|
2919
|
-
this._r = [];
|
|
2920
|
-
this.isReverted = false;
|
|
2921
|
-
this.id = _contextID++;
|
|
2922
|
-
func && this.add(func);
|
|
2923
|
-
}
|
|
2924
|
-
var _proto5 = Context2.prototype;
|
|
2925
|
-
_proto5.add = function add(name, func, scope) {
|
|
2926
|
-
if (_isFunction(name)) {
|
|
2927
|
-
scope = func;
|
|
2928
|
-
func = name;
|
|
2929
|
-
name = _isFunction;
|
|
2930
|
-
}
|
|
2931
|
-
var self = this, f = function f2() {
|
|
2932
|
-
var prev = _context, prevSelector = self.selector, result;
|
|
2933
|
-
prev && prev !== self && prev.data.push(self);
|
|
2934
|
-
scope && (self.selector = selector(scope));
|
|
2935
|
-
_context = self;
|
|
2936
|
-
result = func.apply(self, arguments);
|
|
2937
|
-
_isFunction(result) && self._r.push(result);
|
|
2938
|
-
_context = prev;
|
|
2939
|
-
self.selector = prevSelector;
|
|
2940
|
-
self.isReverted = false;
|
|
2941
|
-
return result;
|
|
2942
|
-
};
|
|
2943
|
-
self.last = f;
|
|
2944
|
-
return name === _isFunction ? f(self, function(func2) {
|
|
2945
|
-
return self.add(null, func2);
|
|
2946
|
-
}) : name ? self[name] = f : f;
|
|
2947
|
-
};
|
|
2948
|
-
_proto5.ignore = function ignore(func) {
|
|
2949
|
-
var prev = _context;
|
|
2950
|
-
_context = null;
|
|
2951
|
-
func(this);
|
|
2952
|
-
_context = prev;
|
|
2953
|
-
};
|
|
2954
|
-
_proto5.getTweens = function getTweens() {
|
|
2955
|
-
var a = [];
|
|
2956
|
-
this.data.forEach(function(e) {
|
|
2957
|
-
return e instanceof Context2 ? a.push.apply(a, e.getTweens()) : e instanceof Tween && !(e.parent && e.parent.data === "nested") && a.push(e);
|
|
2958
|
-
});
|
|
2959
|
-
return a;
|
|
2960
|
-
};
|
|
2961
|
-
_proto5.clear = function clear() {
|
|
2962
|
-
this._r.length = this.data.length = 0;
|
|
2963
|
-
};
|
|
2964
|
-
_proto5.kill = function kill(revert, matchMedia2) {
|
|
2965
|
-
var _this4 = this;
|
|
2966
|
-
if (revert) {
|
|
2967
|
-
(function() {
|
|
2968
|
-
var tweens = _this4.getTweens(), i2 = _this4.data.length, t;
|
|
2969
|
-
while (i2--) {
|
|
2970
|
-
t = _this4.data[i2];
|
|
2971
|
-
if (t.data === "isFlip") {
|
|
2972
|
-
t.revert();
|
|
2973
|
-
t.getChildren(true, true, false).forEach(function(tween) {
|
|
2974
|
-
return tweens.splice(tweens.indexOf(tween), 1);
|
|
2975
|
-
});
|
|
2976
|
-
}
|
|
2977
|
-
}
|
|
2978
|
-
tweens.map(function(t2) {
|
|
2979
|
-
return {
|
|
2980
|
-
g: t2._dur || t2._delay || t2._sat && !t2._sat.vars.immediateRender ? t2.globalTime(0) : -Infinity,
|
|
2981
|
-
t: t2
|
|
2982
|
-
};
|
|
2983
|
-
}).sort(function(a, b) {
|
|
2984
|
-
return b.g - a.g || -Infinity;
|
|
2985
|
-
}).forEach(function(o) {
|
|
2986
|
-
return o.t.revert(revert);
|
|
2987
|
-
});
|
|
2988
|
-
i2 = _this4.data.length;
|
|
2989
|
-
while (i2--) {
|
|
2990
|
-
t = _this4.data[i2];
|
|
2991
|
-
if (t instanceof Timeline) {
|
|
2992
|
-
if (t.data !== "nested") {
|
|
2993
|
-
t.scrollTrigger && t.scrollTrigger.revert();
|
|
2994
|
-
t.kill();
|
|
2995
|
-
}
|
|
2996
|
-
} else {
|
|
2997
|
-
!(t instanceof Tween) && t.revert && t.revert(revert);
|
|
2998
|
-
}
|
|
2999
|
-
}
|
|
3000
|
-
_this4._r.forEach(function(f) {
|
|
3001
|
-
return f(revert, _this4);
|
|
3002
|
-
});
|
|
3003
|
-
_this4.isReverted = true;
|
|
3004
|
-
})();
|
|
3005
|
-
} else {
|
|
3006
|
-
this.data.forEach(function(e) {
|
|
3007
|
-
return e.kill && e.kill();
|
|
3008
|
-
});
|
|
3009
|
-
}
|
|
3010
|
-
this.clear();
|
|
3011
|
-
if (matchMedia2) {
|
|
3012
|
-
var i = _media.length;
|
|
3013
|
-
while (i--) {
|
|
3014
|
-
_media[i].id === this.id && _media.splice(i, 1);
|
|
3015
|
-
}
|
|
3016
|
-
}
|
|
3017
|
-
};
|
|
3018
|
-
_proto5.revert = function revert(config3) {
|
|
3019
|
-
this.kill(config3 || {});
|
|
3020
|
-
};
|
|
3021
|
-
return Context2;
|
|
3022
|
-
})();
|
|
3023
|
-
var MatchMedia = /* @__PURE__ */ (function() {
|
|
3024
|
-
function MatchMedia2(scope) {
|
|
3025
|
-
this.contexts = [];
|
|
3026
|
-
this.scope = scope;
|
|
3027
|
-
_context && _context.data.push(this);
|
|
3028
|
-
}
|
|
3029
|
-
var _proto6 = MatchMedia2.prototype;
|
|
3030
|
-
_proto6.add = function add(conditions, func, scope) {
|
|
3031
|
-
_isObject(conditions) || (conditions = {
|
|
3032
|
-
matches: conditions
|
|
3033
|
-
});
|
|
3034
|
-
var context3 = new Context(0, scope || this.scope), cond = context3.conditions = {}, mq, p, active;
|
|
3035
|
-
_context && !context3.selector && (context3.selector = _context.selector);
|
|
3036
|
-
this.contexts.push(context3);
|
|
3037
|
-
func = context3.add("onMatch", func);
|
|
3038
|
-
context3.queries = conditions;
|
|
3039
|
-
for (p in conditions) {
|
|
3040
|
-
if (p === "all") {
|
|
3041
|
-
active = 1;
|
|
3042
|
-
} else {
|
|
3043
|
-
mq = _win.matchMedia(conditions[p]);
|
|
3044
|
-
if (mq) {
|
|
3045
|
-
_media.indexOf(context3) < 0 && _media.push(context3);
|
|
3046
|
-
(cond[p] = mq.matches) && (active = 1);
|
|
3047
|
-
mq.addListener ? mq.addListener(_onMediaChange) : mq.addEventListener("change", _onMediaChange);
|
|
3048
|
-
}
|
|
3049
|
-
}
|
|
3050
|
-
}
|
|
3051
|
-
active && func(context3, function(f) {
|
|
3052
|
-
return context3.add(null, f);
|
|
3053
|
-
});
|
|
3054
|
-
return this;
|
|
3055
|
-
};
|
|
3056
|
-
_proto6.revert = function revert(config3) {
|
|
3057
|
-
this.kill(config3 || {});
|
|
3058
|
-
};
|
|
3059
|
-
_proto6.kill = function kill(revert) {
|
|
3060
|
-
this.contexts.forEach(function(c) {
|
|
3061
|
-
return c.kill(revert, true);
|
|
3062
|
-
});
|
|
3063
|
-
};
|
|
3064
|
-
return MatchMedia2;
|
|
3065
|
-
})();
|
|
3066
|
-
var _gsap = {
|
|
3067
|
-
registerPlugin: function registerPlugin() {
|
|
3068
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
3069
|
-
args[_key2] = arguments[_key2];
|
|
3070
|
-
}
|
|
3071
|
-
args.forEach(function(config3) {
|
|
3072
|
-
return _createPlugin(config3);
|
|
3073
|
-
});
|
|
3074
|
-
},
|
|
3075
|
-
timeline: function timeline(vars) {
|
|
3076
|
-
return new Timeline(vars);
|
|
3077
|
-
},
|
|
3078
|
-
getTweensOf: function getTweensOf(targets, onlyActive) {
|
|
3079
|
-
return _globalTimeline.getTweensOf(targets, onlyActive);
|
|
3080
|
-
},
|
|
3081
|
-
getProperty: function getProperty(target, property, unit, uncache) {
|
|
3082
|
-
_isString(target) && (target = toArray(target)[0]);
|
|
3083
|
-
var getter = _getCache(target || {}).get, format = unit ? _passThrough : _numericIfPossible;
|
|
3084
|
-
unit === "native" && (unit = "");
|
|
3085
|
-
return !target ? target : !property ? function(property2, unit2, uncache2) {
|
|
3086
|
-
return format((_plugins[property2] && _plugins[property2].get || getter)(target, property2, unit2, uncache2));
|
|
3087
|
-
} : format((_plugins[property] && _plugins[property].get || getter)(target, property, unit, uncache));
|
|
3088
|
-
},
|
|
3089
|
-
quickSetter: function quickSetter(target, property, unit) {
|
|
3090
|
-
target = toArray(target);
|
|
3091
|
-
if (target.length > 1) {
|
|
3092
|
-
var setters = target.map(function(t) {
|
|
3093
|
-
return gsap.quickSetter(t, property, unit);
|
|
3094
|
-
}), l = setters.length;
|
|
3095
|
-
return function(value) {
|
|
3096
|
-
var i = l;
|
|
3097
|
-
while (i--) {
|
|
3098
|
-
setters[i](value);
|
|
3099
|
-
}
|
|
3100
|
-
};
|
|
3101
|
-
}
|
|
3102
|
-
target = target[0] || {};
|
|
3103
|
-
var Plugin = _plugins[property], cache = _getCache(target), p = cache.harness && (cache.harness.aliases || {})[property] || property, setter = Plugin ? function(value) {
|
|
3104
|
-
var p2 = new Plugin();
|
|
3105
|
-
_quickTween._pt = 0;
|
|
3106
|
-
p2.init(target, unit ? value + unit : value, _quickTween, 0, [target]);
|
|
3107
|
-
p2.render(1, p2);
|
|
3108
|
-
_quickTween._pt && _renderPropTweens(1, _quickTween);
|
|
3109
|
-
} : cache.set(target, p);
|
|
3110
|
-
return Plugin ? setter : function(value) {
|
|
3111
|
-
return setter(target, p, unit ? value + unit : value, cache, 1);
|
|
3112
|
-
};
|
|
3113
|
-
},
|
|
3114
|
-
quickTo: function quickTo(target, property, vars) {
|
|
3115
|
-
var _setDefaults22;
|
|
3116
|
-
var tween = gsap.to(target, _setDefaults((_setDefaults22 = {}, _setDefaults22[property] = "+=0.1", _setDefaults22.paused = true, _setDefaults22.stagger = 0, _setDefaults22), vars || {})), func = function func2(value, start, startIsRelative) {
|
|
3117
|
-
return tween.resetTo(property, value, start, startIsRelative);
|
|
3118
|
-
};
|
|
3119
|
-
func.tween = tween;
|
|
3120
|
-
return func;
|
|
3121
|
-
},
|
|
3122
|
-
isTweening: function isTweening(targets) {
|
|
3123
|
-
return _globalTimeline.getTweensOf(targets, true).length > 0;
|
|
3124
|
-
},
|
|
3125
|
-
defaults: function defaults(value) {
|
|
3126
|
-
value && value.ease && (value.ease = _parseEase(value.ease, _defaults.ease));
|
|
3127
|
-
return _mergeDeep(_defaults, value || {});
|
|
3128
|
-
},
|
|
3129
|
-
config: function config2(value) {
|
|
3130
|
-
return _mergeDeep(_config, value || {});
|
|
3131
|
-
},
|
|
3132
|
-
registerEffect: function registerEffect(_ref3) {
|
|
3133
|
-
var name = _ref3.name, effect = _ref3.effect, plugins = _ref3.plugins, defaults2 = _ref3.defaults, extendTimeline = _ref3.extendTimeline;
|
|
3134
|
-
(plugins || "").split(",").forEach(function(pluginName) {
|
|
3135
|
-
return pluginName && !_plugins[pluginName] && !_globals[pluginName] && _warn(name + " effect requires " + pluginName + " plugin.");
|
|
3136
|
-
});
|
|
3137
|
-
_effects[name] = function(targets, vars, tl) {
|
|
3138
|
-
return effect(toArray(targets), _setDefaults(vars || {}, defaults2), tl);
|
|
3139
|
-
};
|
|
3140
|
-
if (extendTimeline) {
|
|
3141
|
-
Timeline.prototype[name] = function(targets, vars, position) {
|
|
3142
|
-
return this.add(_effects[name](targets, _isObject(vars) ? vars : (position = vars) && {}, this), position);
|
|
3143
|
-
};
|
|
3144
|
-
}
|
|
3145
|
-
},
|
|
3146
|
-
registerEase: function registerEase(name, ease) {
|
|
3147
|
-
_easeMap[name] = _parseEase(ease);
|
|
3148
|
-
},
|
|
3149
|
-
parseEase: function parseEase(ease, defaultEase) {
|
|
3150
|
-
return arguments.length ? _parseEase(ease, defaultEase) : _easeMap;
|
|
3151
|
-
},
|
|
3152
|
-
getById: function getById(id) {
|
|
3153
|
-
return _globalTimeline.getById(id);
|
|
3154
|
-
},
|
|
3155
|
-
exportRoot: function exportRoot(vars, includeDelayedCalls) {
|
|
3156
|
-
if (vars === void 0) {
|
|
3157
|
-
vars = {};
|
|
3158
|
-
}
|
|
3159
|
-
var tl = new Timeline(vars), child, next;
|
|
3160
|
-
tl.smoothChildTiming = _isNotFalse(vars.smoothChildTiming);
|
|
3161
|
-
_globalTimeline.remove(tl);
|
|
3162
|
-
tl._dp = 0;
|
|
3163
|
-
tl._time = tl._tTime = _globalTimeline._time;
|
|
3164
|
-
child = _globalTimeline._first;
|
|
3165
|
-
while (child) {
|
|
3166
|
-
next = child._next;
|
|
3167
|
-
if (includeDelayedCalls || !(!child._dur && child instanceof Tween && child.vars.onComplete === child._targets[0])) {
|
|
3168
|
-
_addToTimeline(tl, child, child._start - child._delay);
|
|
3169
|
-
}
|
|
3170
|
-
child = next;
|
|
3171
|
-
}
|
|
3172
|
-
_addToTimeline(_globalTimeline, tl, 0);
|
|
3173
|
-
return tl;
|
|
3174
|
-
},
|
|
3175
|
-
context: function context(func, scope) {
|
|
3176
|
-
return func ? new Context(func, scope) : _context;
|
|
3177
|
-
},
|
|
3178
|
-
matchMedia: function matchMedia(scope) {
|
|
3179
|
-
return new MatchMedia(scope);
|
|
3180
|
-
},
|
|
3181
|
-
matchMediaRefresh: function matchMediaRefresh() {
|
|
3182
|
-
return _media.forEach(function(c) {
|
|
3183
|
-
var cond = c.conditions, found, p;
|
|
3184
|
-
for (p in cond) {
|
|
3185
|
-
if (cond[p]) {
|
|
3186
|
-
cond[p] = false;
|
|
3187
|
-
found = 1;
|
|
3188
|
-
}
|
|
3189
|
-
}
|
|
3190
|
-
found && c.revert();
|
|
3191
|
-
}) || _onMediaChange();
|
|
3192
|
-
},
|
|
3193
|
-
addEventListener: function addEventListener(type, callback) {
|
|
3194
|
-
var a = _listeners[type] || (_listeners[type] = []);
|
|
3195
|
-
~a.indexOf(callback) || a.push(callback);
|
|
3196
|
-
},
|
|
3197
|
-
removeEventListener: function removeEventListener(type, callback) {
|
|
3198
|
-
var a = _listeners[type], i = a && a.indexOf(callback);
|
|
3199
|
-
i >= 0 && a.splice(i, 1);
|
|
3200
|
-
},
|
|
3201
|
-
utils: {
|
|
3202
|
-
wrap,
|
|
3203
|
-
wrapYoyo,
|
|
3204
|
-
distribute,
|
|
3205
|
-
random,
|
|
3206
|
-
snap,
|
|
3207
|
-
normalize,
|
|
3208
|
-
getUnit,
|
|
3209
|
-
clamp,
|
|
3210
|
-
splitColor,
|
|
3211
|
-
toArray,
|
|
3212
|
-
selector,
|
|
3213
|
-
mapRange,
|
|
3214
|
-
pipe,
|
|
3215
|
-
unitize,
|
|
3216
|
-
interpolate,
|
|
3217
|
-
shuffle
|
|
3218
|
-
},
|
|
3219
|
-
install: _install,
|
|
3220
|
-
effects: _effects,
|
|
3221
|
-
ticker: _ticker,
|
|
3222
|
-
updateRoot: Timeline.updateRoot,
|
|
3223
|
-
plugins: _plugins,
|
|
3224
|
-
globalTimeline: _globalTimeline,
|
|
3225
|
-
core: {
|
|
3226
|
-
PropTween,
|
|
3227
|
-
globals: _addGlobal,
|
|
3228
|
-
Tween,
|
|
3229
|
-
Timeline,
|
|
3230
|
-
Animation,
|
|
3231
|
-
getCache: _getCache,
|
|
3232
|
-
_removeLinkedListItem,
|
|
3233
|
-
reverting: function reverting() {
|
|
3234
|
-
return _reverting;
|
|
3235
|
-
},
|
|
3236
|
-
context: function context2(toAdd) {
|
|
3237
|
-
if (toAdd && _context) {
|
|
3238
|
-
_context.data.push(toAdd);
|
|
3239
|
-
toAdd._ctx = _context;
|
|
3240
|
-
}
|
|
3241
|
-
return _context;
|
|
3242
|
-
},
|
|
3243
|
-
suppressOverwrites: function suppressOverwrites(value) {
|
|
3244
|
-
return _suppressOverwrites = value;
|
|
3245
|
-
}
|
|
3246
|
-
}
|
|
3247
|
-
};
|
|
3248
|
-
_forEachName("to,from,fromTo,delayedCall,set,killTweensOf", function(name) {
|
|
3249
|
-
return _gsap[name] = Tween[name];
|
|
3250
|
-
});
|
|
3251
|
-
_ticker.add(Timeline.updateRoot);
|
|
3252
|
-
_quickTween = _gsap.to({}, {
|
|
3253
|
-
duration: 0
|
|
3254
|
-
});
|
|
3255
|
-
var _getPluginPropTween = function _getPluginPropTween2(plugin, prop) {
|
|
3256
|
-
var pt = plugin._pt;
|
|
3257
|
-
while (pt && pt.p !== prop && pt.op !== prop && pt.fp !== prop) {
|
|
3258
|
-
pt = pt._next;
|
|
3259
|
-
}
|
|
3260
|
-
return pt;
|
|
3261
|
-
};
|
|
3262
|
-
var _addModifiers = function _addModifiers2(tween, modifiers) {
|
|
3263
|
-
var targets = tween._targets, p, i, pt;
|
|
3264
|
-
for (p in modifiers) {
|
|
3265
|
-
i = targets.length;
|
|
3266
|
-
while (i--) {
|
|
3267
|
-
pt = tween._ptLookup[i][p];
|
|
3268
|
-
if (pt && (pt = pt.d)) {
|
|
3269
|
-
if (pt._pt) {
|
|
3270
|
-
pt = _getPluginPropTween(pt, p);
|
|
3271
|
-
}
|
|
3272
|
-
pt && pt.modifier && pt.modifier(modifiers[p], tween, targets[i], p);
|
|
3273
|
-
}
|
|
3274
|
-
}
|
|
3275
|
-
}
|
|
3276
|
-
};
|
|
3277
|
-
var _buildModifierPlugin = function _buildModifierPlugin2(name, modifier) {
|
|
3278
|
-
return {
|
|
3279
|
-
name,
|
|
3280
|
-
headless: 1,
|
|
3281
|
-
rawVars: 1,
|
|
3282
|
-
//don't pre-process function-based values or "random()" strings.
|
|
3283
|
-
init: function init4(target, vars, tween) {
|
|
3284
|
-
tween._onInit = function(tween2) {
|
|
3285
|
-
var temp, p;
|
|
3286
|
-
if (_isString(vars)) {
|
|
3287
|
-
temp = {};
|
|
3288
|
-
_forEachName(vars, function(name2) {
|
|
3289
|
-
return temp[name2] = 1;
|
|
3290
|
-
});
|
|
3291
|
-
vars = temp;
|
|
3292
|
-
}
|
|
3293
|
-
if (modifier) {
|
|
3294
|
-
temp = {};
|
|
3295
|
-
for (p in vars) {
|
|
3296
|
-
temp[p] = modifier(vars[p]);
|
|
3297
|
-
}
|
|
3298
|
-
vars = temp;
|
|
3299
|
-
}
|
|
3300
|
-
_addModifiers(tween2, vars);
|
|
3301
|
-
};
|
|
3302
|
-
}
|
|
3303
|
-
};
|
|
3304
|
-
};
|
|
3305
|
-
var gsap = _gsap.registerPlugin({
|
|
3306
|
-
name: "attr",
|
|
3307
|
-
init: function init(target, vars, tween, index, targets) {
|
|
3308
|
-
var p, pt, v;
|
|
3309
|
-
this.tween = tween;
|
|
3310
|
-
for (p in vars) {
|
|
3311
|
-
v = target.getAttribute(p) || "";
|
|
3312
|
-
pt = this.add(target, "setAttribute", (v || 0) + "", vars[p], index, targets, 0, 0, p);
|
|
3313
|
-
pt.op = p;
|
|
3314
|
-
pt.b = v;
|
|
3315
|
-
this._props.push(p);
|
|
3316
|
-
}
|
|
3317
|
-
},
|
|
3318
|
-
render: function render(ratio, data) {
|
|
3319
|
-
var pt = data._pt;
|
|
3320
|
-
while (pt) {
|
|
3321
|
-
_reverting ? pt.set(pt.t, pt.p, pt.b, pt) : pt.r(ratio, pt.d);
|
|
3322
|
-
pt = pt._next;
|
|
3323
|
-
}
|
|
3324
|
-
}
|
|
3325
|
-
}, {
|
|
3326
|
-
name: "endArray",
|
|
3327
|
-
headless: 1,
|
|
3328
|
-
init: function init2(target, value) {
|
|
3329
|
-
var i = value.length;
|
|
3330
|
-
while (i--) {
|
|
3331
|
-
this.add(target, i, target[i] || 0, value[i], 0, 0, 0, 0, 0, 1);
|
|
3332
|
-
}
|
|
3333
|
-
}
|
|
3334
|
-
}, _buildModifierPlugin("roundProps", _roundModifier), _buildModifierPlugin("modifiers"), _buildModifierPlugin("snap", snap)) || _gsap;
|
|
3335
|
-
Tween.version = Timeline.version = gsap.version = "3.14.2";
|
|
3336
|
-
_coreReady = 1;
|
|
3337
|
-
_windowExists() && _wake();
|
|
3338
|
-
var Power0 = _easeMap.Power0;
|
|
3339
|
-
var Power1 = _easeMap.Power1;
|
|
3340
|
-
var Power2 = _easeMap.Power2;
|
|
3341
|
-
var Power3 = _easeMap.Power3;
|
|
3342
|
-
var Power4 = _easeMap.Power4;
|
|
3343
|
-
var Linear = _easeMap.Linear;
|
|
3344
|
-
var Quad = _easeMap.Quad;
|
|
3345
|
-
var Cubic = _easeMap.Cubic;
|
|
3346
|
-
var Quart = _easeMap.Quart;
|
|
3347
|
-
var Quint = _easeMap.Quint;
|
|
3348
|
-
var Strong = _easeMap.Strong;
|
|
3349
|
-
var Elastic = _easeMap.Elastic;
|
|
3350
|
-
var Back = _easeMap.Back;
|
|
3351
|
-
var SteppedEase = _easeMap.SteppedEase;
|
|
3352
|
-
var Bounce = _easeMap.Bounce;
|
|
3353
|
-
var Sine = _easeMap.Sine;
|
|
3354
|
-
var Expo = _easeMap.Expo;
|
|
3355
|
-
var Circ = _easeMap.Circ;
|
|
3356
|
-
|
|
3357
|
-
// ../../node_modules/.pnpm/gsap@3.14.2/node_modules/gsap/CSSPlugin.js
|
|
3358
|
-
var _win2;
|
|
3359
|
-
var _doc2;
|
|
3360
|
-
var _docElement;
|
|
3361
|
-
var _pluginInitted;
|
|
3362
|
-
var _tempDiv;
|
|
3363
|
-
var _tempDivStyler;
|
|
3364
|
-
var _recentSetterPlugin;
|
|
3365
|
-
var _reverting2;
|
|
3366
|
-
var _windowExists3 = function _windowExists4() {
|
|
3367
|
-
return typeof window !== "undefined";
|
|
3368
|
-
};
|
|
3369
|
-
var _transformProps = {};
|
|
3370
|
-
var _RAD2DEG = 180 / Math.PI;
|
|
3371
|
-
var _DEG2RAD = Math.PI / 180;
|
|
3372
|
-
var _atan2 = Math.atan2;
|
|
3373
|
-
var _bigNum2 = 1e8;
|
|
3374
|
-
var _capsExp = /([A-Z])/g;
|
|
3375
|
-
var _horizontalExp = /(left|right|width|margin|padding|x)/i;
|
|
3376
|
-
var _complexExp = /[\s,\(]\S/;
|
|
3377
|
-
var _propertyAliases = {
|
|
3378
|
-
autoAlpha: "opacity,visibility",
|
|
3379
|
-
scale: "scaleX,scaleY",
|
|
3380
|
-
alpha: "opacity"
|
|
3381
|
-
};
|
|
3382
|
-
var _renderCSSProp = function _renderCSSProp2(ratio, data) {
|
|
3383
|
-
return data.set(data.t, data.p, Math.round((data.s + data.c * ratio) * 1e4) / 1e4 + data.u, data);
|
|
3384
|
-
};
|
|
3385
|
-
var _renderPropWithEnd = function _renderPropWithEnd2(ratio, data) {
|
|
3386
|
-
return data.set(data.t, data.p, ratio === 1 ? data.e : Math.round((data.s + data.c * ratio) * 1e4) / 1e4 + data.u, data);
|
|
3387
|
-
};
|
|
3388
|
-
var _renderCSSPropWithBeginning = function _renderCSSPropWithBeginning2(ratio, data) {
|
|
3389
|
-
return data.set(data.t, data.p, ratio ? Math.round((data.s + data.c * ratio) * 1e4) / 1e4 + data.u : data.b, data);
|
|
3390
|
-
};
|
|
3391
|
-
var _renderCSSPropWithBeginningAndEnd = function _renderCSSPropWithBeginningAndEnd2(ratio, data) {
|
|
3392
|
-
return data.set(data.t, data.p, ratio === 1 ? data.e : ratio ? Math.round((data.s + data.c * ratio) * 1e4) / 1e4 + data.u : data.b, data);
|
|
3393
|
-
};
|
|
3394
|
-
var _renderRoundedCSSProp = function _renderRoundedCSSProp2(ratio, data) {
|
|
3395
|
-
var value = data.s + data.c * ratio;
|
|
3396
|
-
data.set(data.t, data.p, ~~(value + (value < 0 ? -0.5 : 0.5)) + data.u, data);
|
|
3397
|
-
};
|
|
3398
|
-
var _renderNonTweeningValue = function _renderNonTweeningValue2(ratio, data) {
|
|
3399
|
-
return data.set(data.t, data.p, ratio ? data.e : data.b, data);
|
|
3400
|
-
};
|
|
3401
|
-
var _renderNonTweeningValueOnlyAtEnd = function _renderNonTweeningValueOnlyAtEnd2(ratio, data) {
|
|
3402
|
-
return data.set(data.t, data.p, ratio !== 1 ? data.b : data.e, data);
|
|
3403
|
-
};
|
|
3404
|
-
var _setterCSSStyle = function _setterCSSStyle2(target, property, value) {
|
|
3405
|
-
return target.style[property] = value;
|
|
3406
|
-
};
|
|
3407
|
-
var _setterCSSProp = function _setterCSSProp2(target, property, value) {
|
|
3408
|
-
return target.style.setProperty(property, value);
|
|
3409
|
-
};
|
|
3410
|
-
var _setterTransform = function _setterTransform2(target, property, value) {
|
|
3411
|
-
return target._gsap[property] = value;
|
|
3412
|
-
};
|
|
3413
|
-
var _setterScale = function _setterScale2(target, property, value) {
|
|
3414
|
-
return target._gsap.scaleX = target._gsap.scaleY = value;
|
|
3415
|
-
};
|
|
3416
|
-
var _setterScaleWithRender = function _setterScaleWithRender2(target, property, value, data, ratio) {
|
|
3417
|
-
var cache = target._gsap;
|
|
3418
|
-
cache.scaleX = cache.scaleY = value;
|
|
3419
|
-
cache.renderTransform(ratio, cache);
|
|
3420
|
-
};
|
|
3421
|
-
var _setterTransformWithRender = function _setterTransformWithRender2(target, property, value, data, ratio) {
|
|
3422
|
-
var cache = target._gsap;
|
|
3423
|
-
cache[property] = value;
|
|
3424
|
-
cache.renderTransform(ratio, cache);
|
|
3425
|
-
};
|
|
3426
|
-
var _transformProp = "transform";
|
|
3427
|
-
var _transformOriginProp = _transformProp + "Origin";
|
|
3428
|
-
var _saveStyle = function _saveStyle2(property, isNotCSS) {
|
|
3429
|
-
var _this = this;
|
|
3430
|
-
var target = this.target, style = target.style, cache = target._gsap;
|
|
3431
|
-
if (property in _transformProps && style) {
|
|
3432
|
-
this.tfm = this.tfm || {};
|
|
3433
|
-
if (property !== "transform") {
|
|
3434
|
-
property = _propertyAliases[property] || property;
|
|
3435
|
-
~property.indexOf(",") ? property.split(",").forEach(function(a) {
|
|
3436
|
-
return _this.tfm[a] = _get(target, a);
|
|
3437
|
-
}) : this.tfm[property] = cache.x ? cache[property] : _get(target, property);
|
|
3438
|
-
property === _transformOriginProp && (this.tfm.zOrigin = cache.zOrigin);
|
|
3439
|
-
} else {
|
|
3440
|
-
return _propertyAliases.transform.split(",").forEach(function(p) {
|
|
3441
|
-
return _saveStyle2.call(_this, p, isNotCSS);
|
|
3442
|
-
});
|
|
3443
|
-
}
|
|
3444
|
-
if (this.props.indexOf(_transformProp) >= 0) {
|
|
3445
|
-
return;
|
|
3446
|
-
}
|
|
3447
|
-
if (cache.svg) {
|
|
3448
|
-
this.svgo = target.getAttribute("data-svg-origin");
|
|
3449
|
-
this.props.push(_transformOriginProp, isNotCSS, "");
|
|
3450
|
-
}
|
|
3451
|
-
property = _transformProp;
|
|
3452
|
-
}
|
|
3453
|
-
(style || isNotCSS) && this.props.push(property, isNotCSS, style[property]);
|
|
3454
|
-
};
|
|
3455
|
-
var _removeIndependentTransforms = function _removeIndependentTransforms2(style) {
|
|
3456
|
-
if (style.translate) {
|
|
3457
|
-
style.removeProperty("translate");
|
|
3458
|
-
style.removeProperty("scale");
|
|
3459
|
-
style.removeProperty("rotate");
|
|
3460
|
-
}
|
|
3461
|
-
};
|
|
3462
|
-
var _revertStyle = function _revertStyle2() {
|
|
3463
|
-
var props = this.props, target = this.target, style = target.style, cache = target._gsap, i, p;
|
|
3464
|
-
for (i = 0; i < props.length; i += 3) {
|
|
3465
|
-
if (!props[i + 1]) {
|
|
3466
|
-
props[i + 2] ? style[props[i]] = props[i + 2] : style.removeProperty(props[i].substr(0, 2) === "--" ? props[i] : props[i].replace(_capsExp, "-$1").toLowerCase());
|
|
3467
|
-
} else if (props[i + 1] === 2) {
|
|
3468
|
-
target[props[i]](props[i + 2]);
|
|
3469
|
-
} else {
|
|
3470
|
-
target[props[i]] = props[i + 2];
|
|
3471
|
-
}
|
|
3472
|
-
}
|
|
3473
|
-
if (this.tfm) {
|
|
3474
|
-
for (p in this.tfm) {
|
|
3475
|
-
cache[p] = this.tfm[p];
|
|
3476
|
-
}
|
|
3477
|
-
if (cache.svg) {
|
|
3478
|
-
cache.renderTransform();
|
|
3479
|
-
target.setAttribute("data-svg-origin", this.svgo || "");
|
|
3480
|
-
}
|
|
3481
|
-
i = _reverting2();
|
|
3482
|
-
if ((!i || !i.isStart) && !style[_transformProp]) {
|
|
3483
|
-
_removeIndependentTransforms(style);
|
|
3484
|
-
if (cache.zOrigin && style[_transformOriginProp]) {
|
|
3485
|
-
style[_transformOriginProp] += " " + cache.zOrigin + "px";
|
|
3486
|
-
cache.zOrigin = 0;
|
|
3487
|
-
cache.renderTransform();
|
|
3488
|
-
}
|
|
3489
|
-
cache.uncache = 1;
|
|
3490
|
-
}
|
|
3491
|
-
}
|
|
3492
|
-
};
|
|
3493
|
-
var _getStyleSaver = function _getStyleSaver2(target, properties) {
|
|
3494
|
-
var saver = {
|
|
3495
|
-
target,
|
|
3496
|
-
props: [],
|
|
3497
|
-
revert: _revertStyle,
|
|
3498
|
-
save: _saveStyle
|
|
3499
|
-
};
|
|
3500
|
-
target._gsap || gsap.core.getCache(target);
|
|
3501
|
-
properties && target.style && target.nodeType && properties.split(",").forEach(function(p) {
|
|
3502
|
-
return saver.save(p);
|
|
3503
|
-
});
|
|
3504
|
-
return saver;
|
|
3505
|
-
};
|
|
3506
|
-
var _supports3D;
|
|
3507
|
-
var _createElement = function _createElement2(type, ns) {
|
|
3508
|
-
var e = _doc2.createElementNS ? _doc2.createElementNS((ns || "http://www.w3.org/1999/xhtml").replace(/^https/, "http"), type) : _doc2.createElement(type);
|
|
3509
|
-
return e && e.style ? e : _doc2.createElement(type);
|
|
3510
|
-
};
|
|
3511
|
-
var _getComputedProperty = function _getComputedProperty2(target, property, skipPrefixFallback) {
|
|
3512
|
-
var cs = getComputedStyle(target);
|
|
3513
|
-
return cs[property] || cs.getPropertyValue(property.replace(_capsExp, "-$1").toLowerCase()) || cs.getPropertyValue(property) || !skipPrefixFallback && _getComputedProperty2(target, _checkPropPrefix(property) || property, 1) || "";
|
|
3514
|
-
};
|
|
3515
|
-
var _prefixes = "O,Moz,ms,Ms,Webkit".split(",");
|
|
3516
|
-
var _checkPropPrefix = function _checkPropPrefix2(property, element, preferPrefix) {
|
|
3517
|
-
var e = element || _tempDiv, s = e.style, i = 5;
|
|
3518
|
-
if (property in s && !preferPrefix) {
|
|
3519
|
-
return property;
|
|
3520
|
-
}
|
|
3521
|
-
property = property.charAt(0).toUpperCase() + property.substr(1);
|
|
3522
|
-
while (i-- && !(_prefixes[i] + property in s)) {
|
|
3523
|
-
}
|
|
3524
|
-
return i < 0 ? null : (i === 3 ? "ms" : i >= 0 ? _prefixes[i] : "") + property;
|
|
3525
|
-
};
|
|
3526
|
-
var _initCore = function _initCore2() {
|
|
3527
|
-
if (_windowExists3() && window.document) {
|
|
3528
|
-
_win2 = window;
|
|
3529
|
-
_doc2 = _win2.document;
|
|
3530
|
-
_docElement = _doc2.documentElement;
|
|
3531
|
-
_tempDiv = _createElement("div") || {
|
|
3532
|
-
style: {}
|
|
3533
|
-
};
|
|
3534
|
-
_tempDivStyler = _createElement("div");
|
|
3535
|
-
_transformProp = _checkPropPrefix(_transformProp);
|
|
3536
|
-
_transformOriginProp = _transformProp + "Origin";
|
|
3537
|
-
_tempDiv.style.cssText = "border-width:0;line-height:0;position:absolute;padding:0";
|
|
3538
|
-
_supports3D = !!_checkPropPrefix("perspective");
|
|
3539
|
-
_reverting2 = gsap.core.reverting;
|
|
3540
|
-
_pluginInitted = 1;
|
|
3541
|
-
}
|
|
3542
|
-
};
|
|
3543
|
-
var _getReparentedCloneBBox = function _getReparentedCloneBBox2(target) {
|
|
3544
|
-
var owner = target.ownerSVGElement, svg = _createElement("svg", owner && owner.getAttribute("xmlns") || "http://www.w3.org/2000/svg"), clone = target.cloneNode(true), bbox;
|
|
3545
|
-
clone.style.display = "block";
|
|
3546
|
-
svg.appendChild(clone);
|
|
3547
|
-
_docElement.appendChild(svg);
|
|
3548
|
-
try {
|
|
3549
|
-
bbox = clone.getBBox();
|
|
3550
|
-
} catch (e) {
|
|
3551
|
-
}
|
|
3552
|
-
svg.removeChild(clone);
|
|
3553
|
-
_docElement.removeChild(svg);
|
|
3554
|
-
return bbox;
|
|
3555
|
-
};
|
|
3556
|
-
var _getAttributeFallbacks = function _getAttributeFallbacks2(target, attributesArray) {
|
|
3557
|
-
var i = attributesArray.length;
|
|
3558
|
-
while (i--) {
|
|
3559
|
-
if (target.hasAttribute(attributesArray[i])) {
|
|
3560
|
-
return target.getAttribute(attributesArray[i]);
|
|
3561
|
-
}
|
|
3562
|
-
}
|
|
3563
|
-
};
|
|
3564
|
-
var _getBBox = function _getBBox2(target) {
|
|
3565
|
-
var bounds, cloned;
|
|
3566
|
-
try {
|
|
3567
|
-
bounds = target.getBBox();
|
|
3568
|
-
} catch (error) {
|
|
3569
|
-
bounds = _getReparentedCloneBBox(target);
|
|
3570
|
-
cloned = 1;
|
|
3571
|
-
}
|
|
3572
|
-
bounds && (bounds.width || bounds.height) || cloned || (bounds = _getReparentedCloneBBox(target));
|
|
3573
|
-
return bounds && !bounds.width && !bounds.x && !bounds.y ? {
|
|
3574
|
-
x: +_getAttributeFallbacks(target, ["x", "cx", "x1"]) || 0,
|
|
3575
|
-
y: +_getAttributeFallbacks(target, ["y", "cy", "y1"]) || 0,
|
|
3576
|
-
width: 0,
|
|
3577
|
-
height: 0
|
|
3578
|
-
} : bounds;
|
|
3579
|
-
};
|
|
3580
|
-
var _isSVG = function _isSVG2(e) {
|
|
3581
|
-
return !!(e.getCTM && (!e.parentNode || e.ownerSVGElement) && _getBBox(e));
|
|
3582
|
-
};
|
|
3583
|
-
var _removeProperty = function _removeProperty2(target, property) {
|
|
3584
|
-
if (property) {
|
|
3585
|
-
var style = target.style, first2Chars;
|
|
3586
|
-
if (property in _transformProps && property !== _transformOriginProp) {
|
|
3587
|
-
property = _transformProp;
|
|
3588
|
-
}
|
|
3589
|
-
if (style.removeProperty) {
|
|
3590
|
-
first2Chars = property.substr(0, 2);
|
|
3591
|
-
if (first2Chars === "ms" || property.substr(0, 6) === "webkit") {
|
|
3592
|
-
property = "-" + property;
|
|
3593
|
-
}
|
|
3594
|
-
style.removeProperty(first2Chars === "--" ? property : property.replace(_capsExp, "-$1").toLowerCase());
|
|
3595
|
-
} else {
|
|
3596
|
-
style.removeAttribute(property);
|
|
3597
|
-
}
|
|
3598
|
-
}
|
|
3599
|
-
};
|
|
3600
|
-
var _addNonTweeningPT = function _addNonTweeningPT2(plugin, target, property, beginning, end, onlySetAtEnd) {
|
|
3601
|
-
var pt = new PropTween(plugin._pt, target, property, 0, 1, onlySetAtEnd ? _renderNonTweeningValueOnlyAtEnd : _renderNonTweeningValue);
|
|
3602
|
-
plugin._pt = pt;
|
|
3603
|
-
pt.b = beginning;
|
|
3604
|
-
pt.e = end;
|
|
3605
|
-
plugin._props.push(property);
|
|
3606
|
-
return pt;
|
|
3607
|
-
};
|
|
3608
|
-
var _nonConvertibleUnits = {
|
|
3609
|
-
deg: 1,
|
|
3610
|
-
rad: 1,
|
|
3611
|
-
turn: 1
|
|
3612
|
-
};
|
|
3613
|
-
var _nonStandardLayouts = {
|
|
3614
|
-
grid: 1,
|
|
3615
|
-
flex: 1
|
|
3616
|
-
};
|
|
3617
|
-
var _convertToUnit = function _convertToUnit2(target, property, value, unit) {
|
|
3618
|
-
var curValue = parseFloat(value) || 0, curUnit = (value + "").trim().substr((curValue + "").length) || "px", style = _tempDiv.style, horizontal = _horizontalExp.test(property), isRootSVG = target.tagName.toLowerCase() === "svg", measureProperty = (isRootSVG ? "client" : "offset") + (horizontal ? "Width" : "Height"), amount = 100, toPixels = unit === "px", toPercent = unit === "%", px, parent, cache, isSVG;
|
|
3619
|
-
if (unit === curUnit || !curValue || _nonConvertibleUnits[unit] || _nonConvertibleUnits[curUnit]) {
|
|
3620
|
-
return curValue;
|
|
3621
|
-
}
|
|
3622
|
-
curUnit !== "px" && !toPixels && (curValue = _convertToUnit2(target, property, value, "px"));
|
|
3623
|
-
isSVG = target.getCTM && _isSVG(target);
|
|
3624
|
-
if ((toPercent || curUnit === "%") && (_transformProps[property] || ~property.indexOf("adius"))) {
|
|
3625
|
-
px = isSVG ? target.getBBox()[horizontal ? "width" : "height"] : target[measureProperty];
|
|
3626
|
-
return _round(toPercent ? curValue / px * amount : curValue / 100 * px);
|
|
3627
|
-
}
|
|
3628
|
-
style[horizontal ? "width" : "height"] = amount + (toPixels ? curUnit : unit);
|
|
3629
|
-
parent = unit !== "rem" && ~property.indexOf("adius") || unit === "em" && target.appendChild && !isRootSVG ? target : target.parentNode;
|
|
3630
|
-
if (isSVG) {
|
|
3631
|
-
parent = (target.ownerSVGElement || {}).parentNode;
|
|
3632
|
-
}
|
|
3633
|
-
if (!parent || parent === _doc2 || !parent.appendChild) {
|
|
3634
|
-
parent = _doc2.body;
|
|
3635
|
-
}
|
|
3636
|
-
cache = parent._gsap;
|
|
3637
|
-
if (cache && toPercent && cache.width && horizontal && cache.time === _ticker.time && !cache.uncache) {
|
|
3638
|
-
return _round(curValue / cache.width * amount);
|
|
3639
|
-
} else {
|
|
3640
|
-
if (toPercent && (property === "height" || property === "width")) {
|
|
3641
|
-
var v = target.style[property];
|
|
3642
|
-
target.style[property] = amount + unit;
|
|
3643
|
-
px = target[measureProperty];
|
|
3644
|
-
v ? target.style[property] = v : _removeProperty(target, property);
|
|
3645
|
-
} else {
|
|
3646
|
-
(toPercent || curUnit === "%") && !_nonStandardLayouts[_getComputedProperty(parent, "display")] && (style.position = _getComputedProperty(target, "position"));
|
|
3647
|
-
parent === target && (style.position = "static");
|
|
3648
|
-
parent.appendChild(_tempDiv);
|
|
3649
|
-
px = _tempDiv[measureProperty];
|
|
3650
|
-
parent.removeChild(_tempDiv);
|
|
3651
|
-
style.position = "absolute";
|
|
3652
|
-
}
|
|
3653
|
-
if (horizontal && toPercent) {
|
|
3654
|
-
cache = _getCache(parent);
|
|
3655
|
-
cache.time = _ticker.time;
|
|
3656
|
-
cache.width = parent[measureProperty];
|
|
3657
|
-
}
|
|
3658
|
-
}
|
|
3659
|
-
return _round(toPixels ? px * curValue / amount : px && curValue ? amount / px * curValue : 0);
|
|
3660
|
-
};
|
|
3661
|
-
var _get = function _get2(target, property, unit, uncache) {
|
|
3662
|
-
var value;
|
|
3663
|
-
_pluginInitted || _initCore();
|
|
3664
|
-
if (property in _propertyAliases && property !== "transform") {
|
|
3665
|
-
property = _propertyAliases[property];
|
|
3666
|
-
if (~property.indexOf(",")) {
|
|
3667
|
-
property = property.split(",")[0];
|
|
3668
|
-
}
|
|
3669
|
-
}
|
|
3670
|
-
if (_transformProps[property] && property !== "transform") {
|
|
3671
|
-
value = _parseTransform(target, uncache);
|
|
3672
|
-
value = property !== "transformOrigin" ? value[property] : value.svg ? value.origin : _firstTwoOnly(_getComputedProperty(target, _transformOriginProp)) + " " + value.zOrigin + "px";
|
|
3673
|
-
} else {
|
|
3674
|
-
value = target.style[property];
|
|
3675
|
-
if (!value || value === "auto" || uncache || ~(value + "").indexOf("calc(")) {
|
|
3676
|
-
value = _specialProps[property] && _specialProps[property](target, property, unit) || _getComputedProperty(target, property) || _getProperty(target, property) || (property === "opacity" ? 1 : 0);
|
|
3677
|
-
}
|
|
3678
|
-
}
|
|
3679
|
-
return unit && !~(value + "").trim().indexOf(" ") ? _convertToUnit(target, property, value, unit) + unit : value;
|
|
3680
|
-
};
|
|
3681
|
-
var _tweenComplexCSSString = function _tweenComplexCSSString2(target, prop, start, end) {
|
|
3682
|
-
if (!start || start === "none") {
|
|
3683
|
-
var p = _checkPropPrefix(prop, target, 1), s = p && _getComputedProperty(target, p, 1);
|
|
3684
|
-
if (s && s !== start) {
|
|
3685
|
-
prop = p;
|
|
3686
|
-
start = s;
|
|
3687
|
-
} else if (prop === "borderColor") {
|
|
3688
|
-
start = _getComputedProperty(target, "borderTopColor");
|
|
3689
|
-
}
|
|
3690
|
-
}
|
|
3691
|
-
var pt = new PropTween(this._pt, target.style, prop, 0, 1, _renderComplexString), index = 0, matchIndex = 0, a, result, startValues, startNum, color, startValue, endValue, endNum, chunk, endUnit, startUnit, endValues;
|
|
3692
|
-
pt.b = start;
|
|
3693
|
-
pt.e = end;
|
|
3694
|
-
start += "";
|
|
3695
|
-
end += "";
|
|
3696
|
-
if (end.substring(0, 6) === "var(--") {
|
|
3697
|
-
end = _getComputedProperty(target, end.substring(4, end.indexOf(")")));
|
|
3698
|
-
}
|
|
3699
|
-
if (end === "auto") {
|
|
3700
|
-
startValue = target.style[prop];
|
|
3701
|
-
target.style[prop] = end;
|
|
3702
|
-
end = _getComputedProperty(target, prop) || end;
|
|
3703
|
-
startValue ? target.style[prop] = startValue : _removeProperty(target, prop);
|
|
3704
|
-
}
|
|
3705
|
-
a = [start, end];
|
|
3706
|
-
_colorStringFilter(a);
|
|
3707
|
-
start = a[0];
|
|
3708
|
-
end = a[1];
|
|
3709
|
-
startValues = start.match(_numWithUnitExp) || [];
|
|
3710
|
-
endValues = end.match(_numWithUnitExp) || [];
|
|
3711
|
-
if (endValues.length) {
|
|
3712
|
-
while (result = _numWithUnitExp.exec(end)) {
|
|
3713
|
-
endValue = result[0];
|
|
3714
|
-
chunk = end.substring(index, result.index);
|
|
3715
|
-
if (color) {
|
|
3716
|
-
color = (color + 1) % 5;
|
|
3717
|
-
} else if (chunk.substr(-5) === "rgba(" || chunk.substr(-5) === "hsla(") {
|
|
3718
|
-
color = 1;
|
|
3719
|
-
}
|
|
3720
|
-
if (endValue !== (startValue = startValues[matchIndex++] || "")) {
|
|
3721
|
-
startNum = parseFloat(startValue) || 0;
|
|
3722
|
-
startUnit = startValue.substr((startNum + "").length);
|
|
3723
|
-
endValue.charAt(1) === "=" && (endValue = _parseRelative(startNum, endValue) + startUnit);
|
|
3724
|
-
endNum = parseFloat(endValue);
|
|
3725
|
-
endUnit = endValue.substr((endNum + "").length);
|
|
3726
|
-
index = _numWithUnitExp.lastIndex - endUnit.length;
|
|
3727
|
-
if (!endUnit) {
|
|
3728
|
-
endUnit = endUnit || _config.units[prop] || startUnit;
|
|
3729
|
-
if (index === end.length) {
|
|
3730
|
-
end += endUnit;
|
|
3731
|
-
pt.e += endUnit;
|
|
3732
|
-
}
|
|
3733
|
-
}
|
|
3734
|
-
if (startUnit !== endUnit) {
|
|
3735
|
-
startNum = _convertToUnit(target, prop, startValue, endUnit) || 0;
|
|
3736
|
-
}
|
|
3737
|
-
pt._pt = {
|
|
3738
|
-
_next: pt._pt,
|
|
3739
|
-
p: chunk || matchIndex === 1 ? chunk : ",",
|
|
3740
|
-
//note: SVG spec allows omission of comma/space when a negative sign is wedged between two numbers, like 2.5-5.3 instead of 2.5,-5.3 but when tweening, the negative value may switch to positive, so we insert the comma just in case.
|
|
3741
|
-
s: startNum,
|
|
3742
|
-
c: endNum - startNum,
|
|
3743
|
-
m: color && color < 4 || prop === "zIndex" ? Math.round : 0
|
|
3744
|
-
};
|
|
3745
|
-
}
|
|
3746
|
-
}
|
|
3747
|
-
pt.c = index < end.length ? end.substring(index, end.length) : "";
|
|
3748
|
-
} else {
|
|
3749
|
-
pt.r = prop === "display" && end === "none" ? _renderNonTweeningValueOnlyAtEnd : _renderNonTweeningValue;
|
|
3750
|
-
}
|
|
3751
|
-
_relExp.test(end) && (pt.e = 0);
|
|
3752
|
-
this._pt = pt;
|
|
3753
|
-
return pt;
|
|
3754
|
-
};
|
|
3755
|
-
var _keywordToPercent = {
|
|
3756
|
-
top: "0%",
|
|
3757
|
-
bottom: "100%",
|
|
3758
|
-
left: "0%",
|
|
3759
|
-
right: "100%",
|
|
3760
|
-
center: "50%"
|
|
3761
|
-
};
|
|
3762
|
-
var _convertKeywordsToPercentages = function _convertKeywordsToPercentages2(value) {
|
|
3763
|
-
var split = value.split(" "), x = split[0], y = split[1] || "50%";
|
|
3764
|
-
if (x === "top" || x === "bottom" || y === "left" || y === "right") {
|
|
3765
|
-
value = x;
|
|
3766
|
-
x = y;
|
|
3767
|
-
y = value;
|
|
3768
|
-
}
|
|
3769
|
-
split[0] = _keywordToPercent[x] || x;
|
|
3770
|
-
split[1] = _keywordToPercent[y] || y;
|
|
3771
|
-
return split.join(" ");
|
|
3772
|
-
};
|
|
3773
|
-
var _renderClearProps = function _renderClearProps2(ratio, data) {
|
|
3774
|
-
if (data.tween && data.tween._time === data.tween._dur) {
|
|
3775
|
-
var target = data.t, style = target.style, props = data.u, cache = target._gsap, prop, clearTransforms, i;
|
|
3776
|
-
if (props === "all" || props === true) {
|
|
3777
|
-
style.cssText = "";
|
|
3778
|
-
clearTransforms = 1;
|
|
3779
|
-
} else {
|
|
3780
|
-
props = props.split(",");
|
|
3781
|
-
i = props.length;
|
|
3782
|
-
while (--i > -1) {
|
|
3783
|
-
prop = props[i];
|
|
3784
|
-
if (_transformProps[prop]) {
|
|
3785
|
-
clearTransforms = 1;
|
|
3786
|
-
prop = prop === "transformOrigin" ? _transformOriginProp : _transformProp;
|
|
3787
|
-
}
|
|
3788
|
-
_removeProperty(target, prop);
|
|
3789
|
-
}
|
|
3790
|
-
}
|
|
3791
|
-
if (clearTransforms) {
|
|
3792
|
-
_removeProperty(target, _transformProp);
|
|
3793
|
-
if (cache) {
|
|
3794
|
-
cache.svg && target.removeAttribute("transform");
|
|
3795
|
-
style.scale = style.rotate = style.translate = "none";
|
|
3796
|
-
_parseTransform(target, 1);
|
|
3797
|
-
cache.uncache = 1;
|
|
3798
|
-
_removeIndependentTransforms(style);
|
|
3799
|
-
}
|
|
3800
|
-
}
|
|
3801
|
-
}
|
|
3802
|
-
};
|
|
3803
|
-
var _specialProps = {
|
|
3804
|
-
clearProps: function clearProps(plugin, target, property, endValue, tween) {
|
|
3805
|
-
if (tween.data !== "isFromStart") {
|
|
3806
|
-
var pt = plugin._pt = new PropTween(plugin._pt, target, property, 0, 0, _renderClearProps);
|
|
3807
|
-
pt.u = endValue;
|
|
3808
|
-
pt.pr = -10;
|
|
3809
|
-
pt.tween = tween;
|
|
3810
|
-
plugin._props.push(property);
|
|
3811
|
-
return 1;
|
|
3812
|
-
}
|
|
3813
|
-
}
|
|
3814
|
-
/* className feature (about 0.4kb gzipped).
|
|
3815
|
-
, className(plugin, target, property, endValue, tween) {
|
|
3816
|
-
let _renderClassName = (ratio, data) => {
|
|
3817
|
-
data.css.render(ratio, data.css);
|
|
3818
|
-
if (!ratio || ratio === 1) {
|
|
3819
|
-
let inline = data.rmv,
|
|
3820
|
-
target = data.t,
|
|
3821
|
-
p;
|
|
3822
|
-
target.setAttribute("class", ratio ? data.e : data.b);
|
|
3823
|
-
for (p in inline) {
|
|
3824
|
-
_removeProperty(target, p);
|
|
3825
|
-
}
|
|
3826
|
-
}
|
|
3827
|
-
},
|
|
3828
|
-
_getAllStyles = (target) => {
|
|
3829
|
-
let styles = {},
|
|
3830
|
-
computed = getComputedStyle(target),
|
|
3831
|
-
p;
|
|
3832
|
-
for (p in computed) {
|
|
3833
|
-
if (isNaN(p) && p !== "cssText" && p !== "length") {
|
|
3834
|
-
styles[p] = computed[p];
|
|
3835
|
-
}
|
|
3836
|
-
}
|
|
3837
|
-
_setDefaults(styles, _parseTransform(target, 1));
|
|
3838
|
-
return styles;
|
|
3839
|
-
},
|
|
3840
|
-
startClassList = target.getAttribute("class"),
|
|
3841
|
-
style = target.style,
|
|
3842
|
-
cssText = style.cssText,
|
|
3843
|
-
cache = target._gsap,
|
|
3844
|
-
classPT = cache.classPT,
|
|
3845
|
-
inlineToRemoveAtEnd = {},
|
|
3846
|
-
data = {t:target, plugin:plugin, rmv:inlineToRemoveAtEnd, b:startClassList, e:(endValue.charAt(1) !== "=") ? endValue : startClassList.replace(new RegExp("(?:\\s|^)" + endValue.substr(2) + "(?![\\w-])"), "") + ((endValue.charAt(0) === "+") ? " " + endValue.substr(2) : "")},
|
|
3847
|
-
changingVars = {},
|
|
3848
|
-
startVars = _getAllStyles(target),
|
|
3849
|
-
transformRelated = /(transform|perspective)/i,
|
|
3850
|
-
endVars, p;
|
|
3851
|
-
if (classPT) {
|
|
3852
|
-
classPT.r(1, classPT.d);
|
|
3853
|
-
_removeLinkedListItem(classPT.d.plugin, classPT, "_pt");
|
|
3854
|
-
}
|
|
3855
|
-
target.setAttribute("class", data.e);
|
|
3856
|
-
endVars = _getAllStyles(target, true);
|
|
3857
|
-
target.setAttribute("class", startClassList);
|
|
3858
|
-
for (p in endVars) {
|
|
3859
|
-
if (endVars[p] !== startVars[p] && !transformRelated.test(p)) {
|
|
3860
|
-
changingVars[p] = endVars[p];
|
|
3861
|
-
if (!style[p] && style[p] !== "0") {
|
|
3862
|
-
inlineToRemoveAtEnd[p] = 1;
|
|
3863
|
-
}
|
|
3864
|
-
}
|
|
3865
|
-
}
|
|
3866
|
-
cache.classPT = plugin._pt = new PropTween(plugin._pt, target, "className", 0, 0, _renderClassName, data, 0, -11);
|
|
3867
|
-
if (style.cssText !== cssText) { //only apply if things change. Otherwise, in cases like a background-image that's pulled dynamically, it could cause a refresh. See https://gsap.com/forums/topic/20368-possible-gsap-bug-switching-classnames-in-chrome/.
|
|
3868
|
-
style.cssText = cssText; //we recorded cssText before we swapped classes and ran _getAllStyles() because in cases when a className tween is overwritten, we remove all the related tweening properties from that class change (otherwise class-specific stuff can't override properties we've directly set on the target's style object due to specificity).
|
|
3869
|
-
}
|
|
3870
|
-
_parseTransform(target, true); //to clear the caching of transforms
|
|
3871
|
-
data.css = new gsap.plugins.css();
|
|
3872
|
-
data.css.init(target, changingVars, tween);
|
|
3873
|
-
plugin._props.push(...data.css._props);
|
|
3874
|
-
return 1;
|
|
3875
|
-
}
|
|
3876
|
-
*/
|
|
3877
|
-
};
|
|
3878
|
-
var _identity2DMatrix = [1, 0, 0, 1, 0, 0];
|
|
3879
|
-
var _rotationalProperties = {};
|
|
3880
|
-
var _isNullTransform = function _isNullTransform2(value) {
|
|
3881
|
-
return value === "matrix(1, 0, 0, 1, 0, 0)" || value === "none" || !value;
|
|
3882
|
-
};
|
|
3883
|
-
var _getComputedTransformMatrixAsArray = function _getComputedTransformMatrixAsArray2(target) {
|
|
3884
|
-
var matrixString = _getComputedProperty(target, _transformProp);
|
|
3885
|
-
return _isNullTransform(matrixString) ? _identity2DMatrix : matrixString.substr(7).match(_numExp).map(_round);
|
|
3886
|
-
};
|
|
3887
|
-
var _getMatrix = function _getMatrix2(target, force2D) {
|
|
3888
|
-
var cache = target._gsap || _getCache(target), style = target.style, matrix = _getComputedTransformMatrixAsArray(target), parent, nextSibling, temp, addedToDOM;
|
|
3889
|
-
if (cache.svg && target.getAttribute("transform")) {
|
|
3890
|
-
temp = target.transform.baseVal.consolidate().matrix;
|
|
3891
|
-
matrix = [temp.a, temp.b, temp.c, temp.d, temp.e, temp.f];
|
|
3892
|
-
return matrix.join(",") === "1,0,0,1,0,0" ? _identity2DMatrix : matrix;
|
|
3893
|
-
} else if (matrix === _identity2DMatrix && !target.offsetParent && target !== _docElement && !cache.svg) {
|
|
3894
|
-
temp = style.display;
|
|
3895
|
-
style.display = "block";
|
|
3896
|
-
parent = target.parentNode;
|
|
3897
|
-
if (!parent || !target.offsetParent && !target.getBoundingClientRect().width) {
|
|
3898
|
-
addedToDOM = 1;
|
|
3899
|
-
nextSibling = target.nextElementSibling;
|
|
3900
|
-
_docElement.appendChild(target);
|
|
3901
|
-
}
|
|
3902
|
-
matrix = _getComputedTransformMatrixAsArray(target);
|
|
3903
|
-
temp ? style.display = temp : _removeProperty(target, "display");
|
|
3904
|
-
if (addedToDOM) {
|
|
3905
|
-
nextSibling ? parent.insertBefore(target, nextSibling) : parent ? parent.appendChild(target) : _docElement.removeChild(target);
|
|
3906
|
-
}
|
|
3907
|
-
}
|
|
3908
|
-
return force2D && matrix.length > 6 ? [matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]] : matrix;
|
|
3909
|
-
};
|
|
3910
|
-
var _applySVGOrigin = function _applySVGOrigin2(target, origin, originIsAbsolute, smooth, matrixArray, pluginToAddPropTweensTo) {
|
|
3911
|
-
var cache = target._gsap, matrix = matrixArray || _getMatrix(target, true), xOriginOld = cache.xOrigin || 0, yOriginOld = cache.yOrigin || 0, xOffsetOld = cache.xOffset || 0, yOffsetOld = cache.yOffset || 0, a = matrix[0], b = matrix[1], c = matrix[2], d = matrix[3], tx = matrix[4], ty = matrix[5], originSplit = origin.split(" "), xOrigin = parseFloat(originSplit[0]) || 0, yOrigin = parseFloat(originSplit[1]) || 0, bounds, determinant, x, y;
|
|
3912
|
-
if (!originIsAbsolute) {
|
|
3913
|
-
bounds = _getBBox(target);
|
|
3914
|
-
xOrigin = bounds.x + (~originSplit[0].indexOf("%") ? xOrigin / 100 * bounds.width : xOrigin);
|
|
3915
|
-
yOrigin = bounds.y + (~(originSplit[1] || originSplit[0]).indexOf("%") ? yOrigin / 100 * bounds.height : yOrigin);
|
|
3916
|
-
} else if (matrix !== _identity2DMatrix && (determinant = a * d - b * c)) {
|
|
3917
|
-
x = xOrigin * (d / determinant) + yOrigin * (-c / determinant) + (c * ty - d * tx) / determinant;
|
|
3918
|
-
y = xOrigin * (-b / determinant) + yOrigin * (a / determinant) - (a * ty - b * tx) / determinant;
|
|
3919
|
-
xOrigin = x;
|
|
3920
|
-
yOrigin = y;
|
|
3921
|
-
}
|
|
3922
|
-
if (smooth || smooth !== false && cache.smooth) {
|
|
3923
|
-
tx = xOrigin - xOriginOld;
|
|
3924
|
-
ty = yOrigin - yOriginOld;
|
|
3925
|
-
cache.xOffset = xOffsetOld + (tx * a + ty * c) - tx;
|
|
3926
|
-
cache.yOffset = yOffsetOld + (tx * b + ty * d) - ty;
|
|
3927
|
-
} else {
|
|
3928
|
-
cache.xOffset = cache.yOffset = 0;
|
|
3929
|
-
}
|
|
3930
|
-
cache.xOrigin = xOrigin;
|
|
3931
|
-
cache.yOrigin = yOrigin;
|
|
3932
|
-
cache.smooth = !!smooth;
|
|
3933
|
-
cache.origin = origin;
|
|
3934
|
-
cache.originIsAbsolute = !!originIsAbsolute;
|
|
3935
|
-
target.style[_transformOriginProp] = "0px 0px";
|
|
3936
|
-
if (pluginToAddPropTweensTo) {
|
|
3937
|
-
_addNonTweeningPT(pluginToAddPropTweensTo, cache, "xOrigin", xOriginOld, xOrigin);
|
|
3938
|
-
_addNonTweeningPT(pluginToAddPropTweensTo, cache, "yOrigin", yOriginOld, yOrigin);
|
|
3939
|
-
_addNonTweeningPT(pluginToAddPropTweensTo, cache, "xOffset", xOffsetOld, cache.xOffset);
|
|
3940
|
-
_addNonTweeningPT(pluginToAddPropTweensTo, cache, "yOffset", yOffsetOld, cache.yOffset);
|
|
3941
|
-
}
|
|
3942
|
-
target.setAttribute("data-svg-origin", xOrigin + " " + yOrigin);
|
|
3943
|
-
};
|
|
3944
|
-
var _parseTransform = function _parseTransform2(target, uncache) {
|
|
3945
|
-
var cache = target._gsap || new GSCache(target);
|
|
3946
|
-
if ("x" in cache && !uncache && !cache.uncache) {
|
|
3947
|
-
return cache;
|
|
3948
|
-
}
|
|
3949
|
-
var style = target.style, invertedScaleX = cache.scaleX < 0, px = "px", deg = "deg", cs = getComputedStyle(target), origin = _getComputedProperty(target, _transformOriginProp) || "0", x, y, z, scaleX, scaleY, rotation, rotationX, rotationY, skewX, skewY, perspective, xOrigin, yOrigin, matrix, angle, cos, sin, a, b, c, d, a12, a22, t1, t2, t3, a13, a23, a33, a42, a43, a32;
|
|
3950
|
-
x = y = z = rotation = rotationX = rotationY = skewX = skewY = perspective = 0;
|
|
3951
|
-
scaleX = scaleY = 1;
|
|
3952
|
-
cache.svg = !!(target.getCTM && _isSVG(target));
|
|
3953
|
-
if (cs.translate) {
|
|
3954
|
-
if (cs.translate !== "none" || cs.scale !== "none" || cs.rotate !== "none") {
|
|
3955
|
-
style[_transformProp] = (cs.translate !== "none" ? "translate3d(" + (cs.translate + " 0 0").split(" ").slice(0, 3).join(", ") + ") " : "") + (cs.rotate !== "none" ? "rotate(" + cs.rotate + ") " : "") + (cs.scale !== "none" ? "scale(" + cs.scale.split(" ").join(",") + ") " : "") + (cs[_transformProp] !== "none" ? cs[_transformProp] : "");
|
|
3956
|
-
}
|
|
3957
|
-
style.scale = style.rotate = style.translate = "none";
|
|
3958
|
-
}
|
|
3959
|
-
matrix = _getMatrix(target, cache.svg);
|
|
3960
|
-
if (cache.svg) {
|
|
3961
|
-
if (cache.uncache) {
|
|
3962
|
-
t2 = target.getBBox();
|
|
3963
|
-
origin = cache.xOrigin - t2.x + "px " + (cache.yOrigin - t2.y) + "px";
|
|
3964
|
-
t1 = "";
|
|
3965
|
-
} else {
|
|
3966
|
-
t1 = !uncache && target.getAttribute("data-svg-origin");
|
|
3967
|
-
}
|
|
3968
|
-
_applySVGOrigin(target, t1 || origin, !!t1 || cache.originIsAbsolute, cache.smooth !== false, matrix);
|
|
3969
|
-
}
|
|
3970
|
-
xOrigin = cache.xOrigin || 0;
|
|
3971
|
-
yOrigin = cache.yOrigin || 0;
|
|
3972
|
-
if (matrix !== _identity2DMatrix) {
|
|
3973
|
-
a = matrix[0];
|
|
3974
|
-
b = matrix[1];
|
|
3975
|
-
c = matrix[2];
|
|
3976
|
-
d = matrix[3];
|
|
3977
|
-
x = a12 = matrix[4];
|
|
3978
|
-
y = a22 = matrix[5];
|
|
3979
|
-
if (matrix.length === 6) {
|
|
3980
|
-
scaleX = Math.sqrt(a * a + b * b);
|
|
3981
|
-
scaleY = Math.sqrt(d * d + c * c);
|
|
3982
|
-
rotation = a || b ? _atan2(b, a) * _RAD2DEG : 0;
|
|
3983
|
-
skewX = c || d ? _atan2(c, d) * _RAD2DEG + rotation : 0;
|
|
3984
|
-
skewX && (scaleY *= Math.abs(Math.cos(skewX * _DEG2RAD)));
|
|
3985
|
-
if (cache.svg) {
|
|
3986
|
-
x -= xOrigin - (xOrigin * a + yOrigin * c);
|
|
3987
|
-
y -= yOrigin - (xOrigin * b + yOrigin * d);
|
|
3988
|
-
}
|
|
3989
|
-
} else {
|
|
3990
|
-
a32 = matrix[6];
|
|
3991
|
-
a42 = matrix[7];
|
|
3992
|
-
a13 = matrix[8];
|
|
3993
|
-
a23 = matrix[9];
|
|
3994
|
-
a33 = matrix[10];
|
|
3995
|
-
a43 = matrix[11];
|
|
3996
|
-
x = matrix[12];
|
|
3997
|
-
y = matrix[13];
|
|
3998
|
-
z = matrix[14];
|
|
3999
|
-
angle = _atan2(a32, a33);
|
|
4000
|
-
rotationX = angle * _RAD2DEG;
|
|
4001
|
-
if (angle) {
|
|
4002
|
-
cos = Math.cos(-angle);
|
|
4003
|
-
sin = Math.sin(-angle);
|
|
4004
|
-
t1 = a12 * cos + a13 * sin;
|
|
4005
|
-
t2 = a22 * cos + a23 * sin;
|
|
4006
|
-
t3 = a32 * cos + a33 * sin;
|
|
4007
|
-
a13 = a12 * -sin + a13 * cos;
|
|
4008
|
-
a23 = a22 * -sin + a23 * cos;
|
|
4009
|
-
a33 = a32 * -sin + a33 * cos;
|
|
4010
|
-
a43 = a42 * -sin + a43 * cos;
|
|
4011
|
-
a12 = t1;
|
|
4012
|
-
a22 = t2;
|
|
4013
|
-
a32 = t3;
|
|
4014
|
-
}
|
|
4015
|
-
angle = _atan2(-c, a33);
|
|
4016
|
-
rotationY = angle * _RAD2DEG;
|
|
4017
|
-
if (angle) {
|
|
4018
|
-
cos = Math.cos(-angle);
|
|
4019
|
-
sin = Math.sin(-angle);
|
|
4020
|
-
t1 = a * cos - a13 * sin;
|
|
4021
|
-
t2 = b * cos - a23 * sin;
|
|
4022
|
-
t3 = c * cos - a33 * sin;
|
|
4023
|
-
a43 = d * sin + a43 * cos;
|
|
4024
|
-
a = t1;
|
|
4025
|
-
b = t2;
|
|
4026
|
-
c = t3;
|
|
4027
|
-
}
|
|
4028
|
-
angle = _atan2(b, a);
|
|
4029
|
-
rotation = angle * _RAD2DEG;
|
|
4030
|
-
if (angle) {
|
|
4031
|
-
cos = Math.cos(angle);
|
|
4032
|
-
sin = Math.sin(angle);
|
|
4033
|
-
t1 = a * cos + b * sin;
|
|
4034
|
-
t2 = a12 * cos + a22 * sin;
|
|
4035
|
-
b = b * cos - a * sin;
|
|
4036
|
-
a22 = a22 * cos - a12 * sin;
|
|
4037
|
-
a = t1;
|
|
4038
|
-
a12 = t2;
|
|
4039
|
-
}
|
|
4040
|
-
if (rotationX && Math.abs(rotationX) + Math.abs(rotation) > 359.9) {
|
|
4041
|
-
rotationX = rotation = 0;
|
|
4042
|
-
rotationY = 180 - rotationY;
|
|
4043
|
-
}
|
|
4044
|
-
scaleX = _round(Math.sqrt(a * a + b * b + c * c));
|
|
4045
|
-
scaleY = _round(Math.sqrt(a22 * a22 + a32 * a32));
|
|
4046
|
-
angle = _atan2(a12, a22);
|
|
4047
|
-
skewX = Math.abs(angle) > 2e-4 ? angle * _RAD2DEG : 0;
|
|
4048
|
-
perspective = a43 ? 1 / (a43 < 0 ? -a43 : a43) : 0;
|
|
4049
|
-
}
|
|
4050
|
-
if (cache.svg) {
|
|
4051
|
-
t1 = target.getAttribute("transform");
|
|
4052
|
-
cache.forceCSS = target.setAttribute("transform", "") || !_isNullTransform(_getComputedProperty(target, _transformProp));
|
|
4053
|
-
t1 && target.setAttribute("transform", t1);
|
|
4054
|
-
}
|
|
4055
|
-
}
|
|
4056
|
-
if (Math.abs(skewX) > 90 && Math.abs(skewX) < 270) {
|
|
4057
|
-
if (invertedScaleX) {
|
|
4058
|
-
scaleX *= -1;
|
|
4059
|
-
skewX += rotation <= 0 ? 180 : -180;
|
|
4060
|
-
rotation += rotation <= 0 ? 180 : -180;
|
|
4061
|
-
} else {
|
|
4062
|
-
scaleY *= -1;
|
|
4063
|
-
skewX += skewX <= 0 ? 180 : -180;
|
|
4064
|
-
}
|
|
4065
|
-
}
|
|
4066
|
-
uncache = uncache || cache.uncache;
|
|
4067
|
-
cache.x = x - ((cache.xPercent = x && (!uncache && cache.xPercent || (Math.round(target.offsetWidth / 2) === Math.round(-x) ? -50 : 0))) ? target.offsetWidth * cache.xPercent / 100 : 0) + px;
|
|
4068
|
-
cache.y = y - ((cache.yPercent = y && (!uncache && cache.yPercent || (Math.round(target.offsetHeight / 2) === Math.round(-y) ? -50 : 0))) ? target.offsetHeight * cache.yPercent / 100 : 0) + px;
|
|
4069
|
-
cache.z = z + px;
|
|
4070
|
-
cache.scaleX = _round(scaleX);
|
|
4071
|
-
cache.scaleY = _round(scaleY);
|
|
4072
|
-
cache.rotation = _round(rotation) + deg;
|
|
4073
|
-
cache.rotationX = _round(rotationX) + deg;
|
|
4074
|
-
cache.rotationY = _round(rotationY) + deg;
|
|
4075
|
-
cache.skewX = skewX + deg;
|
|
4076
|
-
cache.skewY = skewY + deg;
|
|
4077
|
-
cache.transformPerspective = perspective + px;
|
|
4078
|
-
if (cache.zOrigin = parseFloat(origin.split(" ")[2]) || !uncache && cache.zOrigin || 0) {
|
|
4079
|
-
style[_transformOriginProp] = _firstTwoOnly(origin);
|
|
4080
|
-
}
|
|
4081
|
-
cache.xOffset = cache.yOffset = 0;
|
|
4082
|
-
cache.force3D = _config.force3D;
|
|
4083
|
-
cache.renderTransform = cache.svg ? _renderSVGTransforms : _supports3D ? _renderCSSTransforms : _renderNon3DTransforms;
|
|
4084
|
-
cache.uncache = 0;
|
|
4085
|
-
return cache;
|
|
4086
|
-
};
|
|
4087
|
-
var _firstTwoOnly = function _firstTwoOnly2(value) {
|
|
4088
|
-
return (value = value.split(" "))[0] + " " + value[1];
|
|
4089
|
-
};
|
|
4090
|
-
var _addPxTranslate = function _addPxTranslate2(target, start, value) {
|
|
4091
|
-
var unit = getUnit(start);
|
|
4092
|
-
return _round(parseFloat(start) + parseFloat(_convertToUnit(target, "x", value + "px", unit))) + unit;
|
|
4093
|
-
};
|
|
4094
|
-
var _renderNon3DTransforms = function _renderNon3DTransforms2(ratio, cache) {
|
|
4095
|
-
cache.z = "0px";
|
|
4096
|
-
cache.rotationY = cache.rotationX = "0deg";
|
|
4097
|
-
cache.force3D = 0;
|
|
4098
|
-
_renderCSSTransforms(ratio, cache);
|
|
4099
|
-
};
|
|
4100
|
-
var _zeroDeg = "0deg";
|
|
4101
|
-
var _zeroPx = "0px";
|
|
4102
|
-
var _endParenthesis = ") ";
|
|
4103
|
-
var _renderCSSTransforms = function _renderCSSTransforms2(ratio, cache) {
|
|
4104
|
-
var _ref = cache || this, xPercent = _ref.xPercent, yPercent = _ref.yPercent, x = _ref.x, y = _ref.y, z = _ref.z, rotation = _ref.rotation, rotationY = _ref.rotationY, rotationX = _ref.rotationX, skewX = _ref.skewX, skewY = _ref.skewY, scaleX = _ref.scaleX, scaleY = _ref.scaleY, transformPerspective = _ref.transformPerspective, force3D = _ref.force3D, target = _ref.target, zOrigin = _ref.zOrigin, transforms = "", use3D = force3D === "auto" && ratio && ratio !== 1 || force3D === true;
|
|
4105
|
-
if (zOrigin && (rotationX !== _zeroDeg || rotationY !== _zeroDeg)) {
|
|
4106
|
-
var angle = parseFloat(rotationY) * _DEG2RAD, a13 = Math.sin(angle), a33 = Math.cos(angle), cos;
|
|
4107
|
-
angle = parseFloat(rotationX) * _DEG2RAD;
|
|
4108
|
-
cos = Math.cos(angle);
|
|
4109
|
-
x = _addPxTranslate(target, x, a13 * cos * -zOrigin);
|
|
4110
|
-
y = _addPxTranslate(target, y, -Math.sin(angle) * -zOrigin);
|
|
4111
|
-
z = _addPxTranslate(target, z, a33 * cos * -zOrigin + zOrigin);
|
|
4112
|
-
}
|
|
4113
|
-
if (transformPerspective !== _zeroPx) {
|
|
4114
|
-
transforms += "perspective(" + transformPerspective + _endParenthesis;
|
|
4115
|
-
}
|
|
4116
|
-
if (xPercent || yPercent) {
|
|
4117
|
-
transforms += "translate(" + xPercent + "%, " + yPercent + "%) ";
|
|
4118
|
-
}
|
|
4119
|
-
if (use3D || x !== _zeroPx || y !== _zeroPx || z !== _zeroPx) {
|
|
4120
|
-
transforms += z !== _zeroPx || use3D ? "translate3d(" + x + ", " + y + ", " + z + ") " : "translate(" + x + ", " + y + _endParenthesis;
|
|
4121
|
-
}
|
|
4122
|
-
if (rotation !== _zeroDeg) {
|
|
4123
|
-
transforms += "rotate(" + rotation + _endParenthesis;
|
|
4124
|
-
}
|
|
4125
|
-
if (rotationY !== _zeroDeg) {
|
|
4126
|
-
transforms += "rotateY(" + rotationY + _endParenthesis;
|
|
4127
|
-
}
|
|
4128
|
-
if (rotationX !== _zeroDeg) {
|
|
4129
|
-
transforms += "rotateX(" + rotationX + _endParenthesis;
|
|
4130
|
-
}
|
|
4131
|
-
if (skewX !== _zeroDeg || skewY !== _zeroDeg) {
|
|
4132
|
-
transforms += "skew(" + skewX + ", " + skewY + _endParenthesis;
|
|
4133
|
-
}
|
|
4134
|
-
if (scaleX !== 1 || scaleY !== 1) {
|
|
4135
|
-
transforms += "scale(" + scaleX + ", " + scaleY + _endParenthesis;
|
|
4136
|
-
}
|
|
4137
|
-
target.style[_transformProp] = transforms || "translate(0, 0)";
|
|
4138
|
-
};
|
|
4139
|
-
var _renderSVGTransforms = function _renderSVGTransforms2(ratio, cache) {
|
|
4140
|
-
var _ref2 = cache || this, xPercent = _ref2.xPercent, yPercent = _ref2.yPercent, x = _ref2.x, y = _ref2.y, rotation = _ref2.rotation, skewX = _ref2.skewX, skewY = _ref2.skewY, scaleX = _ref2.scaleX, scaleY = _ref2.scaleY, target = _ref2.target, xOrigin = _ref2.xOrigin, yOrigin = _ref2.yOrigin, xOffset = _ref2.xOffset, yOffset = _ref2.yOffset, forceCSS = _ref2.forceCSS, tx = parseFloat(x), ty = parseFloat(y), a11, a21, a12, a22, temp;
|
|
4141
|
-
rotation = parseFloat(rotation);
|
|
4142
|
-
skewX = parseFloat(skewX);
|
|
4143
|
-
skewY = parseFloat(skewY);
|
|
4144
|
-
if (skewY) {
|
|
4145
|
-
skewY = parseFloat(skewY);
|
|
4146
|
-
skewX += skewY;
|
|
4147
|
-
rotation += skewY;
|
|
4148
|
-
}
|
|
4149
|
-
if (rotation || skewX) {
|
|
4150
|
-
rotation *= _DEG2RAD;
|
|
4151
|
-
skewX *= _DEG2RAD;
|
|
4152
|
-
a11 = Math.cos(rotation) * scaleX;
|
|
4153
|
-
a21 = Math.sin(rotation) * scaleX;
|
|
4154
|
-
a12 = Math.sin(rotation - skewX) * -scaleY;
|
|
4155
|
-
a22 = Math.cos(rotation - skewX) * scaleY;
|
|
4156
|
-
if (skewX) {
|
|
4157
|
-
skewY *= _DEG2RAD;
|
|
4158
|
-
temp = Math.tan(skewX - skewY);
|
|
4159
|
-
temp = Math.sqrt(1 + temp * temp);
|
|
4160
|
-
a12 *= temp;
|
|
4161
|
-
a22 *= temp;
|
|
4162
|
-
if (skewY) {
|
|
4163
|
-
temp = Math.tan(skewY);
|
|
4164
|
-
temp = Math.sqrt(1 + temp * temp);
|
|
4165
|
-
a11 *= temp;
|
|
4166
|
-
a21 *= temp;
|
|
4167
|
-
}
|
|
4168
|
-
}
|
|
4169
|
-
a11 = _round(a11);
|
|
4170
|
-
a21 = _round(a21);
|
|
4171
|
-
a12 = _round(a12);
|
|
4172
|
-
a22 = _round(a22);
|
|
4173
|
-
} else {
|
|
4174
|
-
a11 = scaleX;
|
|
4175
|
-
a22 = scaleY;
|
|
4176
|
-
a21 = a12 = 0;
|
|
4177
|
-
}
|
|
4178
|
-
if (tx && !~(x + "").indexOf("px") || ty && !~(y + "").indexOf("px")) {
|
|
4179
|
-
tx = _convertToUnit(target, "x", x, "px");
|
|
4180
|
-
ty = _convertToUnit(target, "y", y, "px");
|
|
4181
|
-
}
|
|
4182
|
-
if (xOrigin || yOrigin || xOffset || yOffset) {
|
|
4183
|
-
tx = _round(tx + xOrigin - (xOrigin * a11 + yOrigin * a12) + xOffset);
|
|
4184
|
-
ty = _round(ty + yOrigin - (xOrigin * a21 + yOrigin * a22) + yOffset);
|
|
4185
|
-
}
|
|
4186
|
-
if (xPercent || yPercent) {
|
|
4187
|
-
temp = target.getBBox();
|
|
4188
|
-
tx = _round(tx + xPercent / 100 * temp.width);
|
|
4189
|
-
ty = _round(ty + yPercent / 100 * temp.height);
|
|
4190
|
-
}
|
|
4191
|
-
temp = "matrix(" + a11 + "," + a21 + "," + a12 + "," + a22 + "," + tx + "," + ty + ")";
|
|
4192
|
-
target.setAttribute("transform", temp);
|
|
4193
|
-
forceCSS && (target.style[_transformProp] = temp);
|
|
4194
|
-
};
|
|
4195
|
-
var _addRotationalPropTween = function _addRotationalPropTween2(plugin, target, property, startNum, endValue) {
|
|
4196
|
-
var cap = 360, isString = _isString(endValue), endNum = parseFloat(endValue) * (isString && ~endValue.indexOf("rad") ? _RAD2DEG : 1), change = endNum - startNum, finalValue = startNum + change + "deg", direction, pt;
|
|
4197
|
-
if (isString) {
|
|
4198
|
-
direction = endValue.split("_")[1];
|
|
4199
|
-
if (direction === "short") {
|
|
4200
|
-
change %= cap;
|
|
4201
|
-
if (change !== change % (cap / 2)) {
|
|
4202
|
-
change += change < 0 ? cap : -cap;
|
|
4203
|
-
}
|
|
4204
|
-
}
|
|
4205
|
-
if (direction === "cw" && change < 0) {
|
|
4206
|
-
change = (change + cap * _bigNum2) % cap - ~~(change / cap) * cap;
|
|
4207
|
-
} else if (direction === "ccw" && change > 0) {
|
|
4208
|
-
change = (change - cap * _bigNum2) % cap - ~~(change / cap) * cap;
|
|
4209
|
-
}
|
|
4210
|
-
}
|
|
4211
|
-
plugin._pt = pt = new PropTween(plugin._pt, target, property, startNum, change, _renderPropWithEnd);
|
|
4212
|
-
pt.e = finalValue;
|
|
4213
|
-
pt.u = "deg";
|
|
4214
|
-
plugin._props.push(property);
|
|
4215
|
-
return pt;
|
|
4216
|
-
};
|
|
4217
|
-
var _assign = function _assign2(target, source) {
|
|
4218
|
-
for (var p in source) {
|
|
4219
|
-
target[p] = source[p];
|
|
4220
|
-
}
|
|
4221
|
-
return target;
|
|
4222
|
-
};
|
|
4223
|
-
var _addRawTransformPTs = function _addRawTransformPTs2(plugin, transforms, target) {
|
|
4224
|
-
var startCache = _assign({}, target._gsap), exclude = "perspective,force3D,transformOrigin,svgOrigin", style = target.style, endCache, p, startValue, endValue, startNum, endNum, startUnit, endUnit;
|
|
4225
|
-
if (startCache.svg) {
|
|
4226
|
-
startValue = target.getAttribute("transform");
|
|
4227
|
-
target.setAttribute("transform", "");
|
|
4228
|
-
style[_transformProp] = transforms;
|
|
4229
|
-
endCache = _parseTransform(target, 1);
|
|
4230
|
-
_removeProperty(target, _transformProp);
|
|
4231
|
-
target.setAttribute("transform", startValue);
|
|
4232
|
-
} else {
|
|
4233
|
-
startValue = getComputedStyle(target)[_transformProp];
|
|
4234
|
-
style[_transformProp] = transforms;
|
|
4235
|
-
endCache = _parseTransform(target, 1);
|
|
4236
|
-
style[_transformProp] = startValue;
|
|
4237
|
-
}
|
|
4238
|
-
for (p in _transformProps) {
|
|
4239
|
-
startValue = startCache[p];
|
|
4240
|
-
endValue = endCache[p];
|
|
4241
|
-
if (startValue !== endValue && exclude.indexOf(p) < 0) {
|
|
4242
|
-
startUnit = getUnit(startValue);
|
|
4243
|
-
endUnit = getUnit(endValue);
|
|
4244
|
-
startNum = startUnit !== endUnit ? _convertToUnit(target, p, startValue, endUnit) : parseFloat(startValue);
|
|
4245
|
-
endNum = parseFloat(endValue);
|
|
4246
|
-
plugin._pt = new PropTween(plugin._pt, endCache, p, startNum, endNum - startNum, _renderCSSProp);
|
|
4247
|
-
plugin._pt.u = endUnit || 0;
|
|
4248
|
-
plugin._props.push(p);
|
|
4249
|
-
}
|
|
4250
|
-
}
|
|
4251
|
-
_assign(endCache, startCache);
|
|
4252
|
-
};
|
|
4253
|
-
_forEachName("padding,margin,Width,Radius", function(name, index) {
|
|
4254
|
-
var t = "Top", r = "Right", b = "Bottom", l = "Left", props = (index < 3 ? [t, r, b, l] : [t + l, t + r, b + r, b + l]).map(function(side) {
|
|
4255
|
-
return index < 2 ? name + side : "border" + side + name;
|
|
4256
|
-
});
|
|
4257
|
-
_specialProps[index > 1 ? "border" + name : name] = function(plugin, target, property, endValue, tween) {
|
|
4258
|
-
var a, vars;
|
|
4259
|
-
if (arguments.length < 4) {
|
|
4260
|
-
a = props.map(function(prop) {
|
|
4261
|
-
return _get(plugin, prop, property);
|
|
4262
|
-
});
|
|
4263
|
-
vars = a.join(" ");
|
|
4264
|
-
return vars.split(a[0]).length === 5 ? a[0] : vars;
|
|
4265
|
-
}
|
|
4266
|
-
a = (endValue + "").split(" ");
|
|
4267
|
-
vars = {};
|
|
4268
|
-
props.forEach(function(prop, i) {
|
|
4269
|
-
return vars[prop] = a[i] = a[i] || a[(i - 1) / 2 | 0];
|
|
4270
|
-
});
|
|
4271
|
-
plugin.init(target, vars, tween);
|
|
4272
|
-
};
|
|
4273
|
-
});
|
|
4274
|
-
var CSSPlugin = {
|
|
4275
|
-
name: "css",
|
|
4276
|
-
register: _initCore,
|
|
4277
|
-
targetTest: function targetTest(target) {
|
|
4278
|
-
return target.style && target.nodeType;
|
|
4279
|
-
},
|
|
4280
|
-
init: function init3(target, vars, tween, index, targets) {
|
|
4281
|
-
var props = this._props, style = target.style, startAt = tween.vars.startAt, startValue, endValue, endNum, startNum, type, specialProp, p, startUnit, endUnit, relative, isTransformRelated, transformPropTween, cache, smooth, hasPriority, inlineProps, finalTransformValue;
|
|
4282
|
-
_pluginInitted || _initCore();
|
|
4283
|
-
this.styles = this.styles || _getStyleSaver(target);
|
|
4284
|
-
inlineProps = this.styles.props;
|
|
4285
|
-
this.tween = tween;
|
|
4286
|
-
for (p in vars) {
|
|
4287
|
-
if (p === "autoRound") {
|
|
4288
|
-
continue;
|
|
4289
|
-
}
|
|
4290
|
-
endValue = vars[p];
|
|
4291
|
-
if (_plugins[p] && _checkPlugin(p, vars, tween, index, target, targets)) {
|
|
4292
|
-
continue;
|
|
4293
|
-
}
|
|
4294
|
-
type = typeof endValue;
|
|
4295
|
-
specialProp = _specialProps[p];
|
|
4296
|
-
if (type === "function") {
|
|
4297
|
-
endValue = endValue.call(tween, index, target, targets);
|
|
4298
|
-
type = typeof endValue;
|
|
4299
|
-
}
|
|
4300
|
-
if (type === "string" && ~endValue.indexOf("random(")) {
|
|
4301
|
-
endValue = _replaceRandom(endValue);
|
|
4302
|
-
}
|
|
4303
|
-
if (specialProp) {
|
|
4304
|
-
specialProp(this, target, p, endValue, tween) && (hasPriority = 1);
|
|
4305
|
-
} else if (p.substr(0, 2) === "--") {
|
|
4306
|
-
startValue = (getComputedStyle(target).getPropertyValue(p) + "").trim();
|
|
4307
|
-
endValue += "";
|
|
4308
|
-
_colorExp.lastIndex = 0;
|
|
4309
|
-
if (!_colorExp.test(startValue)) {
|
|
4310
|
-
startUnit = getUnit(startValue);
|
|
4311
|
-
endUnit = getUnit(endValue);
|
|
4312
|
-
endUnit ? startUnit !== endUnit && (startValue = _convertToUnit(target, p, startValue, endUnit) + endUnit) : startUnit && (endValue += startUnit);
|
|
4313
|
-
}
|
|
4314
|
-
this.add(style, "setProperty", startValue, endValue, index, targets, 0, 0, p);
|
|
4315
|
-
props.push(p);
|
|
4316
|
-
inlineProps.push(p, 0, style[p]);
|
|
4317
|
-
} else if (type !== "undefined") {
|
|
4318
|
-
if (startAt && p in startAt) {
|
|
4319
|
-
startValue = typeof startAt[p] === "function" ? startAt[p].call(tween, index, target, targets) : startAt[p];
|
|
4320
|
-
_isString(startValue) && ~startValue.indexOf("random(") && (startValue = _replaceRandom(startValue));
|
|
4321
|
-
getUnit(startValue + "") || startValue === "auto" || (startValue += _config.units[p] || getUnit(_get(target, p)) || "");
|
|
4322
|
-
(startValue + "").charAt(1) === "=" && (startValue = _get(target, p));
|
|
4323
|
-
} else {
|
|
4324
|
-
startValue = _get(target, p);
|
|
4325
|
-
}
|
|
4326
|
-
startNum = parseFloat(startValue);
|
|
4327
|
-
relative = type === "string" && endValue.charAt(1) === "=" && endValue.substr(0, 2);
|
|
4328
|
-
relative && (endValue = endValue.substr(2));
|
|
4329
|
-
endNum = parseFloat(endValue);
|
|
4330
|
-
if (p in _propertyAliases) {
|
|
4331
|
-
if (p === "autoAlpha") {
|
|
4332
|
-
if (startNum === 1 && _get(target, "visibility") === "hidden" && endNum) {
|
|
4333
|
-
startNum = 0;
|
|
4334
|
-
}
|
|
4335
|
-
inlineProps.push("visibility", 0, style.visibility);
|
|
4336
|
-
_addNonTweeningPT(this, style, "visibility", startNum ? "inherit" : "hidden", endNum ? "inherit" : "hidden", !endNum);
|
|
4337
|
-
}
|
|
4338
|
-
if (p !== "scale" && p !== "transform") {
|
|
4339
|
-
p = _propertyAliases[p];
|
|
4340
|
-
~p.indexOf(",") && (p = p.split(",")[0]);
|
|
4341
|
-
}
|
|
4342
|
-
}
|
|
4343
|
-
isTransformRelated = p in _transformProps;
|
|
4344
|
-
if (isTransformRelated) {
|
|
4345
|
-
this.styles.save(p);
|
|
4346
|
-
finalTransformValue = endValue;
|
|
4347
|
-
if (type === "string" && endValue.substring(0, 6) === "var(--") {
|
|
4348
|
-
endValue = _getComputedProperty(target, endValue.substring(4, endValue.indexOf(")")));
|
|
4349
|
-
if (endValue.substring(0, 5) === "calc(") {
|
|
4350
|
-
var origPerspective = target.style.perspective;
|
|
4351
|
-
target.style.perspective = endValue;
|
|
4352
|
-
endValue = _getComputedProperty(target, "perspective");
|
|
4353
|
-
origPerspective ? target.style.perspective = origPerspective : _removeProperty(target, "perspective");
|
|
4354
|
-
}
|
|
4355
|
-
endNum = parseFloat(endValue);
|
|
4356
|
-
}
|
|
4357
|
-
if (!transformPropTween) {
|
|
4358
|
-
cache = target._gsap;
|
|
4359
|
-
cache.renderTransform && !vars.parseTransform || _parseTransform(target, vars.parseTransform);
|
|
4360
|
-
smooth = vars.smoothOrigin !== false && cache.smooth;
|
|
4361
|
-
transformPropTween = this._pt = new PropTween(this._pt, style, _transformProp, 0, 1, cache.renderTransform, cache, 0, -1);
|
|
4362
|
-
transformPropTween.dep = 1;
|
|
4363
|
-
}
|
|
4364
|
-
if (p === "scale") {
|
|
4365
|
-
this._pt = new PropTween(this._pt, cache, "scaleY", cache.scaleY, (relative ? _parseRelative(cache.scaleY, relative + endNum) : endNum) - cache.scaleY || 0, _renderCSSProp);
|
|
4366
|
-
this._pt.u = 0;
|
|
4367
|
-
props.push("scaleY", p);
|
|
4368
|
-
p += "X";
|
|
4369
|
-
} else if (p === "transformOrigin") {
|
|
4370
|
-
inlineProps.push(_transformOriginProp, 0, style[_transformOriginProp]);
|
|
4371
|
-
endValue = _convertKeywordsToPercentages(endValue);
|
|
4372
|
-
if (cache.svg) {
|
|
4373
|
-
_applySVGOrigin(target, endValue, 0, smooth, 0, this);
|
|
4374
|
-
} else {
|
|
4375
|
-
endUnit = parseFloat(endValue.split(" ")[2]) || 0;
|
|
4376
|
-
endUnit !== cache.zOrigin && _addNonTweeningPT(this, cache, "zOrigin", cache.zOrigin, endUnit);
|
|
4377
|
-
_addNonTweeningPT(this, style, p, _firstTwoOnly(startValue), _firstTwoOnly(endValue));
|
|
4378
|
-
}
|
|
4379
|
-
continue;
|
|
4380
|
-
} else if (p === "svgOrigin") {
|
|
4381
|
-
_applySVGOrigin(target, endValue, 1, smooth, 0, this);
|
|
4382
|
-
continue;
|
|
4383
|
-
} else if (p in _rotationalProperties) {
|
|
4384
|
-
_addRotationalPropTween(this, cache, p, startNum, relative ? _parseRelative(startNum, relative + endValue) : endValue);
|
|
4385
|
-
continue;
|
|
4386
|
-
} else if (p === "smoothOrigin") {
|
|
4387
|
-
_addNonTweeningPT(this, cache, "smooth", cache.smooth, endValue);
|
|
4388
|
-
continue;
|
|
4389
|
-
} else if (p === "force3D") {
|
|
4390
|
-
cache[p] = endValue;
|
|
4391
|
-
continue;
|
|
4392
|
-
} else if (p === "transform") {
|
|
4393
|
-
_addRawTransformPTs(this, endValue, target);
|
|
4394
|
-
continue;
|
|
4395
|
-
}
|
|
4396
|
-
} else if (!(p in style)) {
|
|
4397
|
-
p = _checkPropPrefix(p) || p;
|
|
4398
|
-
}
|
|
4399
|
-
if (isTransformRelated || (endNum || endNum === 0) && (startNum || startNum === 0) && !_complexExp.test(endValue) && p in style) {
|
|
4400
|
-
startUnit = (startValue + "").substr((startNum + "").length);
|
|
4401
|
-
endNum || (endNum = 0);
|
|
4402
|
-
endUnit = getUnit(endValue) || (p in _config.units ? _config.units[p] : startUnit);
|
|
4403
|
-
startUnit !== endUnit && (startNum = _convertToUnit(target, p, startValue, endUnit));
|
|
4404
|
-
this._pt = new PropTween(this._pt, isTransformRelated ? cache : style, p, startNum, (relative ? _parseRelative(startNum, relative + endNum) : endNum) - startNum, !isTransformRelated && (endUnit === "px" || p === "zIndex") && vars.autoRound !== false ? _renderRoundedCSSProp : _renderCSSProp);
|
|
4405
|
-
this._pt.u = endUnit || 0;
|
|
4406
|
-
if (isTransformRelated && finalTransformValue !== endValue) {
|
|
4407
|
-
this._pt.b = startValue;
|
|
4408
|
-
this._pt.e = finalTransformValue;
|
|
4409
|
-
this._pt.r = _renderCSSPropWithBeginningAndEnd;
|
|
4410
|
-
} else if (startUnit !== endUnit && endUnit !== "%") {
|
|
4411
|
-
this._pt.b = startValue;
|
|
4412
|
-
this._pt.r = _renderCSSPropWithBeginning;
|
|
4413
|
-
}
|
|
4414
|
-
} else if (!(p in style)) {
|
|
4415
|
-
if (p in target) {
|
|
4416
|
-
this.add(target, p, startValue || target[p], relative ? relative + endValue : endValue, index, targets);
|
|
4417
|
-
} else if (p !== "parseTransform") {
|
|
4418
|
-
_missingPlugin(p, endValue);
|
|
4419
|
-
continue;
|
|
4420
|
-
}
|
|
4421
|
-
} else {
|
|
4422
|
-
_tweenComplexCSSString.call(this, target, p, startValue, relative ? relative + endValue : endValue);
|
|
4423
|
-
}
|
|
4424
|
-
isTransformRelated || (p in style ? inlineProps.push(p, 0, style[p]) : typeof target[p] === "function" ? inlineProps.push(p, 2, target[p]()) : inlineProps.push(p, 1, startValue || target[p]));
|
|
4425
|
-
props.push(p);
|
|
4426
|
-
}
|
|
4427
|
-
}
|
|
4428
|
-
hasPriority && _sortPropTweensByPriority(this);
|
|
4429
|
-
},
|
|
4430
|
-
render: function render2(ratio, data) {
|
|
4431
|
-
if (data.tween._time || !_reverting2()) {
|
|
4432
|
-
var pt = data._pt;
|
|
4433
|
-
while (pt) {
|
|
4434
|
-
pt.r(ratio, pt.d);
|
|
4435
|
-
pt = pt._next;
|
|
4436
|
-
}
|
|
4437
|
-
} else {
|
|
4438
|
-
data.styles.revert();
|
|
4439
|
-
}
|
|
4440
|
-
},
|
|
4441
|
-
get: _get,
|
|
4442
|
-
aliases: _propertyAliases,
|
|
4443
|
-
getSetter: function getSetter(target, property, plugin) {
|
|
4444
|
-
var p = _propertyAliases[property];
|
|
4445
|
-
p && p.indexOf(",") < 0 && (property = p);
|
|
4446
|
-
return property in _transformProps && property !== _transformOriginProp && (target._gsap.x || _get(target, "x")) ? plugin && _recentSetterPlugin === plugin ? property === "scale" ? _setterScale : _setterTransform : (_recentSetterPlugin = plugin || {}) && (property === "scale" ? _setterScaleWithRender : _setterTransformWithRender) : target.style && !_isUndefined(target.style[property]) ? _setterCSSStyle : ~property.indexOf("-") ? _setterCSSProp : _getSetter(target, property);
|
|
4447
|
-
},
|
|
4448
|
-
core: {
|
|
4449
|
-
_removeProperty,
|
|
4450
|
-
_getMatrix
|
|
4451
|
-
}
|
|
4452
|
-
};
|
|
4453
|
-
gsap.utils.checkPrefix = _checkPropPrefix;
|
|
4454
|
-
gsap.core.getStyleSaver = _getStyleSaver;
|
|
4455
|
-
(function(positionAndScale, rotation, others, aliases) {
|
|
4456
|
-
var all = _forEachName(positionAndScale + "," + rotation + "," + others, function(name) {
|
|
4457
|
-
_transformProps[name] = 1;
|
|
4458
|
-
});
|
|
4459
|
-
_forEachName(rotation, function(name) {
|
|
4460
|
-
_config.units[name] = "deg";
|
|
4461
|
-
_rotationalProperties[name] = 1;
|
|
4462
|
-
});
|
|
4463
|
-
_propertyAliases[all[13]] = positionAndScale + "," + rotation;
|
|
4464
|
-
_forEachName(aliases, function(name) {
|
|
4465
|
-
var split = name.split(":");
|
|
4466
|
-
_propertyAliases[split[1]] = all[split[0]];
|
|
4467
|
-
});
|
|
4468
|
-
})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent", "rotation,rotationX,rotationY,skewX,skewY", "transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective", "0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");
|
|
4469
|
-
_forEachName("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective", function(name) {
|
|
4470
|
-
_config.units[name] = "px";
|
|
4471
|
-
});
|
|
4472
|
-
gsap.registerPlugin(CSSPlugin);
|
|
4473
|
-
|
|
4474
|
-
// ../../node_modules/.pnpm/gsap@3.14.2/node_modules/gsap/index.js
|
|
4475
|
-
var gsapWithCSS = gsap.registerPlugin(CSSPlugin) || gsap;
|
|
4476
|
-
var TweenMaxWithCSS = gsapWithCSS.core.Tween;
|
|
199
|
+
var import_gsap = __toESM(require("gsap"));
|
|
4477
200
|
|
|
4478
201
|
// #style-inject:#style-inject
|
|
4479
202
|
function styleInject(css, { insertAt } = {}) {
|
|
@@ -4509,13 +232,13 @@ var PopHero = () => {
|
|
|
4509
232
|
const centerTextRef = (0, import_react3.useRef)(null);
|
|
4510
233
|
(0, import_react3.useEffect)(() => {
|
|
4511
234
|
if (!imageWrapperRef.current || !navbarRef.current || !centerTextRef.current) return;
|
|
4512
|
-
const mm =
|
|
235
|
+
const mm = import_gsap.default.matchMedia();
|
|
4513
236
|
mm.add({
|
|
4514
237
|
isMobile: "(max-width: 768px)",
|
|
4515
238
|
isDesktop: "(min-width: 769px)"
|
|
4516
|
-
}, (
|
|
4517
|
-
const { isMobile } =
|
|
4518
|
-
|
|
239
|
+
}, (context) => {
|
|
240
|
+
const { isMobile } = context.conditions;
|
|
241
|
+
import_gsap.default.set(imageWrapperRef.current, {
|
|
4519
242
|
y: "100vh",
|
|
4520
243
|
rotation: isMobile ? 8 : 15,
|
|
4521
244
|
scale: isMobile ? 0.7 : 0.5,
|
|
@@ -4525,16 +248,16 @@ var PopHero = () => {
|
|
|
4525
248
|
borderRadius: isMobile ? "1.5rem" : "2rem",
|
|
4526
249
|
transformOrigin: "center center"
|
|
4527
250
|
});
|
|
4528
|
-
|
|
251
|
+
import_gsap.default.set(centerTextRef.current, {
|
|
4529
252
|
opacity: 0,
|
|
4530
253
|
y: 20
|
|
4531
254
|
});
|
|
4532
|
-
|
|
255
|
+
import_gsap.default.fromTo(
|
|
4533
256
|
navbarRef.current,
|
|
4534
257
|
{ opacity: 0, y: -20 },
|
|
4535
258
|
{ opacity: 1, y: 0, duration: 1, delay: 0.5, ease: "power2.out" }
|
|
4536
259
|
);
|
|
4537
|
-
const tl =
|
|
260
|
+
const tl = import_gsap.default.timeline({
|
|
4538
261
|
defaults: { ease: "power2.out" }
|
|
4539
262
|
});
|
|
4540
263
|
tl.to(imageWrapperRef.current, {
|
|
@@ -4622,26 +345,4 @@ var PopHero = () => {
|
|
|
4622
345
|
Dotlaunchbutton,
|
|
4623
346
|
PopHero
|
|
4624
347
|
});
|
|
4625
|
-
/*! Bundled license information:
|
|
4626
|
-
|
|
4627
|
-
gsap/gsap-core.js:
|
|
4628
|
-
(*!
|
|
4629
|
-
* GSAP 3.14.2
|
|
4630
|
-
* https://gsap.com
|
|
4631
|
-
*
|
|
4632
|
-
* @license Copyright 2008-2025, GreenSock. All rights reserved.
|
|
4633
|
-
* Subject to the terms at https://gsap.com/standard-license
|
|
4634
|
-
* @author: Jack Doyle, jack@greensock.com
|
|
4635
|
-
*)
|
|
4636
|
-
|
|
4637
|
-
gsap/CSSPlugin.js:
|
|
4638
|
-
(*!
|
|
4639
|
-
* CSSPlugin 3.14.2
|
|
4640
|
-
* https://gsap.com
|
|
4641
|
-
*
|
|
4642
|
-
* Copyright 2008-2025, GreenSock. All rights reserved.
|
|
4643
|
-
* Subject to the terms at https://gsap.com/standard-license
|
|
4644
|
-
* @author: Jack Doyle, jack@greensock.com
|
|
4645
|
-
*)
|
|
4646
|
-
*/
|
|
4647
348
|
//# sourceMappingURL=index.js.map
|