vendor: 4,846 bytes, lines 1-157
1(function (global, factory) { 2 typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : 3 typeof define === 'function' && define.amd ? define(['exports'], factory) : 4 (global = global || self, factory(global.window = global.window || {})); 5}(this, (function (exports) { 'use strict'; 6 7 function _inheritsLoose(subClass, superClass) { 8 subClass.prototype = Object.create(superClass.prototype); 9 subClass.prototype.constructor = subClass; 10 subClass.__proto__ = superClass; 11 } 12 13 function _assertThisInitialized(self) { 14 if (self === void 0) { 15 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 16 } 17 18 return self; 19 } 20 21 /*! 22 * GSAP 3.11.3 23 * https://greensock.com 24 * 25 * @license Copyright 2008-2022, GreenSock. All rights reserved. 26 * Subject to the terms at https://greensock.com/standard-license or for 27 * Club GreenSock members, the agreement issued with that membership. 28 * @author: Jack Doyle, [email protected] 29 */ 30 var _config = { 31 autoSleep: 120, 32 force3D: "auto", 33 nullTargetWarn: 1, 34 units: { 35 lineHeight: "" 36 } 37 }, 38 _defaults = { 39 duration: .5, 40 overwrite: false, 41 delay: 0 42 }, 43 _suppressOverwrites, 44 _reverting, 45 _context, 46 _bigNum = 1e8, 47 _tinyNum = 1 / _bigNum, 48 _2PI = Math.PI * 2, 49 _HALF_PI = _2PI / 4, 50 _gsID = 0, 51 _sqrt = Math.sqrt, 52 _cos = Math.cos, 53 _sin = Math.sin, 54 _isString = function _isString(value) { 55 return typeof value === "string"; 56 }, 57 _isFunction = function _isFunction(value) { 58 return typeof value === "function"; 59 }, 60 _isNumber = function _isNumber(value) { 61 return typeof value === "number"; 62 }, 63 _isUndefined = function _isUndefined(value) { 64 return typeof value === "undefined"; 65 }, 66 _isObject = function _isObject(value) { 67 return typeof value === "object"; 68 }, 69 _isNotFalse = function _isNotFalse(value) { 70 return value !== false; 71 }, 72 _windowExists = function _windowExists() { 73 return typeof window !== "undefined"; 74 }, 75 _isFuncOrString = function _isFuncOrString(value) { 76 return _isFunction(value) || _isString(value); 77 }, 78 _isTypedArray = typeof ArrayBuffer === "function" && ArrayBuffer.isView || function () {}, 79 _isArray = Array.isArray, 80 _strictNumExp = /(?:-?\.?\d|\.)+/gi, 81 _numExp = /[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g, 82 _numWithUnitExp = /[-+=.]*\d+[.e-]*\d*[a-z%]*/g, 83 _complexStringNumExp = /[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi, 84 _relExp = /[+-]=-?[.\d]+/, 85 _delimitedValueExp = /[^,'"\[\]\s]+/gi, 86 _unitExp = /^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i, 87 _globalTimeline, 88 _win, 89 _coreInitted, 90 _doc, 91 _globals = {}, 92 _installScope = {}, 93 _coreReady, 94 _install = function _install(scope) { 95 return (_installScope = _merge(scope, _globals)) && gsap; 96 }, 97 _missingPlugin = function _missingPlugin(property, value) { 98 return console.warn("Invalid property", property, "set to", value, "Missing plugin? gsap.registerPlugin()"); 99 }, 100 _warn = function _warn(message, suppress) { 101 return !suppress && console.warn(message); 102 }, 103 _addGlobal = function _addGlobal(name, obj) { 104 return name && (_globals[name] = obj) && _installScope && (_installScope[name] = obj) || _globals; 105 }, 106 _emptyFunc = function _emptyFunc() { 107 return 0; 108 }, 109 _startAtRevertConfig = { 110 suppressEvents: true, 111 isStart: true, 112 kill: false 113 }, 114 _revertConfigNoKill = { 115 suppressEvents: true, 116 kill: false 117 }, 118 _revertConfig = { 119 suppressEvents: true 120 }, 121 _reservedProps = {}, 122 _lazyTweens = [], 123 _lazyLookup = {}, 124 _lastRenderedFrame, 125 _plugins = {}, 126 _effects = {}, 127 _nextGCFrame = 30, 128 _harnessPlugins = [], 129 _callbackNames = "", 130 _harness = function _harness(targets) { 131 var target = targets[0], 132 harnessPlugin, 133 i; 134 _isObject(target) || _isFunction(target) || (targets = [targets]); 135 136 if (!(harnessPlugin = (target._gsap || {}).harness)) { 137 i = _harnessPlugins.length; 138 139 while (i-- && !_harnessPlugins[i].targetTest(target)) {} 140 141 harnessPlugin = _harnessPlugins[i]; 142 } 143 144 i = targets.length; 145 146 while (i--) { 147 targets[i] && (targets[i]._gsap || (targets[i]._gsap = new GSCache(targets[i], harnessPlugin))) || targets.splice(i, 1); 148 } 149 150 return targets; 151 }, 152 _getCache = function _getCache(target) { 153 return target._gsap || _harness(toArray(target))[0]._gsap; 154 }, 155 _getProperty = function _getProperty(target, property, v) { 156 return (v = target[property]) && _isFunction(v) ? target[property]() : _isUndefined(v) && target.getAttribute && target.getAttribute(property) || v; 157 },
vendor: 7,375 bytes, lines 158-392
158 _forEachName = function _forEachName(names, func) { 159 return (names = names.split(",")).forEach(func) || names; 160 }, 161 _round = function _round(value) { 162 return Math.round(value * 100000) / 100000 || 0; 163 }, 164 _roundPrecise = function _roundPrecise(value) { 165 return Math.round(value * 10000000) / 10000000 || 0; 166 }, 167 _parseRelative = function _parseRelative(start, value) { 168 var operator = value.charAt(0), 169 end = parseFloat(value.substr(2)); 170 start = parseFloat(start); 171 return operator === "+" ? start + end : operator === "-" ? start - end : operator === "*" ? start * end : start / end; 172 }, 173 _arrayContainsAny = function _arrayContainsAny(toSearch, toFind) { 174 var l = toFind.length, 175 i = 0; 176 177 for (; toSearch.indexOf(toFind[i]) < 0 && ++i < l;) {} 178 179 return i < l; 180 }, 181 _lazyRender = function _lazyRender() { 182 var l = _lazyTweens.length, 183 a = _lazyTweens.slice(0), 184 i, 185 tween; 186 187 _lazyLookup = {}; 188 _lazyTweens.length = 0; 189 190 for (i = 0; i < l; i++) { 191 tween = a[i]; 192 tween && tween._lazy && (tween.render(tween._lazy[0], tween._lazy[1], true)._lazy = 0); 193 } 194 }, 195 _lazySafeRender = function _lazySafeRender(animation, time, suppressEvents, force) { 196 _lazyTweens.length && _lazyRender(); 197 animation.render(time, suppressEvents, force || _reverting && time < 0 && (animation._initted || animation._startAt)); 198 _lazyTweens.length && _lazyRender(); 199 }, 200 _numericIfPossible = function _numericIfPossible(value) { 201 var n = parseFloat(value); 202 return (n || n === 0) && (value + "").match(_delimitedValueExp).length < 2 ? n : _isString(value) ? value.trim() : value; 203 }, 204 _passThrough = function _passThrough(p) { 205 return p; 206 }, 207 _setDefaults = function _setDefaults(obj, defaults) { 208 for (var p in defaults) { 209 p in obj || (obj[p] = defaults[p]); 210 } 211 212 return obj; 213 }, 214 _setKeyframeDefaults = function _setKeyframeDefaults(excludeDuration) { 215 return function (obj, defaults) { 216 for (var p in defaults) { 217 p in obj || p === "duration" && excludeDuration || p === "ease" || (obj[p] = defaults[p]); 218 } 219 }; 220 }, 221 _merge = function _merge(base, toMerge) { 222 for (var p in toMerge) { 223 base[p] = toMerge[p]; 224 } 225 226 return base; 227 }, 228 _mergeDeep = function _mergeDeep(base, toMerge) { 229 for (var p in toMerge) { 230 p !== "__proto__" && p !== "constructor" && p !== "prototype" && (base[p] = _isObject(toMerge[p]) ? _mergeDeep(base[p] || (base[p] = {}), toMerge[p]) : toMerge[p]); 231 } 232 233 return base; 234 }, 235 _copyExcluding = function _copyExcluding(obj, excluding) { 236 var copy = {}, 237 p; 238 239 for (p in obj) { 240 p in excluding || (copy[p] = obj[p]); 241 } 242 243 return copy; 244 }, 245 _inheritDefaults = function _inheritDefaults(vars) { 246 var parent = vars.parent || _globalTimeline, 247 func = vars.keyframes ? _setKeyframeDefaults(_isArray(vars.keyframes)) : _setDefaults; 248 249 if (_isNotFalse(vars.inherit)) { 250 while (parent) { 251 func(vars, parent.vars.defaults); 252 parent = parent.parent || parent._dp; 253 } 254 } 255 256 return vars; 257 }, 258 _arraysMatch = function _arraysMatch(a1, a2) { 259 var i = a1.length, 260 match = i === a2.length; 261 262 while (match && i-- && a1[i] === a2[i]) {} 263 264 return i < 0; 265 }, 266 _addLinkedListItem = function _addLinkedListItem(parent, child, firstProp, lastProp, sortBy) { 267 if (firstProp === void 0) { 268 firstProp = "_first"; 269 } 270 271 if (lastProp === void 0) { 272 lastProp = "_last"; 273 } 274 275 var prev = parent[lastProp], 276 t; 277 278 if (sortBy) { 279 t = child[sortBy]; 280 281 while (prev && prev[sortBy] > t) { 282 prev = prev._prev; 283 } 284 } 285 286 if (prev) { 287 child._next = prev._next; 288 prev._next = child; 289 } else { 290 child._next = parent[firstProp]; 291 parent[firstProp] = child; 292 } 293 294 if (child._next) { 295 child._next._prev = child; 296 } else { 297 parent[lastProp] = child; 298 } 299 300 child._prev = prev; 301 child.parent = child._dp = parent; 302 return child; 303 }, 304 _removeLinkedListItem = function _removeLinkedListItem(parent, child, firstProp, lastProp) { 305 if (firstProp === void 0) { 306 firstProp = "_first"; 307 } 308 309 if (lastProp === void 0) { 310 lastProp = "_last"; 311 } 312 313 var prev = child._prev, 314 next = child._next; 315 316 if (prev) { 317 prev._next = next; 318 } else if (parent[firstProp] === child) { 319 parent[firstProp] = next; 320 } 321 322 if (next) { 323 next._prev = prev; 324 } else if (parent[lastProp] === child) { 325 parent[lastProp] = prev; 326 } 327 328 child._next = child._prev = child.parent = null; 329 }, 330 _removeFromParent = function _removeFromParent(child, onlyIfParentHasAutoRemove) { 331 child.parent && (!onlyIfParentHasAutoRemove || child.parent.autoRemoveChildren) && child.parent.remove(child); 332 child._act = 0; 333 }, 334 _uncache = function _uncache(animation, child) { 335 if (animation && (!child || child._end > animation._dur || child._start < 0)) { 336 var a = animation; 337 338 while (a) { 339 a._dirty = 1; 340 a = a.parent; 341 } 342 } 343 344 return animation; 345 }, 346 _recacheAncestors = function _recacheAncestors(animation) { 347 var parent = animation.parent; 348 349 while (parent && parent.parent) { 350 parent._dirty = 1; 351 parent.totalDuration(); 352 parent = parent.parent; 353 } 354 355 return animation; 356 }, 357 _rewindStartAt = function _rewindStartAt(tween, totalTime, suppressEvents, force) { 358 return tween._startAt && (_reverting ? tween._startAt.revert(_revertConfigNoKill) : tween.vars.immediateRender && !tween.vars.autoRevert || tween._startAt.render(totalTime, true, force)); 359 }, 360 _hasNoPausedAncestors = function _hasNoPausedAncestors(animation) { 361 return !animation || animation._ts && _hasNoPausedAncestors(animation.parent); 362 }, 363 _elapsedCycleDuration = function _elapsedCycleDuration(animation) { 364 return animation._repeat ? _animationCycle(animation._tTime, animation = animation.duration() + animation._rDelay) * animation : 0; 365 }, 366 _animationCycle = function _animationCycle(tTime, cycleDuration) { 367 var whole = Math.floor(tTime /= cycleDuration); 368 return tTime && whole === tTime ? whole - 1 : whole; 369 }, 370 _parentToChildTotalTime = function _parentToChildTotalTime(parentTime, child) { 371 return (parentTime - child._start) * child._ts + (child._ts >= 0 ? 0 : child._dirty ? child.totalDuration() : child._tDur); 372 }, 373 _setEnd = function _setEnd(animation) { 374 return animation._end = _roundPrecise(animation._start + (animation._tDur / Math.abs(animation._ts || animation._rts || _tinyNum) || 0)); 375 }, 376 _alignPlayhead = function _alignPlayhead(animation, totalTime) { 377 var parent = animation._dp; 378 379 if (parent && parent.smoothChildTiming && animation._ts) { 380 animation._start = _roundPrecise(parent._time - (animation._ts > 0 ? totalTime / animation._ts : ((animation._dirty ? animation.totalDuration() : animation._tDur) - totalTime) / -animation._ts)); 381 382 _setEnd(animation); 383 384 parent._dirty || _uncache(parent, animation); 385 } 386 387 return animation; 388 }, 389 _postAddChecks = function _postAddChecks(timeline, child) { 390 var t; 391 392 if (child._time || child._initted && !child._dur
vendor: 11,458 bytes, lines 392-704
392) { 393 t = _parentToChildTotalTime(timeline.rawTime(), child); 394 395 if (!child._dur || _clamp(0, child.totalDuration(), t) - child._tTime > _tinyNum) { 396 child.render(t, true); 397 } 398 } 399 400 if (_uncache(timeline, child)._dp && timeline._initted && timeline._time >= timeline._dur && timeline._ts) { 401 if (timeline._dur < timeline.duration()) { 402 t = timeline; 403 404 while (t._dp) { 405 t.rawTime() >= 0 && t.totalTime(t._tTime); 406 t = t._dp; 407 } 408 } 409 410 timeline._zTime = -_tinyNum; 411 } 412 }, 413 _addToTimeline = function _addToTimeline(timeline, child, position, skipChecks) { 414 child.parent && _removeFromParent(child); 415 child._start = _roundPrecise((_isNumber(position) ? position : position || timeline !== _globalTimeline ? _parsePosition(timeline, position, child) : timeline._time) + child._delay); 416 child._end = _roundPrecise(child._start + (child.totalDuration() / Math.abs(child.timeScale()) || 0)); 417 418 _addLinkedListItem(timeline, child, "_first", "_last", timeline._sort ? "_start" : 0); 419 420 _isFromOrFromStart(child) || (timeline._recent = child); 421 skipChecks || _postAddChecks(timeline, child); 422 timeline._ts < 0 && _alignPlayhead(timeline, timeline._tTime); 423 return timeline; 424 }, 425 _scrollTrigger = function _scrollTrigger(animation, trigger) { 426 return (_globals.ScrollTrigger || _missingPlugin("scrollTrigger", trigger)) && _globals.ScrollTrigger.create(trigger, animation); 427 }, 428 _attemptInitTween = function _attemptInitTween(tween, time, force, suppressEvents, tTime) { 429 _initTween(tween, time, tTime); 430 431 if (!tween._initted) { 432 return 1; 433 } 434 435 if (!force && tween._pt && !_reverting && (tween._dur && tween.vars.lazy !== false || !tween._dur && tween.vars.lazy) && _lastRenderedFrame !== _ticker.frame) { 436 _lazyTweens.push(tween); 437 438 tween._lazy = [tTime, suppressEvents]; 439 return 1; 440 } 441 }, 442 _parentPlayheadIsBeforeStart = function _parentPlayheadIsBeforeStart(_ref) { 443 var parent = _ref.parent; 444 return parent && parent._ts && parent._initted && !parent._lock && (parent.rawTime() < 0 || _parentPlayheadIsBeforeStart(parent)); 445 }, 446 _isFromOrFromStart = function _isFromOrFromStart(_ref2) { 447 var data = _ref2.data; 448 return data === "isFromStart" || data === "isStart"; 449 }, 450 _renderZeroDurationTween = function _renderZeroDurationTween(tween, totalTime, suppressEvents, force) { 451 var prevRatio = tween.ratio, 452 ratio = totalTime < 0 || !totalTime && (!tween._start && _parentPlayheadIsBeforeStart(tween) && !(!tween._initted && _isFromOrFromStart(tween)) || (tween._ts < 0 || tween._dp._ts < 0) && !_isFromOrFromStart(tween)) ? 0 : 1, 453 repeatDelay = tween._rDelay, 454 tTime = 0, 455 pt, 456 iteration, 457 prevIteration; 458 459 if (repeatDelay && tween._repeat) { 460 tTime = _clamp(0, tween._tDur, totalTime); 461 iteration = _animationCycle(tTime, repeatDelay); 462 tween._yoyo && iteration & 1 && (ratio = 1 - ratio); 463 464 if (iteration !== _animationCycle(tween._tTime, repeatDelay)) { 465 prevRatio = 1 - ratio; 466 tween.vars.repeatRefresh && tween._initted && tween.invalidate(); 467 } 468 } 469 470 if (ratio !== prevRatio || _reverting || force || tween._zTime === _tinyNum || !totalTime && tween._zTime) { 471 if (!tween._initted && _attemptInitTween(tween, totalTime, force, suppressEvents, tTime)) { 472 return; 473 } 474 475 prevIteration = tween._zTime; 476 tween._zTime = totalTime || (suppressEvents ? _tinyNum : 0); 477 suppressEvents || (suppressEvents = totalTime && !prevIteration); 478 tween.ratio = ratio; 479 tween._from && (ratio = 1 - ratio); 480 tween._time = 0; 481 tween._tTime = tTime; 482 pt = tween._pt; 483 484 while (pt) { 485 pt.r(ratio, pt.d); 486 pt = pt._next; 487 } 488 489 totalTime < 0 && _rewindStartAt(tween, totalTime, suppressEvents, true); 490 tween._onUpdate && !suppressEvents && _callback(tween, "onUpdate"); 491 tTime && tween._repeat && !suppressEvents && tween.parent && _callback(tween, "onRepeat"); 492 493 if ((totalTime >= tween._tDur || totalTime < 0) && tween.ratio === ratio) { 494 ratio && _removeFromParent(tween, 1); 495 496 if (!suppressEvents && !_reverting) { 497 _callback(tween, ratio ? "onComplete" : "onReverseComplete", true); 498 499 tween._prom && tween._prom(); 500 } 501 } 502 } else if (!tween._zTime) { 503 tween._zTime = totalTime; 504 } 505 }, 506 _findNextPauseTween = function _findNextPauseTween(animation, prevTime, time) { 507 var child; 508 509 if (time > prevTime) { 510 child = animation._first; 511 512 while (child && child._start <= time) { 513 if (child.data === "isPause" && child._start > prevTime) { 514 return child; 515 } 516 517 child = child._next; 518 } 519 } else { 520 child = animation._last; 521 522 while (child && child._start >= time) { 523 if (child.data === "isPause" && child._start < prevTime) { 524 return child; 525 } 526 527 child = child._prev; 528 } 529 } 530 }, 531 _setDuration = function _setDuration(animation, duration, skipUncache, leavePlayhead) { 532 var repeat = animation._repeat, 533 dur = _roundPrecise(duration) || 0, 534 totalProgress = animation._tTime / animation._tDur; 535 totalProgress && !leavePlayhead && (animation._time *= dur / animation._dur); 536 animation._dur = dur; 537 animation._tDur = !repeat ? dur : repeat < 0 ? 1e10 : _roundPrecise(dur * (repeat + 1) + animation._rDelay * repeat); 538 totalProgress > 0 && !leavePlayhead && _alignPlayhead(animation, animation._tTime = animation._tDur * totalProgress); 539 animation.parent && _setEnd(animation); 540 skipUncache || _uncache(animation.parent, animation); 541 return animation; 542 }, 543 _onUpdateTotalDuration = function _onUpdateTotalDuration(animation) { 544 return animation instanceof Timeline ? _uncache(animation) : _setDuration(animation, animation._dur); 545 }, 546 _zeroPosition = { 547 _start: 0, 548 endTime: _emptyFunc, 549 totalDuration: _emptyFunc 550 }, 551 _parsePosition = function _parsePosition(animation, position, percentAnimation) { 552 var labels = animation.labels, 553 recent = animation._recent || _zeroPosition, 554 clippedDuration = animation.duration() >= _bigNum ? recent.endTime(false) : animation._dur, 555 i, 556 offset, 557 isPercent; 558 559 if (_isString(position) && (isNaN(position) || position in labels)) { 560 offset = position.charAt(0); 561 isPercent = position.substr(-1) === "%"; 562 i = position.indexOf("="); 563 564 if (offset === "<" || offset === ">") { 565 i >= 0 && (position = position.replace(/=/, "")); 566 return (offset === "<" ? recent._start : recent.endTime(recent._repeat >= 0)) + (parseFloat(position.substr(1)) || 0) * (isPercent ? (i < 0 ? recent : percentAnimation).totalDuration() / 100 : 1); 567 } 568 569 if (i < 0) { 570 position in labels || (labels[position] = clippedDuration); 571 return labels[position]; 572 } 573 574 offset = parseFloat(position.charAt(i - 1) + position.substr(i + 1)); 575 576 if (isPercent && percentAnimation) { 577 offset = offset / 100 * (_isArray(percentAnimation) ? percentAnimation[0] : percentAnimation).totalDuration(); 578 } 579 580 return i > 1 ? _parsePosition(animation, position.substr(0, i - 1), percentAnimation) + offset : clippedDuration + offset; 581 } 582 583 return position == null ? clippedDuration : +position; 584 }, 585 _createTweenType = function _createTweenType(type, params, timeline) { 586 var isLegacy = _isNumber(params[1]), 587 varsIndex = (isLegacy ? 2 : 1) + (type < 2 ? 0 : 1), 588 vars = params[varsIndex], 589 irVars, 590 parent; 591 592 isLegacy && (vars.duration = params[1]); 593 vars.parent = timeline; 594 595 if (type) { 596 irVars = vars; 597 parent = timeline; 598 599 while (parent && !("immediateRender" in irVars)) { 600 irVars = parent.vars.defaults || {}; 601 parent = _isNotFalse(parent.vars.inherit) && parent.parent; 602 } 603 604 vars.immediateRender = _isNotFalse(irVars.immediateRender); 605 type < 2 ? vars.runBackwards = 1 : vars.startAt = params[varsIndex - 1]; 606 } 607 608 return new Tween(params[0], vars, params[varsIndex + 1]); 609 }, 610 _conditionalReturn = function _conditionalReturn(value, func) { 611 return value || value === 0 ? func(value) : func; 612 }, 613 _clamp = function _clamp(min, max, value) { 614 return value < min ? min : value > max ? max : value; 615 }, 616 getUnit = function getUnit(value, v) { 617 return !_isString(value) || !(v = _unitExp.exec(value)) ? "" : v[1]; 618 }, 619 clamp = function clamp(min, max, value) { 620 return _conditionalReturn(value, function (v) { 621 return _clamp(min, max, v); 622 }); 623 }, 624 _slice = [].slice, 625 _isArrayLike = function _isArrayLike(value, nonEmpty) { 626 return value && _isObject(value) && "length" in value && (!nonEmpty && !value.length || value.length - 1 in value && _isObject(value[0])) && !value.nodeType && value !== _win; 627 }, 628 _flatten = function _flatten(ar, leaveStrings, accumulator) { 629 if (accumulator === void 0) { 630 accumulator = []; 631 } 632 633 return ar.forEach(function (value) { 634 var _accumulator; 635 636 return _isString(value) && !leaveStrings || _isArrayLike(value, 1) ? (_accumulator = accumulator).push.apply(_accumulator, toArray(value)) : accumulator.push(value); 637 }) || accumulator; 638 }, 639 toArray = function toArray(value, scope, leaveStrings) { 640 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] : []; 641 }, 642 selector = function selector(value) { 643 value = toArray(value)[0] || _warn("Invalid scope") || {}; 644 return function (v) { 645 var el = value.current || value.nativeElement || value; 646 return toArray(v, el.querySelectorAll ? el : el === value ? _warn("Invalid scope") || _doc.createElement("div") : value); 647 }; 648 }, 649 shuffle = function shuffle(a) { 650 return a.sort(function () { 651 return .5 - Math.random(); 652 }); 653 }, 654 distribute = function distribute(v) { 655 if (_isFunction(v)) { 656 return v; 657 } 658 659 var vars = _isObject(v) ? v : { 660 each: v 661 }, 662 ease = _parseEase(vars.ease), 663 from = vars.from || 0, 664 base = parseFloat(vars.base) || 0, 665 cache = {}, 666 isDecimal = from > 0 && from < 1, 667 ratios = isNaN(from) || isDecimal, 668 axis = vars.axis, 669 ratioX = from, 670 ratioY = from; 671 672 if (_isString(from)) { 673 ratioX = ratioY = { 674 center: .5, 675 edges: .5, 676 end: 1 677 }[from] || 0; 678 } else if (!isDecimal && ratios) { 679 ratioX = from[0]; 680 ratioY = from[1]; 681 } 682 683 return function (i, target, a) { 684 var l = (a || vars).length, 685 distances = cache[l], 686 originX, 687 originY, 688 x, 689 y, 690 d, 691 j, 692 max, 693 min, 694 wrapAt; 695 696 if (!distances) { 697 wrapAt = vars.grid === "auto" ? 0 : (vars.grid || [1, _bigNum])[1]; 698 699 if (!wrapAt) { 700 max = -_bigNum; 701 702 while (max < (max = a[wrapAt++].getBoundingClientRect().left) && wrapAt < l) {} 703 704 wrapAt
vendor: 3,154 bytes, lines 704-794
704--; 705 } 706 707 distances = cache[l] = []; 708 originX = ratios ? Math.min(wrapAt, l) * ratioX - .5 : from % wrapAt; 709 originY = wrapAt === _bigNum ? 0 : ratios ? l * ratioY / wrapAt - .5 : from / wrapAt | 0; 710 max = 0; 711 min = _bigNum; 712 713 for (j = 0; j < l; j++) { 714 x = j % wrapAt - originX; 715 y = originY - (j / wrapAt | 0); 716 distances[j] = d = !axis ? _sqrt(x * x + y * y) : Math.abs(axis === "y" ? y : x); 717 d > max && (max = d); 718 d < min && (min = d); 719 } 720 721 from === "random" && shuffle(distances); 722 distances.max = max - min; 723 distances.min = min; 724 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); 725 distances.b = l < 0 ? base - l : base; 726 distances.u = getUnit(vars.amount || vars.each) || 0; 727 ease = ease && l < 0 ? _invertEase(ease) : ease; 728 } 729 730 l = (distances[i] - distances.min) / distances.max || 0; 731 return _roundPrecise(distances.b + (ease ? ease(l) : l) * distances.v) + distances.u; 732 }; 733 }, 734 _roundModifier = function _roundModifier(v) { 735 var p = Math.pow(10, ((v + "").split(".")[1] || "").length); 736 return function (raw) { 737 var n = _roundPrecise(Math.round(parseFloat(raw) / v) * v * p); 738 739 return (n - n % 1) / p + (_isNumber(raw) ? 0 : getUnit(raw)); 740 }; 741 }, 742 snap = function snap(snapTo, value) { 743 var isArray = _isArray(snapTo), 744 radius, 745 is2D; 746 747 if (!isArray && _isObject(snapTo)) { 748 radius = isArray = snapTo.radius || _bigNum; 749 750 if (snapTo.values) { 751 snapTo = toArray(snapTo.values); 752 753 if (is2D = !_isNumber(snapTo[0])) { 754 radius *= radius; 755 } 756 } else { 757 snapTo = _roundModifier(snapTo.increment); 758 } 759 } 760 761 return _conditionalReturn(value, !isArray ? _roundModifier(snapTo) : _isFunction(snapTo) ? function (raw) { 762 is2D = snapTo(raw); 763 return Math.abs(is2D - raw) <= radius ? is2D : raw; 764 } : function (raw) { 765 var x = parseFloat(is2D ? raw.x : raw), 766 y = parseFloat(is2D ? raw.y : 0), 767 min = _bigNum, 768 closest = 0, 769 i = snapTo.length, 770 dx, 771 dy; 772 773 while (i--) { 774 if (is2D) { 775 dx = snapTo[i].x - x; 776 dy = snapTo[i].y - y; 777 dx = dx * dx + dy * dy; 778 } else { 779 dx = Math.abs(snapTo[i] - x); 780 } 781 782 if (dx < min) { 783 min = dx; 784 closest = i; 785 } 786 } 787 788 closest = !radius || min <= radius ? snapTo[closest] : raw; 789 return is2D || closest === raw || _isNumber(raw) ? closest : closest + getUnit(raw); 790 }); 791 }, 792 random = function random(min, max, roundingIncrement, returnFunction) { 793 return _conditionalReturn(_isArray(min) ? !max : roundingIncrement === true ? !!(roundingIncrement = 0) : !returnFunction, function () { 794 return _isArray(min) ? min[~~(Math.random() * min.length)] : (roundingIncrement = roundingIncrement || 1e
vendor: 4,891 bytes, lines 794-956
794-5) && (returnFunction = roundingIncrement < 1 ? Math.pow(10, (roundingIncrement + "").length - 2) : 1) && Math.floor(Math.round((min - roundingIncrement / 2 + Math.random() * (max - min + roundingIncrement * .99)) / roundingIncrement) * roundingIncrement * returnFunction) / returnFunction; 795 }); 796 }, 797 pipe = function pipe() { 798 for (var _len = arguments.length, functions = new Array(_len), _key = 0; _key < _len; _key++) { 799 functions[_key] = arguments[_key]; 800 } 801 802 return function (value) { 803 return functions.reduce(function (v, f) { 804 return f(v); 805 }, value); 806 }; 807 }, 808 unitize = function unitize(func, unit) { 809 return function (value) { 810 return func(parseFloat(value)) + (unit || getUnit(value)); 811 }; 812 }, 813 normalize = function normalize(min, max, value) { 814 return mapRange(min, max, 0, 1, value); 815 }, 816 _wrapArray = function _wrapArray(a, wrapper, value) { 817 return _conditionalReturn(value, function (index) { 818 return a[~~wrapper(index)]; 819 }); 820 }, 821 wrap = function wrap(min, max, value) { 822 var range = max - min; 823 return _isArray(min) ? _wrapArray(min, wrap(0, min.length), max) : _conditionalReturn(value, function (value) { 824 return (range + (value - min) % range) % range + min; 825 }); 826 }, 827 wrapYoyo = function wrapYoyo(min, max, value) { 828 var range = max - min, 829 total = range * 2; 830 return _isArray(min) ? _wrapArray(min, wrapYoyo(0, min.length - 1), max) : _conditionalReturn(value, function (value) { 831 value = (total + (value - min) % total) % total || 0; 832 return min + (value > range ? total - value : value); 833 }); 834 }, 835 _replaceRandom = function _replaceRandom(value) { 836 var prev = 0, 837 s = "", 838 i, 839 nums, 840 end, 841 isArray; 842 843 while (~(i = value.indexOf("random(", prev))) { 844 end = value.indexOf(")", i); 845 isArray = value.charAt(i + 7) === "["; 846 nums = value.substr(i + 7, end - i - 7).match(isArray ? _delimitedValueExp : _strictNumExp); 847 s += value.substr(prev, i - prev) + random(isArray ? nums : +nums[0], isArray ? 0 : +nums[1], +nums[2] || 1e-5); 848 prev = end + 1; 849 } 850 851 return s + value.substr(prev, value.length - prev); 852 }, 853 mapRange = function mapRange(inMin, inMax, outMin, outMax, value) { 854 var inRange = inMax - inMin, 855 outRange = outMax - outMin; 856 return _conditionalReturn(value, function (value) { 857 return outMin + ((value - inMin) / inRange * outRange || 0); 858 }); 859 }, 860 interpolate = function interpolate(start, end, progress, mutate) { 861 var func = isNaN(start + end) ? 0 : function (p) { 862 return (1 - p) * start + p * end; 863 }; 864 865 if (!func) { 866 var isString = _isString(start), 867 master = {}, 868 p, 869 i, 870 interpolators, 871 l, 872 il; 873 874 progress === true && (mutate = 1) && (progress = null); 875 876 if (isString) { 877 start = { 878 p: start 879 }; 880 end = { 881 p: end 882 }; 883 } else if (_isArray(start) && !_isArray(end)) { 884 interpolators = []; 885 l = start.length; 886 il = l - 2; 887 888 for (i = 1; i < l; i++) { 889 interpolators.push(interpolate(start[i - 1], start[i])); 890 } 891 892 l--; 893 894 func = function func(p) { 895 p *= l; 896 var i = Math.min(il, ~~p); 897 return interpolators[i](p - i); 898 }; 899 900 progress = end; 901 } else if (!mutate) { 902 start = _merge(_isArray(start) ? [] : {}, start); 903 } 904 905 if (!interpolators) { 906 for (p in end) { 907 _addPropTween.call(master, start, p, "get", end[p]); 908 } 909 910 func = function func(p) { 911 return _renderPropTweens(p, master) || (isString ? start.p : start); 912 }; 913 } 914 } 915 916 return _conditionalReturn(progress, func); 917 }, 918 _getLabelInDirection = function _getLabelInDirection(timeline, fromTime, backward) { 919 var labels = timeline.labels, 920 min = _bigNum, 921 p, 922 distance, 923 label; 924 925 for (p in labels) { 926 distance = labels[p] - fromTime; 927 928 if (distance < 0 === !!backward && distance && min > (distance = Math.abs(distance))) { 929 label = p; 930 min = distance; 931 } 932 } 933 934 return label; 935 }, 936 _callback = function _callback(animation, type, executeLazyFirst) { 937 var v = animation.vars, 938 callback = v[type], 939 prevContext = _context, 940 context = animation._ctx, 941 params, 942 scope, 943 result; 944 945 if (!callback) { 946 return; 947 } 948 949 params = v[type + "Params"]; 950 scope = v.callbackScope || animation; 951 executeLazyFirst && _lazyTweens.length && _lazyRender(); 952 context && (_context = context); 953 result = params ? callback.apply(scope, params) : callback.call(scope); 954 _context = prevContext; 955 return result; 956 },
vendor: 7,656 bytes, lines 957-1242
957 _interrupt = function _interrupt(animation) { 958 _removeFromParent(animation); 959 960 animation.scrollTrigger && animation.scrollTrigger.kill(!!_reverting); 961 animation.progress() < 1 && _callback(animation, "onInterrupt"); 962 return animation; 963 }, 964 _quickTween, 965 _createPlugin = function _createPlugin(config) { 966 config = !config.name && config["default"] || config; 967 968 var name = config.name, 969 isFunc = _isFunction(config), 970 Plugin = name && !isFunc && config.init ? function () { 971 this._props = []; 972 } : config, 973 instanceDefaults = { 974 init: _emptyFunc, 975 render: _renderPropTweens, 976 add: _addPropTween, 977 kill: _killPropTweensOf, 978 modifier: _addPluginModifier, 979 rawVars: 0 980 }, 981 statics = { 982 targetTest: 0, 983 get: 0, 984 getSetter: _getSetter, 985 aliases: {}, 986 register: 0 987 }; 988 989 _wake(); 990 991 if (config !== Plugin) { 992 if (_plugins[name]) { 993 return; 994 } 995 996 _setDefaults(Plugin, _setDefaults(_copyExcluding(config, instanceDefaults), statics)); 997 998 _merge(Plugin.prototype, _merge(instanceDefaults, _copyExcluding(config, statics))); 999 1000 _plugins[Plugin.prop = name] = Plugin; 1001 1002 if (config.targetTest) { 1003 _harnessPlugins.push(Plugin); 1004 1005 _reservedProps[name] = 1; 1006 } 1007 1008 name = (name === "css" ? "CSS" : name.charAt(0).toUpperCase() + name.substr(1)) + "Plugin"; 1009 } 1010 1011 _addGlobal(name, Plugin); 1012 1013 config.register && config.register(gsap, Plugin, PropTween); 1014 }, 1015 _255 = 255, 1016 _colorLookup = { 1017 aqua: [0, _255, _255], 1018 lime: [0, _255, 0], 1019 silver: [192, 192, 192], 1020 black: [0, 0, 0], 1021 maroon: [128, 0, 0], 1022 teal: [0, 128, 128], 1023 blue: [0, 0, _255], 1024 navy: [0, 0, 128], 1025 white: [_255, _255, _255], 1026 olive: [128, 128, 0], 1027 yellow: [_255, _255, 0], 1028 orange: [_255, 165, 0], 1029 gray: [128, 128, 128], 1030 purple: [128, 0, 128], 1031 green: [0, 128, 0], 1032 red: [_255, 0, 0], 1033 pink: [_255, 192, 203], 1034 cyan: [0, _255, _255], 1035 transparent: [_255, _255, _255, 0] 1036 }, 1037 _hue = function _hue(h, m1, m2) { 1038 h += h < 0 ? 1 : h > 1 ? -1 : 0; 1039 return (h * 6 < 1 ? m1 + (m2 - m1) * h * 6 : h < .5 ? m2 : h * 3 < 2 ? m1 + (m2 - m1) * (2 / 3 - h) * 6 : m1) * _255 + .5 | 0; 1040 }, 1041 splitColor = function splitColor(v, toHSL, forceAlpha) { 1042 var a = !v ? _colorLookup.black : _isNumber(v) ? [v >> 16, v >> 8 & _255, v & _255] : 0, 1043 r, 1044 g, 1045 b, 1046 h, 1047 s, 1048 l, 1049 max, 1050 min, 1051 d, 1052 wasHSL; 1053 1054 if (!a) { 1055 if (v.substr(-1) === ",") { 1056 v = v.substr(0, v.length - 1); 1057 } 1058 1059 if (_colorLookup[v]) { 1060 a = _colorLookup[v]; 1061 } else if (v.charAt(0) === "#") { 1062 if (v.length < 6) { 1063 r = v.charAt(1); 1064 g = v.charAt(2); 1065 b = v.charAt(3); 1066 v = "#" + r + r + g + g + b + b + (v.length === 5 ? v.charAt(4) + v.charAt(4) : ""); 1067 } 1068 1069 if (v.length === 9) { 1070 a = parseInt(v.substr(1, 6), 16); 1071 return [a >> 16, a >> 8 & _255, a & _255, parseInt(v.substr(7), 16) / 255]; 1072 } 1073 1074 v = parseInt(v.substr(1), 16); 1075 a = [v >> 16, v >> 8 & _255, v & _255]; 1076 } else if (v.substr(0, 3) === "hsl") { 1077 a = wasHSL = v.match(_strictNumExp); 1078 1079 if (!toHSL) { 1080 h = +a[0] % 360 / 360; 1081 s = +a[1] / 100; 1082 l = +a[2] / 100; 1083 g = l <= .5 ? l * (s + 1) : l + s - l * s; 1084 r = l * 2 - g; 1085 a.length > 3 && (a[3] *= 1); 1086 a[0] = _hue(h + 1 / 3, r, g); 1087 a[1] = _hue(h, r, g); 1088 a[2] = _hue(h - 1 / 3, r, g); 1089 } else if (~v.indexOf("=")) { 1090 a = v.match(_numExp); 1091 forceAlpha && a.length < 4 && (a[3] = 1); 1092 return a; 1093 } 1094 } else { 1095 a = v.match(_strictNumExp) || _colorLookup.transparent; 1096 } 1097 1098 a = a.map(Number); 1099 } 1100 1101 if (toHSL && !wasHSL) { 1102 r = a[0] / _255; 1103 g = a[1] / _255; 1104 b = a[2] / _255; 1105 max = Math.max(r, g, b); 1106 min = Math.min(r, g, b); 1107 l = (max + min) / 2; 1108 1109 if (max === min) { 1110 h = s = 0; 1111 } else { 1112 d = max - min; 1113 s = l > 0.5 ? d / (2 - max - min) : d / (max + min); 1114 h = max === r ? (g - b) / d + (g < b ? 6 : 0) : max === g ? (b - r) / d + 2 : (r - g) / d + 4; 1115 h *= 60; 1116 } 1117 1118 a[0] = ~~(h + .5); 1119 a[1] = ~~(s * 100 + .5); 1120 a[2] = ~~(l * 100 + .5); 1121 } 1122 1123 forceAlpha && a.length < 4 && (a[3] = 1); 1124 return a; 1125 }, 1126 _colorOrderData = function _colorOrderData(v) { 1127 var values = [], 1128 c = [], 1129 i = -1; 1130 v.split(_colorExp).forEach(function (v) { 1131 var a = v.match(_numWithUnitExp) || []; 1132 values.push.apply(values, a); 1133 c.push(i += a.length + 1); 1134 }); 1135 values.c = c; 1136 return values; 1137 }, 1138 _formatColors = function _formatColors(s, toHSL, orderMatchData) { 1139 var result = "", 1140 colors = (s + result).match(_colorExp), 1141 type = toHSL ? "hsla(" : "rgba(", 1142 i = 0, 1143 c, 1144 shell, 1145 d, 1146 l; 1147 1148 if (!colors) { 1149 return s; 1150 } 1151 1152 colors = colors.map(function (color) { 1153 return (color = splitColor(color, toHSL, 1)) && type + (toHSL ? color[0] + "," + color[1] + "%," + color[2] + "%," + color[3] : color.join(",")) + ")"; 1154 }); 1155 1156 if (orderMatchData) { 1157 d = _colorOrderData(s); 1158 c = orderMatchData.c; 1159 1160 if (c.join(result) !== d.c.join(result)) { 1161 shell = s.replace(_colorExp, "1").split(_numWithUnitExp); 1162 l = shell.length - 1; 1163 1164 for (; i < l; i++) { 1165 result += shell[i] + (~c.indexOf(i) ? colors.shift() || type + "0,0,0,0)" : (d.length ? d : colors.length ? colors : orderMatchData).shift()); 1166 } 1167 } 1168 } 1169 1170 if (!shell) { 1171 shell = s.split(_colorExp); 1172 l = shell.length - 1; 1173 1174 for (; i < l; i++) { 1175 result += shell[i] + colors[i]; 1176 } 1177 } 1178 1179 return result + shell[l]; 1180 }, 1181 _colorExp = function () { 1182 var s = "(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b", 1183 p; 1184 1185 for (p in _colorLookup) { 1186 s += "|" + p + "\\b"; 1187 } 1188 1189 return new RegExp(s + ")", "gi"); 1190 }(), 1191 _hslExp = /hsl[a]?\(/, 1192 _colorStringFilter = function _colorStringFilter(a) { 1193 var combined = a.join(" "), 1194 toHSL; 1195 _colorExp.lastIndex = 0; 1196 1197 if (_colorExp.test(combined)) { 1198 toHSL = _hslExp.test(combined); 1199 a[1] = _formatColors(a[1], toHSL); 1200 a[0] = _formatColors(a[0], toHSL, _colorOrderData(a[1])); 1201 return true; 1202 } 1203 }, 1204 _tickerActive, 1205 _ticker = function () { 1206 var _getTime = Date.now, 1207 _lagThreshold = 500, 1208 _adjustedLag = 33, 1209 _startTime = _getTime(), 1210 _lastUpdate = _startTime, 1211 _gap = 1000 / 240, 1212 _nextTime = _gap, 1213 _listeners = [], 1214 _id, 1215 _req, 1216 _raf, 1217 _self, 1218 _delta, 1219 _i, 1220 _tick = function _tick(v) { 1221 var elapsed = _getTime() - _lastUpdate, 1222 manual = v === true, 1223 overlap, 1224 dispatch, 1225 time, 1226 frame; 1227 1228 elapsed > _lagThreshold && (_startTime += elapsed - _adjustedLag); 1229 _lastUpdate += elapsed; 1230 time = _lastUpdate - _startTime; 1231 overlap = time - _nextTime; 1232 1233 if (overlap > 0 || manual) { 1234 frame = ++_self.frame; 1235 _delta = time - _self.time * 1000; 1236 _self.time = time = time / 1000; 1237 _nextTime += overlap + (overlap >= _gap ? 4 : _gap - overlap); 1238 dispatch = 1; 1239 } 1240 1241 manual || (_id = _req(_tick)); 1242
vendor: 4,239 bytes, lines 1243-1379
1243 if (dispatch) { 1244 for (_i = 0; _i < _listeners.length; _i++) { 1245 _listeners[_i](time, _delta, frame, v); 1246 } 1247 } 1248 }; 1249 1250 _self = { 1251 time: 0, 1252 frame: 0, 1253 tick: function tick() { 1254 _tick(true); 1255 }, 1256 deltaRatio: function deltaRatio(fps) { 1257 return _delta / (1000 / (fps || 60)); 1258 }, 1259 wake: function wake() { 1260 if (_coreReady) { 1261 if (!_coreInitted && _windowExists()) { 1262 _win = _coreInitted = window; 1263 _doc = _win.document || {}; 1264 _globals.gsap = gsap; 1265 (_win.gsapVersions || (_win.gsapVersions = [])).push(gsap.version); 1266 1267 _install(_installScope || _win.GreenSockGlobals || !_win.gsap && _win || {}); 1268 1269 _raf = _win.requestAnimationFrame; 1270 } 1271 1272 _id && _self.sleep(); 1273 1274 _req = _raf || function (f) { 1275 return setTimeout(f, _nextTime - _self.time * 1000 + 1 | 0); 1276 }; 1277 1278 _tickerActive = 1; 1279 1280 _tick(2); 1281 } 1282 }, 1283 sleep: function sleep() { 1284 (_raf ? _win.cancelAnimationFrame : clearTimeout)(_id); 1285 _tickerActive = 0; 1286 _req = _emptyFunc; 1287 }, 1288 lagSmoothing: function lagSmoothing(threshold, adjustedLag) { 1289 _lagThreshold = threshold || 1 / _tinyNum; 1290 _adjustedLag = Math.min(adjustedLag, _lagThreshold, 0); 1291 }, 1292 fps: function fps(_fps) { 1293 _gap = 1000 / (_fps || 240); 1294 _nextTime = _self.time * 1000 + _gap; 1295 }, 1296 add: function add(callback, once, prioritize) { 1297 var func = once ? function (t, d, f, v) { 1298 callback(t, d, f, v); 1299 1300 _self.remove(func); 1301 } : callback; 1302 1303 _self.remove(callback); 1304 1305 _listeners[prioritize ? "unshift" : "push"](func); 1306 1307 _wake(); 1308 1309 return func; 1310 }, 1311 remove: function remove(callback, i) { 1312 ~(i = _listeners.indexOf(callback)) && _listeners.splice(i, 1) && _i >= i && _i--; 1313 }, 1314 _listeners: _listeners 1315 }; 1316 return _self; 1317 }(), 1318 _wake = function _wake() { 1319 return !_tickerActive && _ticker.wake(); 1320 }, 1321 _easeMap = {}, 1322 _customEaseExp = /^[\d.\-M][\d.\-,\s]/, 1323 _quotesExp = /["']/g, 1324 _parseObjectInString = function _parseObjectInString(value) { 1325 var obj = {}, 1326 split = value.substr(1, value.length - 3).split(":"), 1327 key = split[0], 1328 i = 1, 1329 l = split.length, 1330 index, 1331 val, 1332 parsedVal; 1333 1334 for (; i < l; i++) { 1335 val = split[i]; 1336 index = i !== l - 1 ? val.lastIndexOf(",") : val.length; 1337 parsedVal = val.substr(0, index); 1338 obj[key] = isNaN(parsedVal) ? parsedVal.replace(_quotesExp, "").trim() : +parsedVal; 1339 key = val.substr(index + 1).trim(); 1340 } 1341 1342 return obj; 1343 }, 1344 _valueInParentheses = function _valueInParentheses(value) { 1345 var open = value.indexOf("(") + 1, 1346 close = value.indexOf(")"), 1347 nested = value.indexOf("(", open); 1348 return value.substring(open, ~nested && nested < close ? value.indexOf(")", close + 1) : close); 1349 }, 1350 _configEaseFromString = function _configEaseFromString(name) { 1351 var split = (name + "").split("("), 1352 ease = _easeMap[split[0]]; 1353 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; 1354 }, 1355 _invertEase = function _invertEase(ease) { 1356 return function (p) { 1357 return 1 - ease(1 - p); 1358 }; 1359 }, 1360 _propagateYoyoEase = function _propagateYoyoEase(timeline, isYoyo) { 1361 var child = timeline._first, 1362 ease; 1363 1364 while (child) { 1365 if (child instanceof Timeline) { 1366 _propagateYoyoEase(child, isYoyo); 1367 } else if (child.vars.yoyoEase && (!child._yoyo || !child._repeat) && child._yoyo !== isYoyo) { 1368 if (child.timeline) { 1369 _propagateYoyoEase(child.timeline, isYoyo); 1370 } else { 1371 ease = child._ease; 1372 child._ease = child._yEase; 1373 child._yEase = ease; 1374 child._yoyo = isYoyo; 1375 } 1376 } 1377 1378 child = child._next; 1379 }
vendor: 3,445 bytes, lines 1379-1490
1379 1380 }, 1381 _parseEase = function _parseEase(ease, defaultEase) { 1382 return !ease ? defaultEase : (_isFunction(ease) ? ease : _easeMap[ease] || _configEaseFromString(ease)) || defaultEase; 1383 }, 1384 _insertEase = function _insertEase(names, easeIn, easeOut, easeInOut) { 1385 if (easeOut === void 0) { 1386 easeOut = function easeOut(p) { 1387 return 1 - easeIn(1 - p); 1388 }; 1389 } 1390 1391 if (easeInOut === void 0) { 1392 easeInOut = function easeInOut(p) { 1393 return p < .5 ? easeIn(p * 2) / 2 : 1 - easeIn((1 - p) * 2) / 2; 1394 }; 1395 } 1396 1397 var ease = { 1398 easeIn: easeIn, 1399 easeOut: easeOut, 1400 easeInOut: easeInOut 1401 }, 1402 lowercaseName; 1403 1404 _forEachName(names, function (name) { 1405 _easeMap[name] = _globals[name] = ease; 1406 _easeMap[lowercaseName = name.toLowerCase()] = easeOut; 1407 1408 for (var p in ease) { 1409 _easeMap[lowercaseName + (p === "easeIn" ? ".in" : p === "easeOut" ? ".out" : ".inOut")] = _easeMap[name + "." + p] = ease[p]; 1410 } 1411 }); 1412 1413 return ease; 1414 }, 1415 _easeInOutFromOut = function _easeInOutFromOut(easeOut) { 1416 return function (p) { 1417 return p < .5 ? (1 - easeOut(1 - p * 2)) / 2 : .5 + easeOut((p - .5) * 2) / 2; 1418 }; 1419 }, 1420 _configElastic = function _configElastic(type, amplitude, period) { 1421 var p1 = amplitude >= 1 ? amplitude : 1, 1422 p2 = (period || (type ? .3 : .45)) / (amplitude < 1 ? amplitude : 1), 1423 p3 = p2 / _2PI * (Math.asin(1 / p1) || 0), 1424 easeOut = function easeOut(p) { 1425 return p === 1 ? 1 : p1 * Math.pow(2, -10 * p) * _sin((p - p3) * p2) + 1; 1426 }, 1427 ease = type === "out" ? easeOut : type === "in" ? function (p) { 1428 return 1 - easeOut(1 - p); 1429 } : _easeInOutFromOut(easeOut); 1430 1431 p2 = _2PI / p2; 1432 1433 ease.config = function (amplitude, period) { 1434 return _configElastic(type, amplitude, period); 1435 }; 1436 1437 return ease; 1438 }, 1439 _configBack = function _configBack(type, overshoot) { 1440 if (overshoot === void 0) { 1441 overshoot = 1.70158; 1442 } 1443 1444 var easeOut = function easeOut(p) { 1445 return p ? --p * p * ((overshoot + 1) * p + overshoot) + 1 : 0; 1446 }, 1447 ease = type === "out" ? easeOut : type === "in" ? function (p) { 1448 return 1 - easeOut(1 - p); 1449 } : _easeInOutFromOut(easeOut); 1450 1451 ease.config = function (overshoot) { 1452 return _configBack(type, overshoot); 1453 }; 1454 1455 return ease; 1456 }; 1457 1458 _forEachName("Linear,Quad,Cubic,Quart,Quint,Strong", function (name, i) { 1459 var power = i < 5 ? i + 1 : i; 1460 1461 _insertEase(name + ",Power" + (power - 1), i ? function (p) { 1462 return Math.pow(p, power); 1463 } : function (p) { 1464 return p; 1465 }, function (p) { 1466 return 1 - Math.pow(1 - p, power); 1467 }, function (p) { 1468 return p < .5 ? Math.pow(p * 2, power) / 2 : 1 - Math.pow((1 - p) * 2, power) / 2; 1469 }); 1470 }); 1471 1472 _easeMap.Linear.easeNone = _easeMap.none = _easeMap.Linear.easeIn; 1473 1474 _insertEase("Elastic", _configElastic("in"), _configElastic("out"), _configElastic()); 1475 1476 (function (n, c) { 1477 var n1 = 1 / c, 1478 n2 = 2 * n1, 1479 n3 = 2.5 * n1, 1480 easeOut = function easeOut(p) { 1481 return p < n1 ? n * p * p : p < n2 ? n * Math.pow(p - 1.5 / c, 2) + .75 : p < n3 ? n * (p -= 2.25 / c) * p + .9375 : n * Math.pow(p - 2.625 / c, 2) + .984375; 1482 }; 1483 1484 _insertEase("Bounce", function (p) { 1485 return 1 - easeOut(1 - p); 1486 }, easeOut); 1487 })(7.5625, 2.75); 1488 1489 _insertEase("Expo", function (p) { 1490 return
vendor: 6,314 bytes, lines 1490-1680
1490p ? Math.pow(2, 10 * (p - 1)) : 0; 1491 }); 1492 1493 _insertEase("Circ", function (p) { 1494 return -(_sqrt(1 - p * p) - 1); 1495 }); 1496 1497 _insertEase("Sine", function (p) { 1498 return p === 1 ? 1 : -_cos(p * _HALF_PI) + 1; 1499 }); 1500 1501 _insertEase("Back", _configBack("in"), _configBack("out"), _configBack()); 1502 1503 _easeMap.SteppedEase = _easeMap.steps = _globals.SteppedEase = { 1504 config: function config(steps, immediateStart) { 1505 if (steps === void 0) { 1506 steps = 1; 1507 } 1508 1509 var p1 = 1 / steps, 1510 p2 = steps + (immediateStart ? 0 : 1), 1511 p3 = immediateStart ? 1 : 0, 1512 max = 1 - _tinyNum; 1513 return function (p) { 1514 return ((p2 * _clamp(0, max, p) | 0) + p3) * p1; 1515 }; 1516 } 1517 }; 1518 _defaults.ease = _easeMap["quad.out"]; 1519 1520 _forEachName("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt", function (name) { 1521 return _callbackNames += name + "," + name + "Params,"; 1522 }); 1523 1524 var GSCache = function GSCache(target, harness) { 1525 this.id = _gsID++; 1526 target._gsap = this; 1527 this.target = target; 1528 this.harness = harness; 1529 this.get = harness ? harness.get : _getProperty; 1530 this.set = harness ? harness.getSetter : _getSetter; 1531 }; 1532 var Animation = function () { 1533 function Animation(vars) { 1534 this.vars = vars; 1535 this._delay = +vars.delay || 0; 1536 1537 if (this._repeat = vars.repeat === Infinity ? -2 : vars.repeat || 0) { 1538 this._rDelay = vars.repeatDelay || 0; 1539 this._yoyo = !!vars.yoyo || !!vars.yoyoEase; 1540 } 1541 1542 this._ts = 1; 1543 1544 _setDuration(this, +vars.duration, 1, 1); 1545 1546 this.data = vars.data; 1547 1548 if (_context) { 1549 this._ctx = _context; 1550 1551 _context.data.push(this); 1552 } 1553 1554 _tickerActive || _ticker.wake(); 1555 } 1556 1557 var _proto = Animation.prototype; 1558 1559 _proto.delay = function delay(value) { 1560 if (value || value === 0) { 1561 this.parent && this.parent.smoothChildTiming && this.startTime(this._start + value - this._delay); 1562 this._delay = value; 1563 return this; 1564 } 1565 1566 return this._delay; 1567 }; 1568 1569 _proto.duration = function duration(value) { 1570 return arguments.length ? this.totalDuration(this._repeat > 0 ? value + (value + this._rDelay) * this._repeat : value) : this.totalDuration() && this._dur; 1571 }; 1572 1573 _proto.totalDuration = function totalDuration(value) { 1574 if (!arguments.length) { 1575 return this._tDur; 1576 } 1577 1578 this._dirty = 0; 1579 return _setDuration(this, this._repeat < 0 ? value : (value - this._repeat * this._rDelay) / (this._repeat + 1)); 1580 }; 1581 1582 _proto.totalTime = function totalTime(_totalTime, suppressEvents) { 1583 _wake(); 1584 1585 if (!arguments.length) { 1586 return this._tTime; 1587 } 1588 1589 var parent = this._dp; 1590 1591 if (parent && parent.smoothChildTiming && this._ts) { 1592 _alignPlayhead(this, _totalTime); 1593 1594 !parent._dp || parent.parent || _postAddChecks(parent, this); 1595 1596 while (parent && parent.parent) { 1597 if (parent.parent._time !== parent._start + (parent._ts >= 0 ? parent._tTime / parent._ts : (parent.totalDuration() - parent._tTime) / -parent._ts)) { 1598 parent.totalTime(parent._tTime, true); 1599 } 1600 1601 parent = parent.parent; 1602 } 1603 1604 if (!this.parent && this._dp.autoRemoveChildren && (this._ts > 0 && _totalTime < this._tDur || this._ts < 0 && _totalTime > 0 || !this._tDur && !_totalTime)) { 1605 _addToTimeline(this._dp, this, this._start - this._delay); 1606 } 1607 } 1608 1609 if (this._tTime !== _totalTime || !this._dur && !suppressEvents || this._initted && Math.abs(this._zTime) === _tinyNum || !_totalTime && !this._initted && (this.add || this._ptLookup)) { 1610 this._ts || (this._pTime = _totalTime); 1611 1612 _lazySafeRender(this, _totalTime, suppressEvents); 1613 } 1614 1615 return this; 1616 }; 1617 1618 _proto.time = function time(value, suppressEvents) { 1619 return arguments.length ? this.totalTime(Math.min(this.totalDuration(), value + _elapsedCycleDuration(this)) % (this._dur + this._rDelay) || (value ? this._dur : 0), suppressEvents) : this._time; 1620 }; 1621 1622 _proto.totalProgress = function totalProgress(value, suppressEvents) { 1623 return arguments.length ? this.totalTime(this.totalDuration() * value, suppressEvents) : this.totalDuration() ? Math.min(1, this._tTime / this._tDur) : this.ratio; 1624 }; 1625 1626 _proto.progress = function progress(value, suppressEvents) { 1627 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.ratio; 1628 }; 1629 1630 _proto.iteration = function iteration(value, suppressEvents) { 1631 var cycleDuration = this.duration() + this._rDelay; 1632 1633 return arguments.length ? this.totalTime(this._time + (value - 1) * cycleDuration, suppressEvents) : this._repeat ? _animationCycle(this._tTime, cycleDuration) + 1 : 1; 1634 }; 1635 1636 _proto.timeScale = function timeScale(value) { 1637 if (!arguments.length) { 1638 return this._rts === -_tinyNum ? 0 : this._rts; 1639 } 1640 1641 if (this._rts === value) { 1642 return this; 1643 } 1644 1645 var tTime = this.parent && this._ts ? _parentToChildTotalTime(this.parent._time, this) : this._tTime; 1646 this._rts = +value || 0; 1647 this._ts = this._ps || value === -_tinyNum ? 0 : this._rts; 1648 this.totalTime(_clamp(-this._delay, this._tDur, tTime), true); 1649 1650 _setEnd(this); 1651 1652 return _recacheAncestors(this); 1653 }; 1654 1655 _proto.paused = function paused(value) { 1656 if (!arguments.length) { 1657 return this._ps; 1658 } 1659 1660 if (this._ps !== value) { 1661 this._ps = value; 1662 1663 if (value) { 1664 this._pTime = this._tTime || Math.max(-this._delay, this.rawTime()); 1665 this._ts = this._act = 0; 1666 } else { 1667 _wake(); 1668 1669 this._ts = this._rts; 1670 this.totalTime(this.parent && !this.parent.smoothChildTiming ? this.rawTime() : this._tTime || this._pTime, this.progress() === 1 && Math.abs(this._zTime) !== _tinyNum && (this._tTime -= _tinyNum)); 1671 } 1672 } 1673 1674 return this; 1675 }; 1676 1677 _proto.startTime = function startTime(value) { 1678 if (arguments.length) { 1679 this._start = value; 1680 var parent = this.parent || this._dp;
vendor: 3,424 bytes, lines 1681-1793
1681 parent && (parent._sort || !this.parent) && _addToTimeline(parent, this, value - this._delay); 1682 return this; 1683 } 1684 1685 return this._start; 1686 }; 1687 1688 _proto.endTime = function endTime(includeRepeats) { 1689 return this._start + (_isNotFalse(includeRepeats) ? this.totalDuration() : this.duration()) / Math.abs(this._ts || 1); 1690 }; 1691 1692 _proto.rawTime = function rawTime(wrapRepeats) { 1693 var parent = this.parent || this._dp; 1694 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); 1695 }; 1696 1697 _proto.revert = function revert(config) { 1698 if (config === void 0) { 1699 config = _revertConfig; 1700 } 1701 1702 var prevIsReverting = _reverting; 1703 _reverting = config; 1704 1705 if (this._initted || this._startAt) { 1706 this.timeline && this.timeline.revert(config); 1707 this.totalTime(-0.01, config.suppressEvents); 1708 } 1709 1710 this.data !== "nested" && config.kill !== false && this.kill(); 1711 _reverting = prevIsReverting; 1712 return this; 1713 }; 1714 1715 _proto.globalTime = function globalTime(rawTime) { 1716 var animation = this, 1717 time = arguments.length ? rawTime : animation.rawTime(); 1718 1719 while (animation) { 1720 time = animation._start + time / (animation._ts || 1); 1721 animation = animation._dp; 1722 } 1723 1724 return !this.parent && this.vars.immediateRender ? -1 : time; 1725 }; 1726 1727 _proto.repeat = function repeat(value) { 1728 if (arguments.length) { 1729 this._repeat = value === Infinity ? -2 : value; 1730 return _onUpdateTotalDuration(this); 1731 } 1732 1733 return this._repeat === -2 ? Infinity : this._repeat; 1734 }; 1735 1736 _proto.repeatDelay = function repeatDelay(value) { 1737 if (arguments.length) { 1738 var time = this._time; 1739 this._rDelay = value; 1740 1741 _onUpdateTotalDuration(this); 1742 1743 return time ? this.time(time) : this; 1744 } 1745 1746 return this._rDelay; 1747 }; 1748 1749 _proto.yoyo = function yoyo(value) { 1750 if (arguments.length) { 1751 this._yoyo = value; 1752 return this; 1753 } 1754 1755 return this._yoyo; 1756 }; 1757 1758 _proto.seek = function seek(position, suppressEvents) { 1759 return this.totalTime(_parsePosition(this, position), _isNotFalse(suppressEvents)); 1760 }; 1761 1762 _proto.restart = function restart(includeDelay, suppressEvents) { 1763 return this.play().totalTime(includeDelay ? -this._delay : 0, _isNotFalse(suppressEvents)); 1764 }; 1765 1766 _proto.play = function play(from, suppressEvents) { 1767 from != null && this.seek(from, suppressEvents); 1768 return this.reversed(false).paused(false); 1769 }; 1770 1771 _proto.reverse = function reverse(from, suppressEvents) { 1772 from != null && this.seek(from || this.totalDuration(), suppressEvents); 1773 return this.reversed(true).paused(false); 1774 }; 1775 1776 _proto.pause = function pause(atTime, suppressEvents) { 1777 atTime != null && this.seek(atTime, suppressEvents); 1778 return this.paused(true); 1779 }; 1780 1781 _proto.resume = function resume() { 1782 return this.paused(false); 1783 }; 1784 1785 _proto.reversed = function reversed(value) { 1786 if (arguments.length) { 1787 !!value !== this.reversed() && this.timeScale(-this._rts || (value ? -_tinyNum : 0)); 1788 return this; 1789 } 1790 1791 return this._rts < 0; 1792 }; 1793
vendor: 8,586 bytes, lines 1794-2065
1794 _proto.invalidate = function invalidate() { 1795 this._initted = this._act = 0; 1796 this._zTime = -_tinyNum; 1797 return this; 1798 }; 1799 1800 _proto.isActive = function isActive() { 1801 var parent = this.parent || this._dp, 1802 start = this._start, 1803 rawTime; 1804 return !!(!parent || this._ts && this._initted && parent.isActive() && (rawTime = parent.rawTime(true)) >= start && rawTime < this.endTime(true) - _tinyNum); 1805 }; 1806 1807 _proto.eventCallback = function eventCallback(type, callback, params) { 1808 var vars = this.vars; 1809 1810 if (arguments.length > 1) { 1811 if (!callback) { 1812 delete vars[type]; 1813 } else { 1814 vars[type] = callback; 1815 params && (vars[type + "Params"] = params); 1816 type === "onUpdate" && (this._onUpdate = callback); 1817 } 1818 1819 return this; 1820 } 1821 1822 return vars[type]; 1823 }; 1824 1825 _proto.then = function then(onFulfilled) { 1826 var self = this; 1827 return new Promise(function (resolve) { 1828 var f = _isFunction(onFulfilled) ? onFulfilled : _passThrough, 1829 _resolve = function _resolve() { 1830 var _then = self.then; 1831 self.then = null; 1832 _isFunction(f) && (f = f(self)) && (f.then || f === self) && (self.then = _then); 1833 resolve(f); 1834 self.then = _then; 1835 }; 1836 1837 if (self._initted && self.totalProgress() === 1 && self._ts >= 0 || !self._tTime && self._ts < 0) { 1838 _resolve(); 1839 } else { 1840 self._prom = _resolve; 1841 } 1842 }); 1843 }; 1844 1845 _proto.kill = function kill() { 1846 _interrupt(this); 1847 }; 1848 1849 return Animation; 1850 }(); 1851 1852 _setDefaults(Animation.prototype, { 1853 _time: 0, 1854 _start: 0, 1855 _end: 0, 1856 _tTime: 0, 1857 _tDur: 0, 1858 _dirty: 0, 1859 _repeat: 0, 1860 _yoyo: false, 1861 parent: null, 1862 _initted: false, 1863 _rDelay: 0, 1864 _ts: 1, 1865 _dp: 0, 1866 ratio: 0, 1867 _zTime: -_tinyNum, 1868 _prom: 0, 1869 _ps: false, 1870 _rts: 1 1871 }); 1872 1873 var Timeline = function (_Animation) { 1874 _inheritsLoose(Timeline, _Animation); 1875 1876 function Timeline(vars, position) { 1877 var _this; 1878 1879 if (vars === void 0) { 1880 vars = {}; 1881 } 1882 1883 _this = _Animation.call(this, vars) || this; 1884 _this.labels = {}; 1885 _this.smoothChildTiming = !!vars.smoothChildTiming; 1886 _this.autoRemoveChildren = !!vars.autoRemoveChildren; 1887 _this._sort = _isNotFalse(vars.sortChildren); 1888 _globalTimeline && _addToTimeline(vars.parent || _globalTimeline, _assertThisInitialized(_this), position); 1889 vars.reversed && _this.reverse(); 1890 vars.paused && _this.paused(true); 1891 vars.scrollTrigger && _scrollTrigger(_assertThisInitialized(_this), vars.scrollTrigger); 1892 return _this; 1893 } 1894 1895 var _proto2 = Timeline.prototype; 1896 1897 _proto2.to = function to(targets, vars, position) { 1898 _createTweenType(0, arguments, this); 1899 1900 return this; 1901 }; 1902 1903 _proto2.from = function from(targets, vars, position) { 1904 _createTweenType(1, arguments, this); 1905 1906 return this; 1907 }; 1908 1909 _proto2.fromTo = function fromTo(targets, fromVars, toVars, position) { 1910 _createTweenType(2, arguments, this); 1911 1912 return this; 1913 }; 1914 1915 _proto2.set = function set(targets, vars, position) { 1916 vars.duration = 0; 1917 vars.parent = this; 1918 _inheritDefaults(vars).repeatDelay || (vars.repeat = 0); 1919 vars.immediateRender = !!vars.immediateRender; 1920 new Tween(targets, vars, _parsePosition(this, position), 1); 1921 return this; 1922 }; 1923 1924 _proto2.call = function call(callback, params, position) { 1925 return _addToTimeline(this, Tween.delayedCall(0, callback, params), position); 1926 }; 1927 1928 _proto2.staggerTo = function staggerTo(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams) { 1929 vars.duration = duration; 1930 vars.stagger = vars.stagger || stagger; 1931 vars.onComplete = onCompleteAll; 1932 vars.onCompleteParams = onCompleteAllParams; 1933 vars.parent = this; 1934 new Tween(targets, vars, _parsePosition(this, position)); 1935 return this; 1936 }; 1937 1938 _proto2.staggerFrom = function staggerFrom(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams) { 1939 vars.runBackwards = 1; 1940 _inheritDefaults(vars).immediateRender = _isNotFalse(vars.immediateRender); 1941 return this.staggerTo(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams); 1942 }; 1943 1944 _proto2.staggerFromTo = function staggerFromTo(targets, duration, fromVars, toVars, stagger, position, onCompleteAll, onCompleteAllParams) { 1945 toVars.startAt = fromVars; 1946 _inheritDefaults(toVars).immediateRender = _isNotFalse(toVars.immediateRender); 1947 return this.staggerTo(targets, duration, toVars, stagger, position, onCompleteAll, onCompleteAllParams); 1948 }; 1949 1950 _proto2.render = function render(totalTime, suppressEvents, force) { 1951 var prevTime = this._time, 1952 tDur = this._dirty ? this.totalDuration() : this._tDur, 1953 dur = this._dur, 1954 tTime = totalTime <= 0 ? 0 : _roundPrecise(totalTime), 1955 crossingStart = this._zTime < 0 !== totalTime < 0 && (this._initted || !dur), 1956 time, 1957 child, 1958 next, 1959 iteration, 1960 cycleDuration, 1961 prevPaused, 1962 pauseTween, 1963 timeScale, 1964 prevStart, 1965 prevIteration, 1966 yoyo, 1967 isYoyo; 1968 this !== _globalTimeline && tTime > tDur && totalTime >= 0 && (tTime = tDur); 1969 1970 if (tTime !== this._tTime || force || crossingStart) { 1971 if (prevTime !== this._time && dur) { 1972 tTime += this._time - prevTime; 1973 totalTime += this._time - prevTime; 1974 } 1975 1976 time = tTime; 1977 prevStart = this._start; 1978 timeScale = this._ts; 1979 prevPaused = !timeScale; 1980 1981 if (crossingStart) { 1982 dur || (prevTime = this._zTime); 1983 (totalTime || !suppressEvents) && (this._zTime = totalTime); 1984 } 1985 1986 if (this._repeat) { 1987 yoyo = this._yoyo; 1988 cycleDuration = dur + this._rDelay; 1989 1990 if (this._repeat < -1 && totalTime < 0) { 1991 return this.totalTime(cycleDuration * 100 + totalTime, suppressEvents, force); 1992 } 1993 1994 time = _roundPrecise(tTime % cycleDuration); 1995 1996 if (tTime === tDur) { 1997 iteration = this._repeat; 1998 time = dur; 1999 } else { 2000 iteration = ~~(tTime / cycleDuration); 2001 2002 if (iteration && iteration === tTime / cycleDuration) { 2003 time = dur; 2004 iteration--; 2005 } 2006 2007 time > dur && (time = dur); 2008 } 2009 2010 prevIteration = _animationCycle(this._tTime, cycleDuration); 2011 !prevTime && this._tTime && prevIteration !== iteration && (prevIteration = iteration); 2012 2013 if (yoyo && iteration & 1) { 2014 time = dur - time; 2015 isYoyo = 1; 2016 } 2017 2018 if (iteration !== prevIteration && !this._lock) { 2019 var rewinding = yoyo && prevIteration & 1, 2020 doesWrap = rewinding === (yoyo && iteration & 1); 2021 iteration < prevIteration && (rewinding = !rewinding); 2022 prevTime = rewinding ? 0 : dur; 2023 this._lock = 1; 2024 this.render(prevTime || (isYoyo ? 0 : _roundPrecise(iteration * cycleDuration)), suppressEvents, !dur)._lock = 0; 2025 this._tTime = tTime; 2026 !suppressEvents && this.parent && _callback(this, "onRepeat"); 2027 this.vars.repeatRefresh && !isYoyo && (this.invalidate()._lock = 1); 2028 2029 if (prevTime && prevTime !== this._time || prevPaused !== !this._ts || this.vars.onRepeat && !this.parent && !this._act) { 2030 return this; 2031 } 2032 2033 dur = this._dur; 2034 tDur = this._tDur; 2035 2036 if (doesWrap) { 2037 this._lock = 2; 2038 prevTime = rewinding ? dur : -0.0001; 2039 this.render(prevTime, true); 2040 this.vars.repeatRefresh && !isYoyo && this.invalidate(); 2041 } 2042 2043 this._lock = 0; 2044 2045 if (!this._ts && !prevPaused) { 2046 return this; 2047 } 2048 2049 _propagateYoyoEase(this, isYoyo); 2050 } 2051 } 2052 2053 if (this._hasPause && !this._forcing && this._lock < 2) { 2054 pauseTween = _findNextPauseTween(this, _roundPrecise(prevTime), _roundPrecise(time)); 2055 2056 if (pauseTween) { 2057 tTime -= time - (time = pauseTween._start); 2058 } 2059 } 2060 2061 this._tTime = tTime; 2062 this._time = time; 2063 this._act = !timeScale; 2064 2065 if (!this._initted) {
vendor: 15,188 bytes, lines 2066-2598
2066 this._onUpdate = this.vars.onUpdate; 2067 this._initted = 1; 2068 this._zTime = totalTime; 2069 prevTime = 0; 2070 } 2071 2072 if (!prevTime && time && !suppressEvents) { 2073 _callback(this, "onStart"); 2074 2075 if (this._tTime !== tTime) { 2076 return this; 2077 } 2078 } 2079 2080 if (time >= prevTime && totalTime >= 0) { 2081 child = this._first; 2082 2083 while (child) { 2084 next = child._next; 2085 2086 if ((child._act || time >= child._start) && child._ts && pauseTween !== child) { 2087 if (child.parent !== this) { 2088 return this.render(totalTime, suppressEvents, force); 2089 } 2090 2091 child.render(child._ts > 0 ? (time - child._start) * child._ts : (child._dirty ? child.totalDuration() : child._tDur) + (time - child._start) * child._ts, suppressEvents, force); 2092 2093 if (time !== this._time || !this._ts && !prevPaused) { 2094 pauseTween = 0; 2095 next && (tTime += this._zTime = -_tinyNum); 2096 break; 2097 } 2098 } 2099 2100 child = next; 2101 } 2102 } else { 2103 child = this._last; 2104 var adjustedTime = totalTime < 0 ? totalTime : time; 2105 2106 while (child) { 2107 next = child._prev; 2108 2109 if ((child._act || adjustedTime <= child._end) && child._ts && pauseTween !== child) { 2110 if (child.parent !== this) { 2111 return this.render(totalTime, suppressEvents, force); 2112 } 2113 2114 child.render(child._ts > 0 ? (adjustedTime - child._start) * child._ts : (child._dirty ? child.totalDuration() : child._tDur) + (adjustedTime - child._start) * child._ts, suppressEvents, force || _reverting && (child._initted || child._startAt)); 2115 2116 if (time !== this._time || !this._ts && !prevPaused) { 2117 pauseTween = 0; 2118 next && (tTime += this._zTime = adjustedTime ? -_tinyNum : _tinyNum); 2119 break; 2120 } 2121 } 2122 2123 child = next; 2124 } 2125 } 2126 2127 if (pauseTween && !suppressEvents) { 2128 this.pause(); 2129 pauseTween.render(time >= prevTime ? 0 : -_tinyNum)._zTime = time >= prevTime ? 1 : -1; 2130 2131 if (this._ts) { 2132 this._start = prevStart; 2133 2134 _setEnd(this); 2135 2136 return this.render(totalTime, suppressEvents, force); 2137 } 2138 } 2139 2140 this._onUpdate && !suppressEvents && _callback(this, "onUpdate", true); 2141 if (tTime === tDur && this._tTime >= this.totalDuration() || !tTime && prevTime) if (prevStart === this._start || Math.abs(timeScale) !== Math.abs(this._ts)) if (!this._lock) { 2142 (totalTime || !dur) && (tTime === tDur && this._ts > 0 || !tTime && this._ts < 0) && _removeFromParent(this, 1); 2143 2144 if (!suppressEvents && !(totalTime < 0 && !prevTime) && (tTime || prevTime || !tDur)) { 2145 _callback(this, tTime === tDur && totalTime >= 0 ? "onComplete" : "onReverseComplete", true); 2146 2147 this._prom && !(tTime < tDur && this.timeScale() > 0) && this._prom(); 2148 } 2149 } 2150 } 2151 2152 return this; 2153 }; 2154 2155 _proto2.add = function add(child, position) { 2156 var _this2 = this; 2157 2158 _isNumber(position) || (position = _parsePosition(this, position, child)); 2159 2160 if (!(child instanceof Animation)) { 2161 if (_isArray(child)) { 2162 child.forEach(function (obj) { 2163 return _this2.add(obj, position); 2164 }); 2165 return this; 2166 } 2167 2168 if (_isString(child)) { 2169 return this.addLabel(child, position); 2170 } 2171 2172 if (_isFunction(child)) { 2173 child = Tween.delayedCall(0, child); 2174 } else { 2175 return this; 2176 } 2177 } 2178 2179 return this !== child ? _addToTimeline(this, child, position) : this; 2180 }; 2181 2182 _proto2.getChildren = function getChildren(nested, tweens, timelines, ignoreBeforeTime) { 2183 if (nested === void 0) { 2184 nested = true; 2185 } 2186 2187 if (tweens === void 0) { 2188 tweens = true; 2189 } 2190 2191 if (timelines === void 0) { 2192 timelines = true; 2193 } 2194 2195 if (ignoreBeforeTime === void 0) { 2196 ignoreBeforeTime = -_bigNum; 2197 } 2198 2199 var a = [], 2200 child = this._first; 2201 2202 while (child) { 2203 if (child._start >= ignoreBeforeTime) { 2204 if (child instanceof Tween) { 2205 tweens && a.push(child); 2206 } else { 2207 timelines && a.push(child); 2208 nested && a.push.apply(a, child.getChildren(true, tweens, timelines)); 2209 } 2210 } 2211 2212 child = child._next; 2213 } 2214 2215 return a; 2216 }; 2217 2218 _proto2.getById = function getById(id) { 2219 var animations = this.getChildren(1, 1, 1), 2220 i = animations.length; 2221 2222 while (i--) { 2223 if (animations[i].vars.id === id) { 2224 return animations[i]; 2225 } 2226 } 2227 }; 2228 2229 _proto2.remove = function remove(child) { 2230 if (_isString(child)) { 2231 return this.removeLabel(child); 2232 } 2233 2234 if (_isFunction(child)) { 2235 return this.killTweensOf(child); 2236 } 2237 2238 _removeLinkedListItem(this, child); 2239 2240 if (child === this._recent) { 2241 this._recent = this._last; 2242 } 2243 2244 return _uncache(this); 2245 }; 2246 2247 _proto2.totalTime = function totalTime(_totalTime2, suppressEvents) { 2248 if (!arguments.length) { 2249 return this._tTime; 2250 } 2251 2252 this._forcing = 1; 2253 2254 if (!this._dp && this._ts) { 2255 this._start = _roundPrecise(_ticker.time - (this._ts > 0 ? _totalTime2 / this._ts : (this.totalDuration() - _totalTime2) / -this._ts)); 2256 } 2257 2258 _Animation.prototype.totalTime.call(this, _totalTime2, suppressEvents); 2259 2260 this._forcing = 0; 2261 return this; 2262 }; 2263 2264 _proto2.addLabel = function addLabel(label, position) { 2265 this.labels[label] = _parsePosition(this, position); 2266 return this; 2267 }; 2268 2269 _proto2.removeLabel = function removeLabel(label) { 2270 delete this.labels[label]; 2271 return this; 2272 }; 2273 2274 _proto2.addPause = function addPause(position, callback, params) { 2275 var t = Tween.delayedCall(0, callback || _emptyFunc, params); 2276 t.data = "isPause"; 2277 this._hasPause = 1; 2278 return _addToTimeline(this, t, _parsePosition(this, position)); 2279 }; 2280 2281 _proto2.removePause = function removePause(position) { 2282 var child = this._first; 2283 position = _parsePosition(this, position); 2284 2285 while (child) { 2286 if (child._start === position && child.data === "isPause") { 2287 _removeFromParent(child); 2288 } 2289 2290 child = child._next; 2291 } 2292 }; 2293 2294 _proto2.killTweensOf = function killTweensOf(targets, props, onlyActive) { 2295 var tweens = this.getTweensOf(targets, onlyActive), 2296 i = tweens.length; 2297 2298 while (i--) { 2299 _overwritingTween !== tweens[i] && tweens[i].kill(targets, props); 2300 } 2301 2302 return this; 2303 }; 2304 2305 _proto2.getTweensOf = function getTweensOf(targets, onlyActive) { 2306 var a = [], 2307 parsedTargets = toArray(targets), 2308 child = this._first, 2309 isGlobalTime = _isNumber(onlyActive), 2310 children; 2311 2312 while (child) { 2313 if (child instanceof Tween) { 2314 if (_arrayContainsAny(child._targets, parsedTargets) && (isGlobalTime ? (!_overwritingTween || child._initted && child._ts) && child.globalTime(0) <= onlyActive && child.globalTime(child.totalDuration()) > onlyActive : !onlyActive || child.isActive())) { 2315 a.push(child); 2316 } 2317 } else if ((children = child.getTweensOf(parsedTargets, onlyActive)).length) { 2318 a.push.apply(a, children); 2319 } 2320 2321 child = child._next; 2322 } 2323 2324 return a; 2325 }; 2326 2327 _proto2.tweenTo = function tweenTo(position, vars) { 2328 vars = vars || {}; 2329 2330 var tl = this, 2331 endTime = _parsePosition(tl, position), 2332 _vars = vars, 2333 startAt = _vars.startAt, 2334 _onStart = _vars.onStart, 2335 onStartParams = _vars.onStartParams, 2336 immediateRender = _vars.immediateRender, 2337 initted, 2338 tween = Tween.to(tl, _setDefaults({ 2339 ease: vars.ease || "none", 2340 lazy: false, 2341 immediateRender: false, 2342 time: endTime, 2343 overwrite: "auto", 2344 duration: vars.duration || Math.abs((endTime - (startAt && "time" in startAt ? startAt.time : tl._time)) / tl.timeScale()) || _tinyNum, 2345 onStart: function onStart() { 2346 tl.pause(); 2347 2348 if (!initted) { 2349 var duration = vars.duration || Math.abs((endTime - (startAt && "time" in startAt ? startAt.time : tl._time)) / tl.timeScale()); 2350 tween._dur !== duration && _setDuration(tween, duration, 0, 1).render(tween._time, true, true); 2351 initted = 1; 2352 } 2353 2354 _onStart && _onStart.apply(tween, onStartParams || []); 2355 } 2356 }, vars)); 2357 2358 return immediateRender ? tween.render(0) : tween; 2359 }; 2360 2361 _proto2.tweenFromTo = function tweenFromTo(fromPosition, toPosition, vars) { 2362 return this.tweenTo(toPosition, _setDefaults({ 2363 startAt: { 2364 time: _parsePosition(this, fromPosition) 2365 } 2366 }, vars)); 2367 }; 2368 2369 _proto2.recent = function recent() { 2370 return this._recent; 2371 }; 2372 2373 _proto2.nextLabel = function nextLabel(afterTime) { 2374 if (afterTime === void 0) { 2375 afterTime = this._time; 2376 } 2377 2378 return _getLabelInDirection(this, _parsePosition(this, afterTime)); 2379 }; 2380 2381 _proto2.previousLabel = function previousLabel(beforeTime) { 2382 if (beforeTime === void 0) { 2383 beforeTime = this._time; 2384 } 2385 2386 return _getLabelInDirection(this, _parsePosition(this, beforeTime), 1); 2387 }; 2388 2389 _proto2.currentLabel = function currentLabel(value) { 2390 return arguments.length ? this.seek(value, true) : this.previousLabel(this._time + _tinyNum); 2391 }; 2392 2393 _proto2.shiftChildren = function shiftChildren(amount, adjustLabels, ignoreBeforeTime) { 2394 if (ignoreBeforeTime === void 0) { 2395 ignoreBeforeTime = 0; 2396 } 2397 2398 var child = this._first, 2399 labels = this.labels, 2400 p; 2401 2402 while (child) { 2403 if (child._start >= ignoreBeforeTime) { 2404 child._start += amount; 2405 child._end += amount; 2406 } 2407 2408 child = child._next; 2409 } 2410 2411 if (adjustLabels) { 2412 for (p in labels) { 2413 if (labels[p] >= ignoreBeforeTime) { 2414 labels[p] += amount; 2415 } 2416 } 2417 } 2418 2419 return _uncache(this); 2420 }; 2421 2422 _proto2.invalidate = function invalidate(soft) { 2423 var child = this._first; 2424 this._lock = 0; 2425 2426 while (child) { 2427 child.invalidate(soft); 2428 child = child._next; 2429 } 2430 2431 return _Animation.prototype.invalidate.call(this, soft); 2432 }; 2433 2434 _proto2.clear = function clear(includeLabels) { 2435 if (includeLabels === void 0) { 2436 includeLabels = true; 2437 } 2438 2439 var child = this._first, 2440 next; 2441 2442 while (child) { 2443 next = child._next; 2444 this.remove(child); 2445 child = next; 2446 } 2447 2448 this._dp && (this._time = this._tTime = this._pTime = 0); 2449 includeLabels && (this.labels = {}); 2450 return _uncache(this); 2451 }; 2452 2453 _proto2.totalDuration = function totalDuration(value) { 2454 var max = 0, 2455 self = this, 2456 child = self._last, 2457 prevStart = _bigNum, 2458 prev, 2459 start, 2460 parent; 2461 2462 if (arguments.length) { 2463 return self.timeScale((self._repeat < 0 ? self.duration() : self.totalDuration()) / (self.reversed() ? -value : value)); 2464 } 2465 2466 if (self._dirty) { 2467 parent = self.parent; 2468 2469 while (child) { 2470 prev = child._prev; 2471 child._dirty && child.totalDuration(); 2472 start = child._start; 2473 2474 if (start > prevStart && self._sort && child._ts && !self._lock) { 2475 self._lock = 1; 2476 _addToTimeline(self, child, start - child._delay, 1)._lock = 0; 2477 } else { 2478 prevStart = start; 2479 } 2480 2481 if (start < 0 && child._ts) { 2482 max -= start; 2483 2484 if (!parent && !self._dp || parent && parent.smoothChildTiming) { 2485 self._start += start / self._ts; 2486 self._time -= start; 2487 self._tTime -= start; 2488 } 2489 2490 self.shiftChildren(-start, false, -1e999); 2491 prevStart = 0; 2492 } 2493 2494 child._end > max && child._ts && (max = child._end); 2495 child = prev; 2496 } 2497 2498 _setDuration(self, self === _globalTimeline && self._time > max ? self._time : max, 1, 1); 2499 2500 self._dirty = 0; 2501 } 2502 2503 return self._tDur; 2504 }; 2505 2506 Timeline.updateRoot = function updateRoot(time) { 2507 if (_globalTimeline._ts) { 2508 _lazySafeRender(_globalTimeline, _parentToChildTotalTime(time, _globalTimeline)); 2509 2510 _lastRenderedFrame = _ticker.frame; 2511 } 2512 2513 if (_ticker.frame >= _nextGCFrame) { 2514 _nextGCFrame += _config.autoSleep || 120; 2515 var child = _globalTimeline._first; 2516 if (!child || !child._ts) if (_config.autoSleep && _ticker._listeners.length < 2) { 2517 while (child && !child._ts) { 2518 child = child._next; 2519 } 2520 2521 child || _ticker.sleep(); 2522 } 2523 } 2524 }; 2525 2526 return Timeline; 2527 }(Animation); 2528 2529 _setDefaults(Timeline.prototype, { 2530 _lock: 0, 2531 _hasPause: 0, 2532 _forcing: 0 2533 }); 2534 2535 var _addComplexStringPropTween = function _addComplexStringPropTween(target, prop, start, end, setter, stringFilter, funcParam) { 2536 var pt = new PropTween(this._pt, target, prop, 0, 1, _renderComplexString, null, setter), 2537 index = 0, 2538 matchIndex = 0, 2539 result, 2540 startNums, 2541 color, 2542 endNum, 2543 chunk, 2544 startNum, 2545 hasRandom, 2546 a; 2547 pt.b = start; 2548 pt.e = end; 2549 start += ""; 2550 end += ""; 2551 2552 if (hasRandom = ~end.indexOf("random(")) { 2553 end = _replaceRandom(end); 2554 } 2555 2556 if (stringFilter) { 2557 a = [start, end]; 2558 stringFilter(a, target, prop); 2559 start = a[0]; 2560 end = a[1]; 2561 } 2562 2563 startNums = start.match(_complexStringNumExp) || []; 2564 2565 while (result = _complexStringNumExp.exec(end)) { 2566 endNum = result[0]; 2567 chunk = end.substring(index, result.index); 2568 2569 if (color) { 2570 color = (color + 1) % 5; 2571 } else if (chunk.substr(-5) === "rgba(") { 2572 color = 1; 2573 } 2574 2575 if (endNum !== startNums[matchIndex++]) { 2576 startNum = parseFloat(startNums[matchIndex - 1]) || 0; 2577 pt._pt = { 2578 _next: pt._pt, 2579 p: chunk || matchIndex === 1 ? chunk : ",", 2580 s: startNum, 2581 c: endNum.charAt(1) === "=" ? _parseRelative(startNum, endNum) - startNum : parseFloat(endNum) - startNum, 2582 m: color && color < 4 ? Math.round : 0 2583 }; 2584 index = _complexStringNumExp.lastIndex; 2585 } 2586 } 2587 2588 pt.c = index < end.length ? end.substring(index, end.length) : ""; 2589 pt.fp = funcParam; 2590 2591 if (_relExp.test(end) || hasRandom) { 2592 pt.e = 0; 2593 } 2594 2595 this._pt = pt; 2596 return pt; 2597 }, 2598 _addPropTween = function _addPropTween(target, prop, start, end, index, targets, modifier, stringFilter, funcParam, optional) {
vendor: 9,749 bytes, lines 2599-2885
2599 _isFunction(end) && (end = end(index || 0, target, targets)); 2600 var currentValue = target[prop], 2601 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](), 2602 setter = !_isFunction(currentValue) ? _setterPlain : funcParam ? _setterFuncWithParam : _setterFunc, 2603 pt; 2604 2605 if (_isString(end)) { 2606 if (~end.indexOf("random(")) { 2607 end = _replaceRandom(end); 2608 } 2609 2610 if (end.charAt(1) === "=") { 2611 pt = _parseRelative(parsedStart, end) + (getUnit(parsedStart) || 0); 2612 2613 if (pt || pt === 0) { 2614 end = pt; 2615 } 2616 } 2617 } 2618 2619 if (!optional || parsedStart !== end || _forceAllPropTweens) { 2620 if (!isNaN(parsedStart * end) && end !== "") { 2621 pt = new PropTween(this._pt, target, prop, +parsedStart || 0, end - (parsedStart || 0), typeof currentValue === "boolean" ? _renderBoolean : _renderPlain, 0, setter); 2622 funcParam && (pt.fp = funcParam); 2623 modifier && pt.modifier(modifier, this, target); 2624 return this._pt = pt; 2625 } 2626 2627 !currentValue && !(prop in target) && _missingPlugin(prop, end); 2628 return _addComplexStringPropTween.call(this, target, prop, parsedStart, end, setter, stringFilter || _config.stringFilter, funcParam); 2629 } 2630 }, 2631 _processVars = function _processVars(vars, index, target, targets, tween) { 2632 _isFunction(vars) && (vars = _parseFuncOrString(vars, tween, index, target, targets)); 2633 2634 if (!_isObject(vars) || vars.style && vars.nodeType || _isArray(vars) || _isTypedArray(vars)) { 2635 return _isString(vars) ? _parseFuncOrString(vars, tween, index, target, targets) : vars; 2636 } 2637 2638 var copy = {}, 2639 p; 2640 2641 for (p in vars) { 2642 copy[p] = _parseFuncOrString(vars[p], tween, index, target, targets); 2643 } 2644 2645 return copy; 2646 }, 2647 _checkPlugin = function _checkPlugin(property, vars, tween, index, target, targets) { 2648 var plugin, pt, ptLookup, i; 2649 2650 if (_plugins[property] && (plugin = new _plugins[property]()).init(target, plugin.rawVars ? vars[property] : _processVars(vars[property], index, target, targets, tween), tween, index, targets) !== false) { 2651 tween._pt = pt = new PropTween(tween._pt, target, property, 0, 1, plugin.render, plugin, 0, plugin.priority); 2652 2653 if (tween !== _quickTween) { 2654 ptLookup = tween._ptLookup[tween._targets.indexOf(target)]; 2655 i = plugin._props.length; 2656 2657 while (i--) { 2658 ptLookup[plugin._props[i]] = pt; 2659 } 2660 } 2661 } 2662 2663 return plugin; 2664 }, 2665 _overwritingTween, 2666 _forceAllPropTweens, 2667 _initTween = function _initTween(tween, time, tTime) { 2668 var vars = tween.vars, 2669 ease = vars.ease, 2670 startAt = vars.startAt, 2671 immediateRender = vars.immediateRender, 2672 lazy = vars.lazy, 2673 onUpdate = vars.onUpdate, 2674 onUpdateParams = vars.onUpdateParams, 2675 callbackScope = vars.callbackScope, 2676 runBackwards = vars.runBackwards, 2677 yoyoEase = vars.yoyoEase, 2678 keyframes = vars.keyframes, 2679 autoRevert = vars.autoRevert, 2680 dur = tween._dur, 2681 prevStartAt = tween._startAt, 2682 targets = tween._targets, 2683 parent = tween.parent, 2684 fullTargets = parent && parent.data === "nested" ? parent.vars.targets : targets, 2685 autoOverwrite = tween._overwrite === "auto" && !_suppressOverwrites, 2686 tl = tween.timeline, 2687 cleanVars, 2688 i, 2689 p, 2690 pt, 2691 target, 2692 hasPriority, 2693 gsData, 2694 harness, 2695 plugin, 2696 ptLookup, 2697 index, 2698 harnessVars, 2699 overwritten; 2700 tl && (!keyframes || !ease) && (ease = "none"); 2701 tween._ease = _parseEase(ease, _defaults.ease); 2702 tween._yEase = yoyoEase ? _invertEase(_parseEase(yoyoEase === true ? ease : yoyoEase, _defaults.ease)) : 0; 2703 2704 if (yoyoEase && tween._yoyo && !tween._repeat) { 2705 yoyoEase = tween._yEase; 2706 tween._yEase = tween._ease; 2707 tween._ease = yoyoEase; 2708 } 2709 2710 tween._from = !tl && !!vars.runBackwards; 2711 2712 if (!tl || keyframes && !vars.stagger) { 2713 harness = targets[0] ? _getCache(targets[0]).harness : 0; 2714 harnessVars = harness && vars[harness.prop]; 2715 cleanVars = _copyExcluding(vars, _reservedProps); 2716 2717 if (prevStartAt) { 2718 prevStartAt._zTime < 0 && prevStartAt.progress(1); 2719 time < 0 && runBackwards && immediateRender && !autoRevert ? prevStartAt.render(-1, true) : prevStartAt.revert(runBackwards && dur ? _revertConfigNoKill : _startAtRevertConfig); 2720 prevStartAt._lazy = 0; 2721 } 2722 2723 if (startAt) { 2724 _removeFromParent(tween._startAt = Tween.set(targets, _setDefaults({ 2725 data: "isStart", 2726 overwrite: false, 2727 parent: parent, 2728 immediateRender: true, 2729 lazy: _isNotFalse(lazy), 2730 startAt: null, 2731 delay: 0, 2732 onUpdate: onUpdate, 2733 onUpdateParams: onUpdateParams, 2734 callbackScope: callbackScope, 2735 stagger: 0 2736 }, startAt))); 2737 2738 tween._startAt._dp = 0; 2739 time < 0 && (_reverting || !immediateRender && !autoRevert) && tween._startAt.revert(_revertConfigNoKill); 2740 2741 if (immediateRender) { 2742 if (dur && time <= 0 && tTime <= 0) { 2743 time && (tween._zTime = time); 2744 return; 2745 } 2746 } 2747 } else if (runBackwards && dur) { 2748 if (!prevStartAt) { 2749 time && (immediateRender = false); 2750 p = _setDefaults({ 2751 overwrite: false, 2752 data: "isFromStart", 2753 lazy: immediateRender && _isNotFalse(lazy), 2754 immediateRender: immediateRender, 2755 stagger: 0, 2756 parent: parent 2757 }, cleanVars); 2758 harnessVars && (p[harness.prop] = harnessVars); 2759 2760 _removeFromParent(tween._startAt = Tween.set(targets, p)); 2761 2762 tween._startAt._dp = 0; 2763 time < 0 && (_reverting ? tween._startAt.revert(_revertConfigNoKill) : tween._startAt.render(-1, true)); 2764 tween._zTime = time; 2765 2766 if (!immediateRender) { 2767 _initTween(tween._startAt, _tinyNum, _tinyNum); 2768 } else if (!time) { 2769 return; 2770 } 2771 } 2772 } 2773 2774 tween._pt = tween._ptCache = 0; 2775 lazy = dur && _isNotFalse(lazy) || lazy && !dur; 2776 2777 for (i = 0; i < targets.length; i++) { 2778 target = targets[i]; 2779 gsData = target._gsap || _harness(targets)[i]._gsap; 2780 tween._ptLookup[i] = ptLookup = {}; 2781 _lazyLookup[gsData.id] && _lazyTweens.length && _lazyRender(); 2782 index = fullTargets === targets ? i : fullTargets.indexOf(target); 2783 2784 if (harness && (plugin = new harness()).init(target, harnessVars || cleanVars, tween, index, fullTargets) !== false) { 2785 tween._pt = pt = new PropTween(tween._pt, target, plugin.name, 0, 1, plugin.render, plugin, 0, plugin.priority); 2786 2787 plugin._props.forEach(function (name) { 2788 ptLookup[name] = pt; 2789 }); 2790 2791 plugin.priority && (hasPriority = 1); 2792 } 2793 2794 if (!harness || harnessVars) { 2795 for (p in cleanVars) { 2796 if (_plugins[p] && (plugin = _checkPlugin(p, cleanVars, tween, index, target, fullTargets))) { 2797 plugin.priority && (hasPriority = 1); 2798 } else { 2799 ptLookup[p] = pt = _addPropTween.call(tween, target, p, "get", cleanVars[p], index, fullTargets, 0, vars.stringFilter); 2800 } 2801 } 2802 } 2803 2804 tween._op && tween._op[i] && tween.kill(target, tween._op[i]); 2805 2806 if (autoOverwrite && tween._pt) { 2807 _overwritingTween = tween; 2808 2809 _globalTimeline.killTweensOf(target, ptLookup, tween.globalTime(time)); 2810 2811 overwritten = !tween.parent; 2812 _overwritingTween = 0; 2813 } 2814 2815 tween._pt && lazy && (_lazyLookup[gsData.id] = 1); 2816 } 2817 2818 hasPriority && _sortPropTweensByPriority(tween); 2819 tween._onInit && tween._onInit(tween); 2820 } 2821 2822 tween._onUpdate = onUpdate; 2823 tween._initted = (!tween._op || tween._pt) && !overwritten; 2824 keyframes && time <= 0 && tl.render(_bigNum, true, true); 2825 }, 2826 _updatePropTweens = function _updatePropTweens(tween, property, value, start, startIsRelative, ratio, time) { 2827 var ptCache = (tween._pt && tween._ptCache || (tween._ptCache = {}))[property], 2828 pt, 2829 rootPT, 2830 lookup, 2831 i; 2832 2833 if (!ptCache) { 2834 ptCache = tween._ptCache[property] = []; 2835 lookup = tween._ptLookup; 2836 i = tween._targets.length; 2837 2838 while (i--) { 2839 pt = lookup[i][property]; 2840 2841 if (pt && pt.d && pt.d._pt) { 2842 pt = pt.d._pt; 2843 2844 while (pt && pt.p !== property && pt.fp !== property) { 2845 pt = pt._next; 2846 } 2847 } 2848 2849 if (!pt) { 2850 _forceAllPropTweens = 1; 2851 tween.vars[property] = "+=0"; 2852 2853 _initTween(tween, time); 2854 2855 _forceAllPropTweens = 0; 2856 return 1; 2857 } 2858 2859 ptCache.push(pt); 2860 } 2861 } 2862 2863 i = ptCache.length; 2864 2865 while (i--) { 2866 rootPT = ptCache[i]; 2867 pt = rootPT._pt || rootPT; 2868 pt.s = (start || start === 0) && !startIsRelative ? start : pt.s + (start || 0) + ratio * pt.c; 2869 pt.c = value - pt.s; 2870 rootPT.e && (rootPT.e = _round(value) + getUnit(rootPT.e)); 2871 rootPT.b && (rootPT.b = pt.s + getUnit(rootPT.b)); 2872 } 2873 }, 2874 _addAliasesToVars = function _addAliasesToVars(targets, vars) { 2875 var harness = targets[0] ? _getCache(targets[0]).harness : 0, 2876 propertyAliases = harness && harness.aliases, 2877 copy, 2878 p, 2879 i, 2880 aliases; 2881 2882 if (!propertyAliases) { 2883 return vars; 2884 } 2885
vendor: 4,989 bytes, lines 2886-3028
2886 copy = _merge({}, vars); 2887 2888 for (p in propertyAliases) { 2889 if (p in copy) { 2890 aliases = propertyAliases[p].split(","); 2891 i = aliases.length; 2892 2893 while (i--) { 2894 copy[aliases[i]] = copy[p]; 2895 } 2896 } 2897 } 2898 2899 return copy; 2900 }, 2901 _parseKeyframe = function _parseKeyframe(prop, obj, allProps, easeEach) { 2902 var ease = obj.ease || easeEach || "power1.inOut", 2903 p, 2904 a; 2905 2906 if (_isArray(obj)) { 2907 a = allProps[prop] || (allProps[prop] = []); 2908 obj.forEach(function (value, i) { 2909 return a.push({ 2910 t: i / (obj.length - 1) * 100, 2911 v: value, 2912 e: ease 2913 }); 2914 }); 2915 } else { 2916 for (p in obj) { 2917 a = allProps[p] || (allProps[p] = []); 2918 p === "ease" || a.push({ 2919 t: parseFloat(prop), 2920 v: obj[p], 2921 e: ease 2922 }); 2923 } 2924 } 2925 }, 2926 _parseFuncOrString = function _parseFuncOrString(value, tween, i, target, targets) { 2927 return _isFunction(value) ? value.call(tween, i, target, targets) : _isString(value) && ~value.indexOf("random(") ? _replaceRandom(value) : value; 2928 }, 2929 _staggerTweenProps = _callbackNames + "repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert", 2930 _staggerPropsToSkip = {}; 2931 2932 _forEachName(_staggerTweenProps + ",id,stagger,delay,duration,paused,scrollTrigger", function (name) { 2933 return _staggerPropsToSkip[name] = 1; 2934 }); 2935 2936 var Tween = function (_Animation2) { 2937 _inheritsLoose(Tween, _Animation2); 2938 2939 function Tween(targets, vars, position, skipInherit) { 2940 var _this3; 2941 2942 if (typeof vars === "number") { 2943 position.duration = vars; 2944 vars = position; 2945 position = null; 2946 } 2947 2948 _this3 = _Animation2.call(this, skipInherit ? vars : _inheritDefaults(vars)) || this; 2949 var _this3$vars = _this3.vars, 2950 duration = _this3$vars.duration, 2951 delay = _this3$vars.delay, 2952 immediateRender = _this3$vars.immediateRender, 2953 stagger = _this3$vars.stagger, 2954 overwrite = _this3$vars.overwrite, 2955 keyframes = _this3$vars.keyframes, 2956 defaults = _this3$vars.defaults, 2957 scrollTrigger = _this3$vars.scrollTrigger, 2958 yoyoEase = _this3$vars.yoyoEase, 2959 parent = vars.parent || _globalTimeline, 2960 parsedTargets = (_isArray(targets) || _isTypedArray(targets) ? _isNumber(targets[0]) : "length" in vars) ? [targets] : toArray(targets), 2961 tl, 2962 i, 2963 copy, 2964 l, 2965 p, 2966 curTarget, 2967 staggerFunc, 2968 staggerVarsToMerge; 2969 _this3._targets = parsedTargets.length ? _harness(parsedTargets) : _warn("GSAP target " + targets + " not found. https://greensock.com", !_config.nullTargetWarn) || []; 2970 _this3._ptLookup = []; 2971 _this3._overwrite = overwrite; 2972 2973 if (keyframes || stagger || _isFuncOrString(duration) || _isFuncOrString(delay)) { 2974 vars = _this3.vars; 2975 tl = _this3.timeline = new Timeline({ 2976 data: "nested", 2977 defaults: defaults || {}, 2978 targets: parent && parent.data === "nested" ? parent.vars.targets : parsedTargets 2979 }); 2980 tl.kill(); 2981 tl.parent = tl._dp = _assertThisInitialized(_this3); 2982 tl._start = 0; 2983 2984 if (stagger || _isFuncOrString(duration) || _isFuncOrString(delay)) { 2985 l = parsedTargets.length; 2986 staggerFunc = stagger && distribute(stagger); 2987 2988 if (_isObject(stagger)) { 2989 for (p in stagger) { 2990 if (~_staggerTweenProps.indexOf(p)) { 2991 staggerVarsToMerge || (staggerVarsToMerge = {}); 2992 staggerVarsToMerge[p] = stagger[p]; 2993 } 2994 } 2995 } 2996 2997 for (i = 0; i < l; i++) { 2998 copy = _copyExcluding(vars, _staggerPropsToSkip); 2999 copy.stagger = 0; 3000 yoyoEase && (copy.yoyoEase = yoyoEase); 3001 staggerVarsToMerge && _merge(copy, staggerVarsToMerge); 3002 curTarget = parsedTargets[i]; 3003 copy.duration = +_parseFuncOrString(duration, _assertThisInitialized(_this3), i, curTarget, parsedTargets); 3004 copy.delay = (+_parseFuncOrString(delay, _assertThisInitialized(_this3), i, curTarget, parsedTargets) || 0) - _this3._delay; 3005 3006 if (!stagger && l === 1 && copy.delay) { 3007 _this3._delay = delay = copy.delay; 3008 _this3._start += delay; 3009 copy.delay = 0; 3010 } 3011 3012 tl.to(curTarget, copy, staggerFunc ? staggerFunc(i, curTarget, parsedTargets) : 0); 3013 tl._ease = _easeMap.none; 3014 } 3015 3016 tl.duration() ? duration = delay = 0 : _this3.timeline = 0; 3017 } else if (keyframes) { 3018 _inheritDefaults(_setDefaults(tl.vars.defaults, { 3019 ease: "none" 3020 })); 3021 3022 tl._ease = _parseEase(keyframes.ease || vars.ease || "none"); 3023 var time = 0, 3024 a, 3025 kf, 3026 v; 3027 3028 if (_isArray(keyframes)) {
vendor: 6,328 bytes, lines 3029-3235
3029 keyframes.forEach(function (frame) { 3030 return tl.to(parsedTargets, frame, ">"); 3031 }); 3032 tl.duration(); 3033 } else { 3034 copy = {}; 3035 3036 for (p in keyframes) { 3037 p === "ease" || p === "easeEach" || _parseKeyframe(p, keyframes[p], copy, keyframes.easeEach); 3038 } 3039 3040 for (p in copy) { 3041 a = copy[p].sort(function (a, b) { 3042 return a.t - b.t; 3043 }); 3044 time = 0; 3045 3046 for (i = 0; i < a.length; i++) { 3047 kf = a[i]; 3048 v = { 3049 ease: kf.e, 3050 duration: (kf.t - (i ? a[i - 1].t : 0)) / 100 * duration 3051 }; 3052 v[p] = kf.v; 3053 tl.to(parsedTargets, v, time); 3054 time += v.duration; 3055 } 3056 } 3057 3058 tl.duration() < duration && tl.to({}, { 3059 duration: duration - tl.duration() 3060 }); 3061 } 3062 } 3063 3064 duration || _this3.duration(duration = tl.duration()); 3065 } else { 3066 _this3.timeline = 0; 3067 } 3068 3069 if (overwrite === true && !_suppressOverwrites) { 3070 _overwritingTween = _assertThisInitialized(_this3); 3071 3072 _globalTimeline.killTweensOf(parsedTargets); 3073 3074 _overwritingTween = 0; 3075 } 3076 3077 _addToTimeline(parent, _assertThisInitialized(_this3), position); 3078 3079 vars.reversed && _this3.reverse(); 3080 vars.paused && _this3.paused(true); 3081 3082 if (immediateRender || !duration && !keyframes && _this3._start === _roundPrecise(parent._time) && _isNotFalse(immediateRender) && _hasNoPausedAncestors(_assertThisInitialized(_this3)) && parent.data !== "nested") { 3083 _this3._tTime = -_tinyNum; 3084 3085 _this3.render(Math.max(0, -delay) || 0); 3086 } 3087 3088 scrollTrigger && _scrollTrigger(_assertThisInitialized(_this3), scrollTrigger); 3089 return _this3; 3090 } 3091 3092 var _proto3 = Tween.prototype; 3093 3094 _proto3.render = function render(totalTime, suppressEvents, force) { 3095 var prevTime = this._time, 3096 tDur = this._tDur, 3097 dur = this._dur, 3098 isNegative = totalTime < 0, 3099 tTime = totalTime > tDur - _tinyNum && !isNegative ? tDur : totalTime < _tinyNum ? 0 : totalTime, 3100 time, 3101 pt, 3102 iteration, 3103 cycleDuration, 3104 prevIteration, 3105 isYoyo, 3106 ratio, 3107 timeline, 3108 yoyoEase; 3109 3110 if (!dur) { 3111 _renderZeroDurationTween(this, totalTime, suppressEvents, force); 3112 } else if (tTime !== this._tTime || !totalTime || force || !this._initted && this._tTime || this._startAt && this._zTime < 0 !== isNegative) { 3113 time = tTime; 3114 timeline = this.timeline; 3115 3116 if (this._repeat) { 3117 cycleDuration = dur + this._rDelay; 3118 3119 if (this._repeat < -1 && isNegative) { 3120 return this.totalTime(cycleDuration * 100 + totalTime, suppressEvents, force); 3121 } 3122 3123 time = _roundPrecise(tTime % cycleDuration); 3124 3125 if (tTime === tDur) { 3126 iteration = this._repeat; 3127 time = dur; 3128 } else { 3129 iteration = ~~(tTime / cycleDuration); 3130 3131 if (iteration && iteration === tTime / cycleDuration) { 3132 time = dur; 3133 iteration--; 3134 } 3135 3136 time > dur && (time = dur); 3137 } 3138 3139 isYoyo = this._yoyo && iteration & 1; 3140 3141 if (isYoyo) { 3142 yoyoEase = this._yEase; 3143 time = dur - time; 3144 } 3145 3146 prevIteration = _animationCycle(this._tTime, cycleDuration); 3147 3148 if (time === prevTime && !force && this._initted) { 3149 this._tTime = tTime; 3150 return this; 3151 } 3152 3153 if (iteration !== prevIteration) { 3154 timeline && this._yEase && _propagateYoyoEase(timeline, isYoyo); 3155 3156 if (this.vars.repeatRefresh && !isYoyo && !this._lock) { 3157 this._lock = force = 1; 3158 this.render(_roundPrecise(cycleDuration * iteration), true).invalidate()._lock = 0; 3159 } 3160 } 3161 } 3162 3163 if (!this._initted) { 3164 if (_attemptInitTween(this, isNegative ? totalTime : time, force, suppressEvents, tTime)) { 3165 this._tTime = 0; 3166 return this; 3167 } 3168 3169 if (prevTime !== this._time) { 3170 return this; 3171 } 3172 3173 if (dur !== this._dur) { 3174 return this.render(totalTime, suppressEvents, force); 3175 } 3176 } 3177 3178 this._tTime = tTime; 3179 this._time = time; 3180 3181 if (!this._act && this._ts) { 3182 this._act = 1; 3183 this._lazy = 0; 3184 } 3185 3186 this.ratio = ratio = (yoyoEase || this._ease)(time / dur); 3187 3188 if (this._from) { 3189 this.ratio = ratio = 1 - ratio; 3190 } 3191 3192 if (time && !prevTime && !suppressEvents) { 3193 _callback(this, "onStart"); 3194 3195 if (this._tTime !== tTime) { 3196 return this; 3197 } 3198 } 3199 3200 pt = this._pt; 3201 3202 while (pt) { 3203 pt.r(ratio, pt.d); 3204 pt = pt._next; 3205 } 3206 3207 timeline && timeline.render(totalTime < 0 ? totalTime : !time && isYoyo ? -_tinyNum : timeline._dur * timeline._ease(time / this._dur), suppressEvents, force) || this._startAt && (this._zTime = totalTime); 3208 3209 if (this._onUpdate && !suppressEvents) { 3210 isNegative && _rewindStartAt(this, totalTime, suppressEvents, force); 3211 3212 _callback(this, "onUpdate"); 3213 } 3214 3215 this._repeat && iteration !== prevIteration && this.vars.onRepeat && !suppressEvents && this.parent && _callback(this, "onRepeat"); 3216 3217 if ((tTime === this._tDur || !tTime) && this._tTime === tTime) { 3218 isNegative && !this._onUpdate && _rewindStartAt(this, totalTime, true, true); 3219 (totalTime || !dur) && (tTime === this._tDur && this._ts > 0 || !tTime && this._ts < 0) && _removeFromParent(this, 1); 3220 3221 if (!suppressEvents && !(isNegative && !prevTime) && (tTime || prevTime || isYoyo)) { 3222 _callback(this, tTime === tDur ? "onComplete" : "onReverseComplete", true); 3223 3224 this._prom && !(tTime < tDur && this.timeScale() > 0) && this._prom(); 3225 } 3226 } 3227 } 3228 3229 return this; 3230 }; 3231 3232 _proto3.targets = function targets() { 3233 return this._targets; 3234 }; 3235
vendor: 1,277 bytes, lines 3236-3269
3236 _proto3.invalidate = function invalidate(soft) { 3237 (!soft || !this.vars.runBackwards) && (this._startAt = 0); 3238 this._pt = this._op = this._onUpdate = this._lazy = this.ratio = 0; 3239 this._ptLookup = []; 3240 this.timeline && this.timeline.invalidate(soft); 3241 return _Animation2.prototype.invalidate.call(this, soft); 3242 }; 3243 3244 _proto3.resetTo = function resetTo(property, value, start, startIsRelative) { 3245 _tickerActive || _ticker.wake(); 3246 this._ts || this.play(); 3247 var time = Math.min(this._dur, (this._dp._time - this._start) * this._ts), 3248 ratio; 3249 this._initted || _initTween(this, time); 3250 ratio = this._ease(time / this._dur); 3251 3252 if (_updatePropTweens(this, property, value, start, startIsRelative, ratio, time)) { 3253 return this.resetTo(property, value, start, startIsRelative); 3254 } 3255 3256 _alignPlayhead(this, 0); 3257 3258 this.parent || _addLinkedListItem(this._dp, this, "_first", "_last", this._dp._sort ? "_start" : 0); 3259 return this.render(0); 3260 }; 3261 3262 _proto3.kill = function kill(targets, vars) { 3263 if (vars === void 0) { 3264 vars = "all"; 3265 } 3266 3267 if (!targets && (!vars || vars === "all")) { 3268 this._lazy = this._pt = 0; 3269 return this.parent ? _interrupt(this) :
vendor: 7,709 bytes, lines 3269-3549
3269 this; 3270 } 3271 3272 if (this.timeline) { 3273 var tDur = this.timeline.totalDuration(); 3274 this.timeline.killTweensOf(targets, vars, _overwritingTween && _overwritingTween.vars.overwrite !== true)._first || _interrupt(this); 3275 this.parent && tDur !== this.timeline.totalDuration() && _setDuration(this, this._dur * this.timeline._tDur / tDur, 0, 1); 3276 return this; 3277 } 3278 3279 var parsedTargets = this._targets, 3280 killingTargets = targets ? toArray(targets) : parsedTargets, 3281 propTweenLookup = this._ptLookup, 3282 firstPT = this._pt, 3283 overwrittenProps, 3284 curLookup, 3285 curOverwriteProps, 3286 props, 3287 p, 3288 pt, 3289 i; 3290 3291 if ((!vars || vars === "all") && _arraysMatch(parsedTargets, killingTargets)) { 3292 vars === "all" && (this._pt = 0); 3293 return _interrupt(this); 3294 } 3295 3296 overwrittenProps = this._op = this._op || []; 3297 3298 if (vars !== "all") { 3299 if (_isString(vars)) { 3300 p = {}; 3301 3302 _forEachName(vars, function (name) { 3303 return p[name] = 1; 3304 }); 3305 3306 vars = p; 3307 } 3308 3309 vars = _addAliasesToVars(parsedTargets, vars); 3310 } 3311 3312 i = parsedTargets.length; 3313 3314 while (i--) { 3315 if (~killingTargets.indexOf(parsedTargets[i])) { 3316 curLookup = propTweenLookup[i]; 3317 3318 if (vars === "all") { 3319 overwrittenProps[i] = vars; 3320 props = curLookup; 3321 curOverwriteProps = {}; 3322 } else { 3323 curOverwriteProps = overwrittenProps[i] = overwrittenProps[i] || {}; 3324 props = vars; 3325 } 3326 3327 for (p in props) { 3328 pt = curLookup && curLookup[p]; 3329 3330 if (pt) { 3331 if (!("kill" in pt.d) || pt.d.kill(p) === true) { 3332 _removeLinkedListItem(this, pt, "_pt"); 3333 } 3334 3335 delete curLookup[p]; 3336 } 3337 3338 if (curOverwriteProps !== "all") { 3339 curOverwriteProps[p] = 1; 3340 } 3341 } 3342 } 3343 } 3344 3345 this._initted && !this._pt && firstPT && _interrupt(this); 3346 return this; 3347 }; 3348 3349 Tween.to = function to(targets, vars) { 3350 return new Tween(targets, vars, arguments[2]); 3351 }; 3352 3353 Tween.from = function from(targets, vars) { 3354 return _createTweenType(1, arguments); 3355 }; 3356 3357 Tween.delayedCall = function delayedCall(delay, callback, params, scope) { 3358 return new Tween(callback, 0, { 3359 immediateRender: false, 3360 lazy: false, 3361 overwrite: false, 3362 delay: delay, 3363 onComplete: callback, 3364 onReverseComplete: callback, 3365 onCompleteParams: params, 3366 onReverseCompleteParams: params, 3367 callbackScope: scope 3368 }); 3369 }; 3370 3371 Tween.fromTo = function fromTo(targets, fromVars, toVars) { 3372 return _createTweenType(2, arguments); 3373 }; 3374 3375 Tween.set = function set(targets, vars) { 3376 vars.duration = 0; 3377 vars.repeatDelay || (vars.repeat = 0); 3378 return new Tween(targets, vars); 3379 }; 3380 3381 Tween.killTweensOf = function killTweensOf(targets, props, onlyActive) { 3382 return _globalTimeline.killTweensOf(targets, props, onlyActive); 3383 }; 3384 3385 return Tween; 3386 }(Animation); 3387 3388 _setDefaults(Tween.prototype, { 3389 _targets: [], 3390 _lazy: 0, 3391 _startAt: 0, 3392 _op: 0, 3393 _onInit: 0 3394 }); 3395 3396 _forEachName("staggerTo,staggerFrom,staggerFromTo", function (name) { 3397 Tween[name] = function () { 3398 var tl = new Timeline(), 3399 params = _slice.call(arguments, 0); 3400 3401 params.splice(name === "staggerFromTo" ? 5 : 4, 0, 0); 3402 return tl[name].apply(tl, params); 3403 }; 3404 }); 3405 3406 var _setterPlain = function _setterPlain(target, property, value) { 3407 return target[property] = value; 3408 }, 3409 _setterFunc = function _setterFunc(target, property, value) { 3410 return target[property](value); 3411 }, 3412 _setterFuncWithParam = function _setterFuncWithParam(target, property, value, data) { 3413 return target[property](data.fp, value); 3414 }, 3415 _setterAttribute = function _setterAttribute(target, property, value) { 3416 return target.setAttribute(property, value); 3417 }, 3418 _getSetter = function _getSetter(target, property) { 3419 return _isFunction(target[property]) ? _setterFunc : _isUndefined(target[property]) && target.setAttribute ? _setterAttribute : _setterPlain; 3420 }, 3421 _renderPlain = function _renderPlain(ratio, data) { 3422 return data.set(data.t, data.p, Math.round((data.s + data.c * ratio) * 1000000) / 1000000, data); 3423 }, 3424 _renderBoolean = function _renderBoolean(ratio, data) { 3425 return data.set(data.t, data.p, !!(data.s + data.c * ratio), data); 3426 }, 3427 _renderComplexString = function _renderComplexString(ratio, data) { 3428 var pt = data._pt, 3429 s = ""; 3430 3431 if (!ratio && data.b) { 3432 s = data.b; 3433 } else if (ratio === 1 && data.e) { 3434 s = data.e; 3435 } else { 3436 while (pt) { 3437 s = pt.p + (pt.m ? pt.m(pt.s + pt.c * ratio) : Math.round((pt.s + pt.c * ratio) * 10000) / 10000) + s; 3438 pt = pt._next; 3439 } 3440 3441 s += data.c; 3442 } 3443 3444 data.set(data.t, data.p, s, data); 3445 }, 3446 _renderPropTweens = function _renderPropTweens(ratio, data) { 3447 var pt = data._pt; 3448 3449 while (pt) { 3450 pt.r(ratio, pt.d); 3451 pt = pt._next; 3452 } 3453 }, 3454 _addPluginModifier = function _addPluginModifier(modifier, tween, target, property) { 3455 var pt = this._pt, 3456 next; 3457 3458 while (pt) { 3459 next = pt._next; 3460 pt.p === property && pt.modifier(modifier, tween, target); 3461 pt = next; 3462 } 3463 }, 3464 _killPropTweensOf = function _killPropTweensOf(property) { 3465 var pt = this._pt, 3466 hasNonDependentRemaining, 3467 next; 3468 3469 while (pt) { 3470 next = pt._next; 3471 3472 if (pt.p === property && !pt.op || pt.op === property) { 3473 _removeLinkedListItem(this, pt, "_pt"); 3474 } else if (!pt.dep) { 3475 hasNonDependentRemaining = 1; 3476 } 3477 3478 pt = next; 3479 } 3480 3481 return !hasNonDependentRemaining; 3482 }, 3483 _setterWithModifier = function _setterWithModifier(target, property, value, data) { 3484 data.mSet(target, property, data.m.call(data.tween, value, data.mt), data); 3485 }, 3486 _sortPropTweensByPriority = function _sortPropTweensByPriority(parent) { 3487 var pt = parent._pt, 3488 next, 3489 pt2, 3490 first, 3491 last; 3492 3493 while (pt) { 3494 next = pt._next; 3495 pt2 = first; 3496 3497 while (pt2 && pt2.pr > pt.pr) { 3498 pt2 = pt2._next; 3499 } 3500 3501 if (pt._prev = pt2 ? pt2._prev : last) { 3502 pt._prev._next = pt; 3503 } else { 3504 first = pt; 3505 } 3506 3507 if (pt._next = pt2) { 3508 pt2._prev = pt; 3509 } else { 3510 last = pt; 3511 } 3512 3513 pt = next; 3514 } 3515 3516 parent._pt = first; 3517 }; 3518 3519 var PropTween = function () { 3520 function PropTween(next, target, prop, start, change, renderer, data, setter, priority) { 3521 this.t = target; 3522 this.s = start; 3523 this.c = change; 3524 this.p = prop; 3525 this.r = renderer || _renderPlain; 3526 this.d = data || this; 3527 this.set = setter || _setterPlain; 3528 this.pr = priority || 0; 3529 this._next = next; 3530 3531 if (next) { 3532 next._prev = this; 3533 } 3534 } 3535 3536 var _proto4 = PropTween.prototype; 3537 3538 _proto4.modifier = function modifier(func, tween, target) { 3539 this.mSet = this.mSet || this.set; 3540 this.set = _setterWithModifier; 3541 this.m = func; 3542 this.mt = target; 3543 this.tween = tween; 3544 }; 3545 3546 return PropTween; 3547 }(); 3548 3549 _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
vendor: 3,674 bytes, lines 3549-3692
3549", function (name) { 3550 return _reservedProps[name] = 1; 3551 }); 3552 3553 _globals.TweenMax = _globals.TweenLite = Tween; 3554 _globals.TimelineLite = _globals.TimelineMax = Timeline; 3555 _globalTimeline = new Timeline({ 3556 sortChildren: false, 3557 defaults: _defaults, 3558 autoRemoveChildren: true, 3559 id: "root", 3560 smoothChildTiming: true 3561 }); 3562 _config.stringFilter = _colorStringFilter; 3563 3564 var _media = [], 3565 _listeners = {}, 3566 _emptyArray = [], 3567 _lastMediaTime = 0, 3568 _dispatch = function _dispatch(type) { 3569 return (_listeners[type] || _emptyArray).map(function (f) { 3570 return f(); 3571 }); 3572 }, 3573 _onMediaChange = function _onMediaChange() { 3574 var time = Date.now(), 3575 matches = []; 3576 3577 if (time - _lastMediaTime > 2) { 3578 _dispatch("matchMediaInit"); 3579 3580 _media.forEach(function (c) { 3581 var queries = c.queries, 3582 conditions = c.conditions, 3583 match, 3584 p, 3585 anyMatch, 3586 toggled; 3587 3588 for (p in queries) { 3589 match = _win.matchMedia(queries[p]).matches; 3590 match && (anyMatch = 1); 3591 3592 if (match !== conditions[p]) { 3593 conditions[p] = match; 3594 toggled = 1; 3595 } 3596 } 3597 3598 if (toggled) { 3599 c.revert(); 3600 anyMatch && matches.push(c); 3601 } 3602 }); 3603 3604 _dispatch("matchMediaRevert"); 3605 3606 matches.forEach(function (c) { 3607 return c.onMatch(c); 3608 }); 3609 _lastMediaTime = time; 3610 3611 _dispatch("matchMedia"); 3612 } 3613 }; 3614 3615 var Context = function () { 3616 function Context(func, scope) { 3617 this.selector = scope && selector(scope); 3618 this.data = []; 3619 this._r = []; 3620 this.isReverted = false; 3621 func && this.add(func); 3622 } 3623 3624 var _proto5 = Context.prototype; 3625 3626 _proto5.add = function add(name, func, scope) { 3627 if (_isFunction(name)) { 3628 scope = func; 3629 func = name; 3630 name = _isFunction; 3631 } 3632 3633 var self = this, 3634 f = function f() { 3635 var prev = _context, 3636 prevSelector = self.selector, 3637 result; 3638 prev && prev !== self && prev.data.push(self); 3639 scope && (self.selector = selector(scope)); 3640 _context = self; 3641 result = func.apply(self, arguments); 3642 _isFunction(result) && self._r.push(result); 3643 _context = prev; 3644 self.selector = prevSelector; 3645 self.isReverted = false; 3646 return result; 3647 }; 3648 3649 self.last = f; 3650 return name === _isFunction ? f(self) : name ? self[name] = f : f; 3651 }; 3652 3653 _proto5.ignore = function ignore(func) { 3654 var prev = _context; 3655 _context = null; 3656 func(this); 3657 _context = prev; 3658 }; 3659 3660 _proto5.getTweens = function getTweens() { 3661 var a = []; 3662 this.data.forEach(function (e) { 3663 return e instanceof Context ? a.push.apply(a, e.getTweens()) : e instanceof Tween && !(e.parent && e.parent.data === "nested") && a.push(e); 3664 }); 3665 return a; 3666 }; 3667 3668 _proto5.clear = function clear() { 3669 this._r.length = this.data.length = 0; 3670 }; 3671 3672 _proto5.kill = function kill(revert, matchMedia) { 3673 var _this4 = this; 3674 3675 if (revert) { 3676 var tweens = this.getTweens(); 3677 this.data.forEach(function (t) { 3678 if (t.data === "isFlip") { 3679 t.revert(); 3680 t.getChildren(true, true, false).forEach(function (tween) { 3681 return tweens.splice(tweens.indexOf(tween), 1); 3682 }); 3683 } 3684 }); 3685 tweens.map(function (t) { 3686 return { 3687 g: t.globalTime(0), 3688 t: t 3689 }; 3690 }).sort(function (a, b) { 3691 return b.g - a.g || -1; 3692 }
3692).forEach(function (o) { 3693 return o.t.revert(revert); 3694 }); 3695 this.data.forEach(function (e) { 3696 return !(e instanceof Animation) && e.revert && e.revert(revert); 3697 }); 3698 3699 this._r.forEach(function (f) { 3700 return f(revert, _this4); 3701 }); 3702 3703 this.isReverted = true; 3704 } else { 3705 this.data.forEach(function (e) { 3706 return e.kill && e.kill(); 3707 }); 3708 } 3709 3710 this.clear(); 3711 3712 if (matchMedia) { 3713 var i = _media.indexOf(this); 3714 3715 !!~i && _media.splice(i, 1); 3716 } 3717 }; 3718 3719 _proto5.revert = function revert(config) { 3720 this.kill(config || {}); 3721 }; 3722 3723 return Context; 3724 }(); 3725 3726 var MatchMedia = function () { 3727 function MatchMedia(scope) { 3728 this.contexts = []; 3729 this.scope = scope; 3730 } 3731 3732 var _proto6 = MatchMedia.prototype; 3733 3734 _proto6.add = function add(conditions, func, scope) { 3735 _isObject(conditions) || (conditions = { 3736 matches: conditions 3737 }); 3738 var context = new Context(0, scope || this.scope), 3739 cond = context.conditions = {}, 3740 mq, 3741 p, 3742 active; 3743 this.contexts.push(context); 3744 func = context.add("onMatch", func); 3745 context.queries = conditions; 3746 3747 for (p in conditions) { 3748 if (p === "all") { 3749 active = 1; 3750 } else { 3751 mq = _win.matchMedia(conditions[p]); 3752 3753 if (mq) { 3754 _media.indexOf(context) < 0 && _media.push(context); 3755 (cond[p] = mq.matches) && (active = 1); 3756 mq.addListener ? mq.addListener(_onMediaChange) : mq.addEventListener("change", _onMediaChange); 3757 } 3758 } 3759 } 3760 3761 active && func(context); 3762 return this; 3763 }; 3764 3765 _proto6.revert = function revert(config) { 3766 this.kill(config || {}); 3767 }; 3768 3769 _proto6.kill = function kill(revert) {
vendor: 2,486 bytes, lines 3770-3842
3770 this.contexts.forEach(function (c) { 3771 return c.kill(revert, true); 3772 }); 3773 }; 3774 3775 return MatchMedia; 3776 }(); 3777 3778 var _gsap = { 3779 registerPlugin: function registerPlugin() { 3780 for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { 3781 args[_key2] = arguments[_key2]; 3782 } 3783 3784 args.forEach(function (config) { 3785 return _createPlugin(config); 3786 }); 3787 }, 3788 timeline: function timeline(vars) { 3789 return new Timeline(vars); 3790 }, 3791 getTweensOf: function getTweensOf(targets, onlyActive) { 3792 return _globalTimeline.getTweensOf(targets, onlyActive); 3793 }, 3794 getProperty: function getProperty(target, property, unit, uncache) { 3795 _isString(target) && (target = toArray(target)[0]); 3796 3797 var getter = _getCache(target || {}).get, 3798 format = unit ? _passThrough : _numericIfPossible; 3799 3800 unit === "native" && (unit = ""); 3801 return !target ? target : !property ? function (property, unit, uncache) { 3802 return format((_plugins[property] && _plugins[property].get || getter)(target, property, unit, uncache)); 3803 } : format((_plugins[property] && _plugins[property].get || getter)(target, property, unit, uncache)); 3804 }, 3805 quickSetter: function quickSetter(target, property, unit) { 3806 target = toArray(target); 3807 3808 if (target.length > 1) { 3809 var setters = target.map(function (t) { 3810 return gsap.quickSetter(t, property, unit); 3811 }), 3812 l = setters.length; 3813 return function (value) { 3814 var i = l; 3815 3816 while (i--) { 3817 setters[i](value); 3818 } 3819 }; 3820 } 3821 3822 target = target[0] || {}; 3823 3824 var Plugin = _plugins[property], 3825 cache = _getCache(target), 3826 p = cache.harness && (cache.harness.aliases || {})[property] || property, 3827 setter = Plugin ? function (value) { 3828 var p = new Plugin(); 3829 _quickTween._pt = 0; 3830 p.init(target, unit ? value + unit : value, _quickTween, 0, [target]); 3831 p.render(1, p); 3832 _quickTween._pt && _renderPropTweens(1, _quickTween); 3833 } : cache.set(target, p); 3834 3835 return Plugin ? setter : function (value) { 3836 return setter(target, p, unit ? value + unit : value, cache, 1); 3837 }; 3838 }, 3839 quickTo: function quickTo(target, property, vars) { 3840 var _merge2; 3841 3842 var tween = gsap.to(target, _merge((_merge2 = {}, _merge2[property] = "+=0.1", _merge2.paused = true, _merge
vendor: 5,649 bytes, lines 3842-4044
38422), vars || {})), 3843 func = function func(value, start, startIsRelative) { 3844 return tween.resetTo(property, value, start, startIsRelative); 3845 }; 3846 3847 func.tween = tween; 3848 return func; 3849 }, 3850 isTweening: function isTweening(targets) { 3851 return _globalTimeline.getTweensOf(targets, true).length > 0; 3852 }, 3853 defaults: function defaults(value) { 3854 value && value.ease && (value.ease = _parseEase(value.ease, _defaults.ease)); 3855 return _mergeDeep(_defaults, value || {}); 3856 }, 3857 config: function config(value) { 3858 return _mergeDeep(_config, value || {}); 3859 }, 3860 registerEffect: function registerEffect(_ref3) { 3861 var name = _ref3.name, 3862 effect = _ref3.effect, 3863 plugins = _ref3.plugins, 3864 defaults = _ref3.defaults, 3865 extendTimeline = _ref3.extendTimeline; 3866 (plugins || "").split(",").forEach(function (pluginName) { 3867 return pluginName && !_plugins[pluginName] && !_globals[pluginName] && _warn(name + " effect requires " + pluginName + " plugin."); 3868 }); 3869 3870 _effects[name] = function (targets, vars, tl) { 3871 return effect(toArray(targets), _setDefaults(vars || {}, defaults), tl); 3872 }; 3873 3874 if (extendTimeline) { 3875 Timeline.prototype[name] = function (targets, vars, position) { 3876 return this.add(_effects[name](targets, _isObject(vars) ? vars : (position = vars) && {}, this), position); 3877 }; 3878 } 3879 }, 3880 registerEase: function registerEase(name, ease) { 3881 _easeMap[name] = _parseEase(ease); 3882 }, 3883 parseEase: function parseEase(ease, defaultEase) { 3884 return arguments.length ? _parseEase(ease, defaultEase) : _easeMap; 3885 }, 3886 getById: function getById(id) { 3887 return _globalTimeline.getById(id); 3888 }, 3889 exportRoot: function exportRoot(vars, includeDelayedCalls) { 3890 if (vars === void 0) { 3891 vars = {}; 3892 } 3893 3894 var tl = new Timeline(vars), 3895 child, 3896 next; 3897 tl.smoothChildTiming = _isNotFalse(vars.smoothChildTiming); 3898 3899 _globalTimeline.remove(tl); 3900 3901 tl._dp = 0; 3902 tl._time = tl._tTime = _globalTimeline._time; 3903 child = _globalTimeline._first; 3904 3905 while (child) { 3906 next = child._next; 3907 3908 if (includeDelayedCalls || !(!child._dur && child instanceof Tween && child.vars.onComplete === child._targets[0])) { 3909 _addToTimeline(tl, child, child._start - child._delay); 3910 } 3911 3912 child = next; 3913 } 3914 3915 _addToTimeline(_globalTimeline, tl, 0); 3916 3917 return tl; 3918 }, 3919 context: function context(func, scope) { 3920 return func ? new Context(func, scope) : _context; 3921 }, 3922 matchMedia: function matchMedia(scope) { 3923 return new MatchMedia(scope); 3924 }, 3925 matchMediaRefresh: function matchMediaRefresh() { 3926 return _media.forEach(function (c) { 3927 var cond = c.conditions, 3928 found, 3929 p; 3930 3931 for (p in cond) { 3932 if (cond[p]) { 3933 cond[p] = false; 3934 found = 1; 3935 } 3936 } 3937 3938 found && c.revert(); 3939 }) || _onMediaChange(); 3940 }, 3941 addEventListener: function addEventListener(type, callback) { 3942 var a = _listeners[type] || (_listeners[type] = []); 3943 ~a.indexOf(callback) || a.push(callback); 3944 }, 3945 removeEventListener: function removeEventListener(type, callback) { 3946 var a = _listeners[type], 3947 i = a && a.indexOf(callback); 3948 i >= 0 && a.splice(i, 1); 3949 }, 3950 utils: { 3951 wrap: wrap, 3952 wrapYoyo: wrapYoyo, 3953 distribute: distribute, 3954 random: random, 3955 snap: snap, 3956 normalize: normalize, 3957 getUnit: getUnit, 3958 clamp: clamp, 3959 splitColor: splitColor, 3960 toArray: toArray, 3961 selector: selector, 3962 mapRange: mapRange, 3963 pipe: pipe, 3964 unitize: unitize, 3965 interpolate: interpolate, 3966 shuffle: shuffle 3967 }, 3968 install: _install, 3969 effects: _effects, 3970 ticker: _ticker, 3971 updateRoot: Timeline.updateRoot, 3972 plugins: _plugins, 3973 globalTimeline: _globalTimeline, 3974 core: { 3975 PropTween: PropTween, 3976 globals: _addGlobal, 3977 Tween: Tween, 3978 Timeline: Timeline, 3979 Animation: Animation, 3980 getCache: _getCache, 3981 _removeLinkedListItem: _removeLinkedListItem, 3982 reverting: function reverting() { 3983 return _reverting; 3984 }, 3985 context: function context(toAdd) { 3986 if (toAdd && _context) { 3987 _context.data.push(toAdd); 3988 3989 toAdd._ctx = _context; 3990 } 3991 3992 return _context; 3993 }, 3994 suppressOverwrites: function suppressOverwrites(value) { 3995 return _suppressOverwrites = value; 3996 } 3997 } 3998 }; 3999 4000 _forEachName("to,from,fromTo,delayedCall,set,killTweensOf", function (name) { 4001 return _gsap[name] = Tween[name]; 4002 }); 4003 4004 _ticker.add(Timeline.updateRoot); 4005 4006 _quickTween = _gsap.to({}, { 4007 duration: 0 4008 }); 4009 4010 var _getPluginPropTween = function _getPluginPropTween(plugin, prop) { 4011 var pt = plugin._pt; 4012 4013 while (pt && pt.p !== prop && pt.op !== prop && pt.fp !== prop) { 4014 pt = pt._next; 4015 } 4016 4017 return pt; 4018 }, 4019 _addModifiers = function _addModifiers(tween, modifiers) { 4020 var targets = tween._targets, 4021 p, 4022 i, 4023 pt; 4024 4025 for (p in modifiers) { 4026 i = targets.length; 4027 4028 while (i--) { 4029 pt = tween._ptLookup[i][p]; 4030 4031 if (pt && (pt = pt.d)) { 4032 if (pt._pt) { 4033 pt = _getPluginPropTween(pt, p); 4034 } 4035 4036 pt && pt.modifier && pt.modifier(modifiers[p], tween, targets[i], p); 4037 } 4038 } 4039 } 4040 }, 4041 _buildModifierPlugin = function _buildModifierPlugin(name, modifier) { 4042 return { 4043 name: name, 4044
vendor: 20,072 bytes, lines 4044-4671
4044rawVars: 1, 4045 init: function init(target, vars, tween) { 4046 tween._onInit = function (tween) { 4047 var temp, p; 4048 4049 if (_isString(vars)) { 4050 temp = {}; 4051 4052 _forEachName(vars, function (name) { 4053 return temp[name] = 1; 4054 }); 4055 4056 vars = temp; 4057 } 4058 4059 if (modifier) { 4060 temp = {}; 4061 4062 for (p in vars) { 4063 temp[p] = modifier(vars[p]); 4064 } 4065 4066 vars = temp; 4067 } 4068 4069 _addModifiers(tween, vars); 4070 }; 4071 } 4072 }; 4073 }; 4074 4075 var gsap = _gsap.registerPlugin({ 4076 name: "attr", 4077 init: function init(target, vars, tween, index, targets) { 4078 var p, pt, v; 4079 this.tween = tween; 4080 4081 for (p in vars) { 4082 v = target.getAttribute(p) || ""; 4083 pt = this.add(target, "setAttribute", (v || 0) + "", vars[p], index, targets, 0, 0, p); 4084 pt.op = p; 4085 pt.b = v; 4086 4087 this._props.push(p); 4088 } 4089 }, 4090 render: function render(ratio, data) { 4091 var pt = data._pt; 4092 4093 while (pt) { 4094 _reverting ? pt.set(pt.t, pt.p, pt.b, pt) : pt.r(ratio, pt.d); 4095 pt = pt._next; 4096 } 4097 } 4098 }, { 4099 name: "endArray", 4100 init: function init(target, value) { 4101 var i = value.length; 4102 4103 while (i--) { 4104 this.add(target, i, target[i] || 0, value[i], 0, 0, 0, 0, 0, 1); 4105 } 4106 } 4107 }, _buildModifierPlugin("roundProps", _roundModifier), _buildModifierPlugin("modifiers"), _buildModifierPlugin("snap", snap)) || _gsap; 4108 Tween.version = Timeline.version = gsap.version = "3.11.3"; 4109 _coreReady = 1; 4110 _windowExists() && _wake(); 4111 var Power0 = _easeMap.Power0, 4112 Power1 = _easeMap.Power1, 4113 Power2 = _easeMap.Power2, 4114 Power3 = _easeMap.Power3, 4115 Power4 = _easeMap.Power4, 4116 Linear = _easeMap.Linear, 4117 Quad = _easeMap.Quad, 4118 Cubic = _easeMap.Cubic, 4119 Quart = _easeMap.Quart, 4120 Quint = _easeMap.Quint, 4121 Strong = _easeMap.Strong, 4122 Elastic = _easeMap.Elastic, 4123 Back = _easeMap.Back, 4124 SteppedEase = _easeMap.SteppedEase, 4125 Bounce = _easeMap.Bounce, 4126 Sine = _easeMap.Sine, 4127 Expo = _easeMap.Expo, 4128 Circ = _easeMap.Circ; 4129 4130 var _win$1, 4131 _doc$1, 4132 _docElement, 4133 _pluginInitted, 4134 _tempDiv, 4135 _tempDivStyler, 4136 _recentSetterPlugin, 4137 _reverting$1, 4138 _windowExists$1 = function _windowExists() { 4139 return typeof window !== "undefined"; 4140 }, 4141 _transformProps = {}, 4142 _RAD2DEG = 180 / Math.PI, 4143 _DEG2RAD = Math.PI / 180, 4144 _atan2 = Math.atan2, 4145 _bigNum$1 = 1e8, 4146 _capsExp = /([A-Z])/g, 4147 _horizontalExp = /(left|right|width|margin|padding|x)/i, 4148 _complexExp = /[\s,\(]\S/, 4149 _propertyAliases = { 4150 autoAlpha: "opacity,visibility", 4151 scale: "scaleX,scaleY", 4152 alpha: "opacity" 4153 }, 4154 _renderCSSProp = function _renderCSSProp(ratio, data) { 4155 return data.set(data.t, data.p, Math.round((data.s + data.c * ratio) * 10000) / 10000 + data.u, data); 4156 }, 4157 _renderPropWithEnd = function _renderPropWithEnd(ratio, data) { 4158 return data.set(data.t, data.p, ratio === 1 ? data.e : Math.round((data.s + data.c * ratio) * 10000) / 10000 + data.u, data); 4159 }, 4160 _renderCSSPropWithBeginning = function _renderCSSPropWithBeginning(ratio, data) { 4161 return data.set(data.t, data.p, ratio ? Math.round((data.s + data.c * ratio) * 10000) / 10000 + data.u : data.b, data); 4162 }, 4163 _renderRoundedCSSProp = function _renderRoundedCSSProp(ratio, data) { 4164 var value = data.s + data.c * ratio; 4165 data.set(data.t, data.p, ~~(value + (value < 0 ? -.5 : .5)) + data.u, data); 4166 }, 4167 _renderNonTweeningValue = function _renderNonTweeningValue(ratio, data) { 4168 return data.set(data.t, data.p, ratio ? data.e : data.b, data); 4169 }, 4170 _renderNonTweeningValueOnlyAtEnd = function _renderNonTweeningValueOnlyAtEnd(ratio, data) { 4171 return data.set(data.t, data.p, ratio !== 1 ? data.b : data.e, data); 4172 }, 4173 _setterCSSStyle = function _setterCSSStyle(target, property, value) { 4174 return target.style[property] = value; 4175 }, 4176 _setterCSSProp = function _setterCSSProp(target, property, value) { 4177 return target.style.setProperty(property, value); 4178 }, 4179 _setterTransform = function _setterTransform(target, property, value) { 4180 return target._gsap[property] = value; 4181 }, 4182 _setterScale = function _setterScale(target, property, value) { 4183 return target._gsap.scaleX = target._gsap.scaleY = value; 4184 }, 4185 _setterScaleWithRender = function _setterScaleWithRender(target, property, value, data, ratio) { 4186 var cache = target._gsap; 4187 cache.scaleX = cache.scaleY = value; 4188 cache.renderTransform(ratio, cache); 4189 }, 4190 _setterTransformWithRender = function _setterTransformWithRender(target, property, value, data, ratio) { 4191 var cache = target._gsap; 4192 cache[property] = value; 4193 cache.renderTransform(ratio, cache); 4194 }, 4195 _transformProp = "transform", 4196 _transformOriginProp = _transformProp + "Origin", 4197 _saveStyle = function _saveStyle(property, isNotCSS) { 4198 var _this = this; 4199 4200 var target = this.target, 4201 style = target.style; 4202 4203 if (property in _transformProps) { 4204 this.tfm = this.tfm || {}; 4205 4206 if (property !== "transform") { 4207 property = _propertyAliases[property] || property; 4208 ~property.indexOf(",") ? property.split(",").forEach(function (a) { 4209 return _this.tfm[a] = _get(target, a); 4210 }) : this.tfm[property] = target._gsap.x ? target._gsap[property] : _get(target, property); 4211 } 4212 4213 if (this.props.indexOf(_transformProp) >= 0) { 4214 return; 4215 } 4216 4217 if (target._gsap.svg) { 4218 this.svgo = target.getAttribute("data-svg-origin"); 4219 this.props.push(_transformOriginProp, isNotCSS, ""); 4220 } 4221 4222 property = _transformProp; 4223 } 4224 4225 (style || isNotCSS) && this.props.push(property, isNotCSS, style[property]); 4226 }, 4227 _removeIndependentTransforms = function _removeIndependentTransforms(style) { 4228 if (style.translate) { 4229 style.removeProperty("translate"); 4230 style.removeProperty("scale"); 4231 style.removeProperty("rotate"); 4232 } 4233 }, 4234 _revertStyle = function _revertStyle() { 4235 var props = this.props, 4236 target = this.target, 4237 style = target.style, 4238 cache = target._gsap, 4239 i, 4240 p; 4241 4242 for (i = 0; i < props.length; i += 3) { 4243 props[i + 1] ? target[props[i]] = props[i + 2] : props[i + 2] ? style[props[i]] = props[i + 2] : style.removeProperty(props[i].replace(_capsExp, "-$1").toLowerCase()); 4244 } 4245 4246 if (this.tfm) { 4247 for (p in this.tfm) { 4248 cache[p] = this.tfm[p]; 4249 } 4250 4251 if (cache.svg) { 4252 cache.renderTransform(); 4253 target.setAttribute("data-svg-origin", this.svgo || ""); 4254 } 4255 4256 i = _reverting$1(); 4257 4258 if (i && !i.isStart && !style[_transformProp]) { 4259 _removeIndependentTransforms(style); 4260 4261 cache.uncache = 1; 4262 } 4263 } 4264 }, 4265 _getStyleSaver = function _getStyleSaver(target, properties) { 4266 var saver = { 4267 target: target, 4268 props: [], 4269 revert: _revertStyle, 4270 save: _saveStyle 4271 }; 4272 properties && properties.split(",").forEach(function (p) { 4273 return saver.save(p); 4274 }); 4275 return saver; 4276 }, 4277 _supports3D, 4278 _createElement = function _createElement(type, ns) { 4279 var e = _doc$1.createElementNS ? _doc$1.createElementNS((ns || "http://www.w3.org/1999/xhtml").replace(/^https/, "http"), type) : _doc$1.createElement(type); 4280 return e.style ? e : _doc$1.createElement(type); 4281 }, 4282 _getComputedProperty = function _getComputedProperty(target, property, skipPrefixFallback) { 4283 var cs = getComputedStyle(target); 4284 return cs[property] || cs.getPropertyValue(property.replace(_capsExp, "-$1").toLowerCase()) || cs.getPropertyValue(property) || !skipPrefixFallback && _getComputedProperty(target, _checkPropPrefix(property) || property, 1) || ""; 4285 }, 4286 _prefixes = "O,Moz,ms,Ms,Webkit".split(","), 4287 _checkPropPrefix = function _checkPropPrefix(property, element, preferPrefix) { 4288 var e = element || _tempDiv, 4289 s = e.style, 4290 i = 5; 4291 4292 if (property in s && !preferPrefix) { 4293 return property; 4294 } 4295 4296 property = property.charAt(0).toUpperCase() + property.substr(1); 4297 4298 while (i-- && !(_prefixes[i] + property in s)) {} 4299 4300 return i < 0 ? null : (i === 3 ? "ms" : i >= 0 ? _prefixes[i] : "") + property; 4301 }, 4302 _initCore = function _initCore() { 4303 if (_windowExists$1() && window.document) { 4304 _win$1 = window; 4305 _doc$1 = _win$1.document; 4306 _docElement = _doc$1.documentElement; 4307 _tempDiv = _createElement("div") || { 4308 style: {} 4309 }; 4310 _tempDivStyler = _createElement("div"); 4311 _transformProp = _checkPropPrefix(_transformProp); 4312 _transformOriginProp = _transformProp + "Origin"; 4313 _tempDiv.style.cssText = "border-width:0;line-height:0;position:absolute;padding:0"; 4314 _supports3D = !!_checkPropPrefix("perspective"); 4315 _reverting$1 = gsap.core.reverting; 4316 _pluginInitted = 1; 4317 } 4318 }, 4319 _getBBoxHack = function _getBBoxHack(swapIfPossible) { 4320 var svg = _createElement("svg", this.ownerSVGElement && this.ownerSVGElement.getAttribute("xmlns") || "http://www.w3.org/2000/svg"), 4321 oldParent = this.parentNode, 4322 oldSibling = this.nextSibling, 4323 oldCSS = this.style.cssText, 4324 bbox; 4325 4326 _docElement.appendChild(svg); 4327 4328 svg.appendChild(this); 4329 this.style.display = "block"; 4330 4331 if (swapIfPossible) { 4332 try { 4333 bbox = this.getBBox(); 4334 this._gsapBBox = this.getBBox; 4335 this.getBBox = _getBBoxHack; 4336 } catch (e) {} 4337 } else if (this._gsapBBox) { 4338 bbox = this._gsapBBox(); 4339 } 4340 4341 if (oldParent) { 4342 if (oldSibling) { 4343 oldParent.insertBefore(this, oldSibling); 4344 } else { 4345 oldParent.appendChild(this); 4346 } 4347 } 4348 4349 _docElement.removeChild(svg); 4350 4351 this.style.cssText = oldCSS; 4352 return bbox; 4353 }, 4354 _getAttributeFallbacks = function _getAttributeFallbacks(target, attributesArray) { 4355 var i = attributesArray.length; 4356 4357 while (i--) { 4358 if (target.hasAttribute(attributesArray[i])) { 4359 return target.getAttribute(attributesArray[i]); 4360 } 4361 } 4362 }, 4363 _getBBox = function _getBBox(target) { 4364 var bounds; 4365 4366 try { 4367 bounds = target.getBBox(); 4368 } catch (error) { 4369 bounds = _getBBoxHack.call(target, true); 4370 } 4371 4372 bounds && (bounds.width || bounds.height) || target.getBBox === _getBBoxHack || (bounds = _getBBoxHack.call(target, true)); 4373 return bounds && !bounds.width && !bounds.x && !bounds.y ? { 4374 x: +_getAttributeFallbacks(target, ["x", "cx", "x1"]) || 0, 4375 y: +_getAttributeFallbacks(target, ["y", "cy", "y1"]) || 0, 4376 width: 0, 4377 height: 0 4378 } : bounds; 4379 }, 4380 _isSVG = function _isSVG(e) { 4381 return !!(e.getCTM && (!e.parentNode || e.ownerSVGElement) && _getBBox(e)); 4382 }, 4383 _removeProperty = function _removeProperty(target, property) { 4384 if (property) { 4385 var style = target.style; 4386 4387 if (property in _transformProps && property !== _transformOriginProp) { 4388 property = _transformProp; 4389 } 4390 4391 if (style.removeProperty) { 4392 if (property.substr(0, 2) === "ms" || property.substr(0, 6) === "webkit") { 4393 property = "-" + property; 4394 } 4395 4396 style.removeProperty(property.replace(_capsExp, "-$1").toLowerCase()); 4397 } else { 4398 style.removeAttribute(property); 4399 } 4400 } 4401 }, 4402 _addNonTweeningPT = function _addNonTweeningPT(plugin, target, property, beginning, end, onlySetAtEnd) { 4403 var pt = new PropTween(plugin._pt, target, property, 0, 1, onlySetAtEnd ? _renderNonTweeningValueOnlyAtEnd : _renderNonTweeningValue); 4404 plugin._pt = pt; 4405 pt.b = beginning; 4406 pt.e = end; 4407 4408 plugin._props.push(property); 4409 4410 return pt; 4411 }, 4412 _nonConvertibleUnits = { 4413 deg: 1, 4414 rad: 1, 4415 turn: 1 4416 }, 4417 _nonStandardLayouts = { 4418 grid: 1, 4419 flex: 1 4420 }, 4421 _convertToUnit = function _convertToUnit(target, property, value, unit) { 4422 var curValue = parseFloat(value) || 0, 4423 curUnit = (value + "").trim().substr((curValue + "").length) || "px", 4424 style = _tempDiv.style, 4425 horizontal = _horizontalExp.test(property), 4426 isRootSVG = target.tagName.toLowerCase() === "svg", 4427 measureProperty = (isRootSVG ? "client" : "offset") + (horizontal ? "Width" : "Height"), 4428 amount = 100, 4429 toPixels = unit === "px", 4430 toPercent = unit === "%", 4431 px, 4432 parent, 4433 cache, 4434 isSVG; 4435 4436 if (unit === curUnit || !curValue || _nonConvertibleUnits[unit] || _nonConvertibleUnits[curUnit]) { 4437 return curValue; 4438 } 4439 4440 curUnit !== "px" && !toPixels && (curValue = _convertToUnit(target, property, value, "px")); 4441 isSVG = target.getCTM && _isSVG(target); 4442 4443 if ((toPercent || curUnit === "%") && (_transformProps[property] || ~property.indexOf("adius"))) { 4444 px = isSVG ? target.getBBox()[horizontal ? "width" : "height"] : target[measureProperty]; 4445 return _round(toPercent ? curValue / px * amount : curValue / 100 * px); 4446 } 4447 4448 style[horizontal ? "width" : "height"] = amount + (toPixels ? curUnit : unit); 4449 parent = ~property.indexOf("adius") || unit === "em" && target.appendChild && !isRootSVG ? target : target.parentNode; 4450 4451 if (isSVG) { 4452 parent = (target.ownerSVGElement || {}).parentNode; 4453 } 4454 4455 if (!parent || parent === _doc$1 || !parent.appendChild) { 4456 parent = _doc$1.body; 4457 } 4458 4459 cache = parent._gsap; 4460 4461 if (cache && toPercent && cache.width && horizontal && cache.time === _ticker.time && !cache.uncache) { 4462 return _round(curValue / cache.width * amount); 4463 } else { 4464 (toPercent || curUnit === "%") && !_nonStandardLayouts[_getComputedProperty(parent, "display")] && (style.position = _getComputedProperty(target, "position")); 4465 parent === target && (style.position = "static"); 4466 parent.appendChild(_tempDiv); 4467 px = _tempDiv[measureProperty]; 4468 parent.removeChild(_tempDiv); 4469 style.position = "absolute"; 4470 4471 if (horizontal && toPercent) { 4472 cache = _getCache(parent); 4473 cache.time = _ticker.time; 4474 cache.width = parent[measureProperty]; 4475 } 4476 } 4477 4478 return _round(toPixels ? px * curValue / amount : px && curValue ? amount / px * curValue : 0); 4479 }, 4480 _get = function _get(target, property, unit, uncache) { 4481 var value; 4482 _pluginInitted || _initCore(); 4483 4484 if (property in _propertyAliases && property !== "transform") { 4485 property = _propertyAliases[property]; 4486 4487 if (~property.indexOf(",")) { 4488 property = property.split(",")[0]; 4489 } 4490 } 4491 4492 if (_transformProps[property] && property !== "transform") { 4493 value = _parseTransform(target, uncache); 4494 value = property !== "transformOrigin" ? value[property] : value.svg ? value.origin : _firstTwoOnly(_getComputedProperty(target, _transformOriginProp)) + " " + value.zOrigin + "px"; 4495 } else { 4496 value = target.style[property]; 4497 4498 if (!value || value === "auto" || uncache || ~(value + "").indexOf("calc(")) { 4499 value = _specialProps[property] && _specialProps[property](target, property, unit) || _getComputedProperty(target, property) || _getProperty(target, property) || (property === "opacity" ? 1 : 0); 4500 } 4501 } 4502 4503 return unit && !~(value + "").trim().indexOf(" ") ? _convertToUnit(target, property, value, unit) + unit : value; 4504 }, 4505 _tweenComplexCSSString = function _tweenComplexCSSString(target, prop, start, end) { 4506 if (!start || start === "none") { 4507 var p = _checkPropPrefix(prop, target, 1), 4508 s = p && _getComputedProperty(target, p, 1); 4509 4510 if (s && s !== start) { 4511 prop = p; 4512 start = s; 4513 } else if (prop === "borderColor") { 4514 start = _getComputedProperty(target, "borderTopColor"); 4515 } 4516 } 4517 4518 var pt = new PropTween(this._pt, target.style, prop, 0, 1, _renderComplexString), 4519 index = 0, 4520 matchIndex = 0, 4521 a, 4522 result, 4523 startValues, 4524 startNum, 4525 color, 4526 startValue, 4527 endValue, 4528 endNum, 4529 chunk, 4530 endUnit, 4531 startUnit, 4532 endValues; 4533 pt.b = start; 4534 pt.e = end; 4535 start += ""; 4536 end += ""; 4537 4538 if (end === "auto") { 4539 target.style[prop] = end; 4540 end = _getComputedProperty(target, prop) || end; 4541 target.style[prop] = start; 4542 } 4543 4544 a = [start, end]; 4545 4546 _colorStringFilter(a); 4547 4548 start = a[0]; 4549 end = a[1]; 4550 startValues = start.match(_numWithUnitExp) || []; 4551 endValues = end.match(_numWithUnitExp) || []; 4552 4553 if (endValues.length) { 4554 while (result = _numWithUnitExp.exec(end)) { 4555 endValue = result[0]; 4556 chunk = end.substring(index, result.index); 4557 4558 if (color) { 4559 color = (color + 1) % 5; 4560 } else if (chunk.substr(-5) === "rgba(" || chunk.substr(-5) === "hsla(") { 4561 color = 1; 4562 } 4563 4564 if (endValue !== (startValue = startValues[matchIndex++] || "")) { 4565 startNum = parseFloat(startValue) || 0; 4566 startUnit = startValue.substr((startNum + "").length); 4567 endValue.charAt(1) === "=" && (endValue = _parseRelative(startNum, endValue) + startUnit); 4568 endNum = parseFloat(endValue); 4569 endUnit = endValue.substr((endNum + "").length); 4570 index = _numWithUnitExp.lastIndex - endUnit.length; 4571 4572 if (!endUnit) { 4573 endUnit = endUnit || _config.units[prop] || startUnit; 4574 4575 if (index === end.length) { 4576 end += endUnit; 4577 pt.e += endUnit; 4578 } 4579 } 4580 4581 if (startUnit !== endUnit) { 4582 startNum = _convertToUnit(target, prop, startValue, endUnit) || 0; 4583 } 4584 4585 pt._pt = { 4586 _next: pt._pt, 4587 p: chunk || matchIndex === 1 ? chunk : ",", 4588 s: startNum, 4589 c: endNum - startNum, 4590 m: color && color < 4 || prop === "zIndex" ? Math.round : 0 4591 }; 4592 } 4593 } 4594 4595 pt.c = index < end.length ? end.substring(index, end.length) : ""; 4596 } else { 4597 pt.r = prop === "display" && end === "none" ? _renderNonTweeningValueOnlyAtEnd : _renderNonTweeningValue; 4598 } 4599 4600 _relExp.test(end) && (pt.e = 0); 4601 this._pt = pt; 4602 return pt; 4603 }, 4604 _keywordToPercent = { 4605 top: "0%", 4606 bottom: "100%", 4607 left: "0%", 4608 right: "100%", 4609 center: "50%" 4610 }, 4611 _convertKeywordsToPercentages = function _convertKeywordsToPercentages(value) { 4612 var split = value.split(" "), 4613 x = split[0], 4614 y = split[1] || "50%"; 4615 4616 if (x === "top" || x === "bottom" || y === "left" || y === "right") { 4617 value = x; 4618 x = y; 4619 y = value; 4620 } 4621 4622 split[0] = _keywordToPercent[x] || x; 4623 split[1] = _keywordToPercent[y] || y; 4624 return split.join(" "); 4625 }, 4626 _renderClearProps = function _renderClearProps(ratio, data) { 4627 if (data.tween && data.tween._time === data.tween._dur) { 4628 var target = data.t, 4629 style = target.style, 4630 props = data.u, 4631 cache = target._gsap, 4632 prop, 4633 clearTransforms, 4634 i; 4635 4636 if (props === "all" || props === true) { 4637 style.cssText = ""; 4638 clearTransforms = 1; 4639 } else { 4640 props = props.split(","); 4641 i = props.length; 4642 4643 while (--i > -1) { 4644 prop = props[i]; 4645 4646 if (_transformProps[prop]) { 4647 clearTransforms = 1; 4648 prop = prop === "transformOrigin" ? _transformOriginProp : _transformProp; 4649 } 4650 4651 _removeProperty(target, prop); 4652 } 4653 } 4654 4655 if (clearTransforms) { 4656 _removeProperty(target, _transformProp); 4657 4658 if (cache) { 4659 cache.svg && target.removeAttribute("transform"); 4660 4661 _parseTransform(target, 1); 4662 4663 cache.uncache = 1; 4664 4665 _removeIndependentTransforms(style); 4666 } 4667 } 4668 } 4669 }, 4670 _specialProps = { 4671 clearProps: function clearProps(plugin, target, property, endValue, tween) {
vendor: 1,580 bytes, lines 4672-4712
4672 if (tween.data !== "isFromStart") { 4673 var pt = plugin._pt = new PropTween(plugin._pt, target, property, 0, 0, _renderClearProps); 4674 pt.u = endValue; 4675 pt.pr = -10; 4676 pt.tween = tween; 4677 4678 plugin._props.push(property); 4679 4680 return 1; 4681 } 4682 } 4683 }, 4684 _identity2DMatrix = [1, 0, 0, 1, 0, 0], 4685 _rotationalProperties = {}, 4686 _isNullTransform = function _isNullTransform(value) { 4687 return value === "matrix(1, 0, 0, 1, 0, 0)" || value === "none" || !value; 4688 }, 4689 _getComputedTransformMatrixAsArray = function _getComputedTransformMatrixAsArray(target) { 4690 var matrixString = _getComputedProperty(target, _transformProp); 4691 4692 return _isNullTransform(matrixString) ? _identity2DMatrix : matrixString.substr(7).match(_numExp).map(_round); 4693 }, 4694 _getMatrix = function _getMatrix(target, force2D) { 4695 var cache = target._gsap || _getCache(target), 4696 style = target.style, 4697 matrix = _getComputedTransformMatrixAsArray(target), 4698 parent, 4699 nextSibling, 4700 temp, 4701 addedToDOM; 4702 4703 if (cache.svg && target.getAttribute("transform")) { 4704 temp = target.transform.baseVal.consolidate().matrix; 4705 matrix = [temp.a, temp.b, temp.c, temp.d, temp.e, temp.f]; 4706 return matrix.join(",") === "1,0,0,1,0,0" ? _identity2DMatrix : matrix; 4707 } else if (matrix === _identity2DMatrix && !target.offsetParent && target !== _docElement && !cache.svg) { 4708 temp = style.display; 4709 style.display = "block"; 4710 parent = target.parentNode; 4711 4712 if (!parent || !target.offsetParent
vendor: 18,897 bytes, lines 4712-5309
4712) { 4713 addedToDOM = 1; 4714 nextSibling = target.nextElementSibling; 4715 4716 _docElement.appendChild(target); 4717 } 4718 4719 matrix = _getComputedTransformMatrixAsArray(target); 4720 temp ? style.display = temp : _removeProperty(target, "display"); 4721 4722 if (addedToDOM) { 4723 nextSibling ? parent.insertBefore(target, nextSibling) : parent ? parent.appendChild(target) : _docElement.removeChild(target); 4724 } 4725 } 4726 4727 return force2D && matrix.length > 6 ? [matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]] : matrix; 4728 }, 4729 _applySVGOrigin = function _applySVGOrigin(target, origin, originIsAbsolute, smooth, matrixArray, pluginToAddPropTweensTo) { 4730 var cache = target._gsap, 4731 matrix = matrixArray || _getMatrix(target, true), 4732 xOriginOld = cache.xOrigin || 0, 4733 yOriginOld = cache.yOrigin || 0, 4734 xOffsetOld = cache.xOffset || 0, 4735 yOffsetOld = cache.yOffset || 0, 4736 a = matrix[0], 4737 b = matrix[1], 4738 c = matrix[2], 4739 d = matrix[3], 4740 tx = matrix[4], 4741 ty = matrix[5], 4742 originSplit = origin.split(" "), 4743 xOrigin = parseFloat(originSplit[0]) || 0, 4744 yOrigin = parseFloat(originSplit[1]) || 0, 4745 bounds, 4746 determinant, 4747 x, 4748 y; 4749 4750 if (!originIsAbsolute) { 4751 bounds = _getBBox(target); 4752 xOrigin = bounds.x + (~originSplit[0].indexOf("%") ? xOrigin / 100 * bounds.width : xOrigin); 4753 yOrigin = bounds.y + (~(originSplit[1] || originSplit[0]).indexOf("%") ? yOrigin / 100 * bounds.height : yOrigin); 4754 } else if (matrix !== _identity2DMatrix && (determinant = a * d - b * c)) { 4755 x = xOrigin * (d / determinant) + yOrigin * (-c / determinant) + (c * ty - d * tx) / determinant; 4756 y = xOrigin * (-b / determinant) + yOrigin * (a / determinant) - (a * ty - b * tx) / determinant; 4757 xOrigin = x; 4758 yOrigin = y; 4759 } 4760 4761 if (smooth || smooth !== false && cache.smooth) { 4762 tx = xOrigin - xOriginOld; 4763 ty = yOrigin - yOriginOld; 4764 cache.xOffset = xOffsetOld + (tx * a + ty * c) - tx; 4765 cache.yOffset = yOffsetOld + (tx * b + ty * d) - ty; 4766 } else { 4767 cache.xOffset = cache.yOffset = 0; 4768 } 4769 4770 cache.xOrigin = xOrigin; 4771 cache.yOrigin = yOrigin; 4772 cache.smooth = !!smooth; 4773 cache.origin = origin; 4774 cache.originIsAbsolute = !!originIsAbsolute; 4775 target.style[_transformOriginProp] = "0px 0px"; 4776 4777 if (pluginToAddPropTweensTo) { 4778 _addNonTweeningPT(pluginToAddPropTweensTo, cache, "xOrigin", xOriginOld, xOrigin); 4779 4780 _addNonTweeningPT(pluginToAddPropTweensTo, cache, "yOrigin", yOriginOld, yOrigin); 4781 4782 _addNonTweeningPT(pluginToAddPropTweensTo, cache, "xOffset", xOffsetOld, cache.xOffset); 4783 4784 _addNonTweeningPT(pluginToAddPropTweensTo, cache, "yOffset", yOffsetOld, cache.yOffset); 4785 } 4786 4787 target.setAttribute("data-svg-origin", xOrigin + " " + yOrigin); 4788 }, 4789 _parseTransform = function _parseTransform(target, uncache) { 4790 var cache = target._gsap || new GSCache(target); 4791 4792 if ("x" in cache && !uncache && !cache.uncache) { 4793 return cache; 4794 } 4795 4796 var style = target.style, 4797 invertedScaleX = cache.scaleX < 0, 4798 px = "px", 4799 deg = "deg", 4800 cs = getComputedStyle(target), 4801 origin = _getComputedProperty(target, _transformOriginProp) || "0", 4802 x, 4803 y, 4804 z, 4805 scaleX, 4806 scaleY, 4807 rotation, 4808 rotationX, 4809 rotationY, 4810 skewX, 4811 skewY, 4812 perspective, 4813 xOrigin, 4814 yOrigin, 4815 matrix, 4816 angle, 4817 cos, 4818 sin, 4819 a, 4820 b, 4821 c, 4822 d, 4823 a12, 4824 a22, 4825 t1, 4826 t2, 4827 t3, 4828 a13, 4829 a23, 4830 a33, 4831 a42, 4832 a43, 4833 a32; 4834 x = y = z = rotation = rotationX = rotationY = skewX = skewY = perspective = 0; 4835 scaleX = scaleY = 1; 4836 cache.svg = !!(target.getCTM && _isSVG(target)); 4837 4838 if (cs.translate) { 4839 if (cs.translate !== "none" || cs.scale !== "none" || cs.rotate !== "none") { 4840 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] : ""); 4841 } 4842 4843 style.scale = style.rotate = style.translate = "none"; 4844 } 4845 4846 matrix = _getMatrix(target, cache.svg); 4847 4848 if (cache.svg) { 4849 if (cache.uncache) { 4850 t2 = target.getBBox(); 4851 origin = cache.xOrigin - t2.x + "px " + (cache.yOrigin - t2.y) + "px"; 4852 t1 = ""; 4853 } else { 4854 t1 = !uncache && target.getAttribute("data-svg-origin"); 4855 } 4856 4857 _applySVGOrigin(target, t1 || origin, !!t1 || cache.originIsAbsolute, cache.smooth !== false, matrix); 4858 } 4859 4860 xOrigin = cache.xOrigin || 0; 4861 yOrigin = cache.yOrigin || 0; 4862 4863 if (matrix !== _identity2DMatrix) { 4864 a = matrix[0]; 4865 b = matrix[1]; 4866 c = matrix[2]; 4867 d = matrix[3]; 4868 x = a12 = matrix[4]; 4869 y = a22 = matrix[5]; 4870 4871 if (matrix.length === 6) { 4872 scaleX = Math.sqrt(a * a + b * b); 4873 scaleY = Math.sqrt(d * d + c * c); 4874 rotation = a || b ? _atan2(b, a) * _RAD2DEG : 0; 4875 skewX = c || d ? _atan2(c, d) * _RAD2DEG + rotation : 0; 4876 skewX && (scaleY *= Math.abs(Math.cos(skewX * _DEG2RAD))); 4877 4878 if (cache.svg) { 4879 x -= xOrigin - (xOrigin * a + yOrigin * c); 4880 y -= yOrigin - (xOrigin * b + yOrigin * d); 4881 } 4882 } else { 4883 a32 = matrix[6]; 4884 a42 = matrix[7]; 4885 a13 = matrix[8]; 4886 a23 = matrix[9]; 4887 a33 = matrix[10]; 4888 a43 = matrix[11]; 4889 x = matrix[12]; 4890 y = matrix[13]; 4891 z = matrix[14]; 4892 angle = _atan2(a32, a33); 4893 rotationX = angle * _RAD2DEG; 4894 4895 if (angle) { 4896 cos = Math.cos(-angle); 4897 sin = Math.sin(-angle); 4898 t1 = a12 * cos + a13 * sin; 4899 t2 = a22 * cos + a23 * sin; 4900 t3 = a32 * cos + a33 * sin; 4901 a13 = a12 * -sin + a13 * cos; 4902 a23 = a22 * -sin + a23 * cos; 4903 a33 = a32 * -sin + a33 * cos; 4904 a43 = a42 * -sin + a43 * cos; 4905 a12 = t1; 4906 a22 = t2; 4907 a32 = t3; 4908 } 4909 4910 angle = _atan2(-c, a33); 4911 rotationY = angle * _RAD2DEG; 4912 4913 if (angle) { 4914 cos = Math.cos(-angle); 4915 sin = Math.sin(-angle); 4916 t1 = a * cos - a13 * sin; 4917 t2 = b * cos - a23 * sin; 4918 t3 = c * cos - a33 * sin; 4919 a43 = d * sin + a43 * cos; 4920 a = t1; 4921 b = t2; 4922 c = t3; 4923 } 4924 4925 angle = _atan2(b, a); 4926 rotation = angle * _RAD2DEG; 4927 4928 if (angle) { 4929 cos = Math.cos(angle); 4930 sin = Math.sin(angle); 4931 t1 = a * cos + b * sin; 4932 t2 = a12 * cos + a22 * sin; 4933 b = b * cos - a * sin; 4934 a22 = a22 * cos - a12 * sin; 4935 a = t1; 4936 a12 = t2; 4937 } 4938 4939 if (rotationX && Math.abs(rotationX) + Math.abs(rotation) > 359.9) { 4940 rotationX = rotation = 0; 4941 rotationY = 180 - rotationY; 4942 } 4943 4944 scaleX = _round(Math.sqrt(a * a + b * b + c * c)); 4945 scaleY = _round(Math.sqrt(a22 * a22 + a32 * a32)); 4946 angle = _atan2(a12, a22); 4947 skewX = Math.abs(angle) > 0.0002 ? angle * _RAD2DEG : 0; 4948 perspective = a43 ? 1 / (a43 < 0 ? -a43 : a43) : 0; 4949 } 4950 4951 if (cache.svg) { 4952 t1 = target.getAttribute("transform"); 4953 cache.forceCSS = target.setAttribute("transform", "") || !_isNullTransform(_getComputedProperty(target, _transformProp)); 4954 t1 && target.setAttribute("transform", t1); 4955 } 4956 } 4957 4958 if (Math.abs(skewX) > 90 && Math.abs(skewX) < 270) { 4959 if (invertedScaleX) { 4960 scaleX *= -1; 4961 skewX += rotation <= 0 ? 180 : -180; 4962 rotation += rotation <= 0 ? 180 : -180; 4963 } else { 4964 scaleY *= -1; 4965 skewX += skewX <= 0 ? 180 : -180; 4966 } 4967 } 4968 4969 uncache = uncache || cache.uncache; 4970 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; 4971 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; 4972 cache.z = z + px; 4973 cache.scaleX = _round(scaleX); 4974 cache.scaleY = _round(scaleY); 4975 cache.rotation = _round(rotation) + deg; 4976 cache.rotationX = _round(rotationX) + deg; 4977 cache.rotationY = _round(rotationY) + deg; 4978 cache.skewX = skewX + deg; 4979 cache.skewY = skewY + deg; 4980 cache.transformPerspective = perspective + px; 4981 4982 if (cache.zOrigin = parseFloat(origin.split(" ")[2]) || 0) { 4983 style[_transformOriginProp] = _firstTwoOnly(origin); 4984 } 4985 4986 cache.xOffset = cache.yOffset = 0; 4987 cache.force3D = _config.force3D; 4988 cache.renderTransform = cache.svg ? _renderSVGTransforms : _supports3D ? _renderCSSTransforms : _renderNon3DTransforms; 4989 cache.uncache = 0; 4990 return cache; 4991 }, 4992 _firstTwoOnly = function _firstTwoOnly(value) { 4993 return (value = value.split(" "))[0] + " " + value[1]; 4994 }, 4995 _addPxTranslate = function _addPxTranslate(target, start, value) { 4996 var unit = getUnit(start); 4997 return _round(parseFloat(start) + parseFloat(_convertToUnit(target, "x", value + "px", unit))) + unit; 4998 }, 4999 _renderNon3DTransforms = function _renderNon3DTransforms(ratio, cache) { 5000 cache.z = "0px"; 5001 cache.rotationY = cache.rotationX = "0deg"; 5002 cache.force3D = 0; 5003 5004 _renderCSSTransforms(ratio, cache); 5005 }, 5006 _zeroDeg = "0deg", 5007 _zeroPx = "0px", 5008 _endParenthesis = ") ", 5009 _renderCSSTransforms = function _renderCSSTransforms(ratio, cache) { 5010 var _ref = cache || this, 5011 xPercent = _ref.xPercent, 5012 yPercent = _ref.yPercent, 5013 x = _ref.x, 5014 y = _ref.y, 5015 z = _ref.z, 5016 rotation = _ref.rotation, 5017 rotationY = _ref.rotationY, 5018 rotationX = _ref.rotationX, 5019 skewX = _ref.skewX, 5020 skewY = _ref.skewY, 5021 scaleX = _ref.scaleX, 5022 scaleY = _ref.scaleY, 5023 transformPerspective = _ref.transformPerspective, 5024 force3D = _ref.force3D, 5025 target = _ref.target, 5026 zOrigin = _ref.zOrigin, 5027 transforms = "", 5028 use3D = force3D === "auto" && ratio && ratio !== 1 || force3D === true; 5029 5030 if (zOrigin && (rotationX !== _zeroDeg || rotationY !== _zeroDeg)) { 5031 var angle = parseFloat(rotationY) * _DEG2RAD, 5032 a13 = Math.sin(angle), 5033 a33 = Math.cos(angle), 5034 cos; 5035 5036 angle = parseFloat(rotationX) * _DEG2RAD; 5037 cos = Math.cos(angle); 5038 x = _addPxTranslate(target, x, a13 * cos * -zOrigin); 5039 y = _addPxTranslate(target, y, -Math.sin(angle) * -zOrigin); 5040 z = _addPxTranslate(target, z, a33 * cos * -zOrigin + zOrigin); 5041 } 5042 5043 if (transformPerspective !== _zeroPx) { 5044 transforms += "perspective(" + transformPerspective + _endParenthesis; 5045 } 5046 5047 if (xPercent || yPercent) { 5048 transforms += "translate(" + xPercent + "%, " + yPercent + "%) "; 5049 } 5050 5051 if (use3D || x !== _zeroPx || y !== _zeroPx || z !== _zeroPx) { 5052 transforms += z !== _zeroPx || use3D ? "translate3d(" + x + ", " + y + ", " + z + ") " : "translate(" + x + ", " + y + _endParenthesis; 5053 } 5054 5055 if (rotation !== _zeroDeg) { 5056 transforms += "rotate(" + rotation + _endParenthesis; 5057 } 5058 5059 if (rotationY !== _zeroDeg) { 5060 transforms += "rotateY(" + rotationY + _endParenthesis; 5061 } 5062 5063 if (rotationX !== _zeroDeg) { 5064 transforms += "rotateX(" + rotationX + _endParenthesis; 5065 } 5066 5067 if (skewX !== _zeroDeg || skewY !== _zeroDeg) { 5068 transforms += "skew(" + skewX + ", " + skewY + _endParenthesis; 5069 } 5070 5071 if (scaleX !== 1 || scaleY !== 1) { 5072 transforms += "scale(" + scaleX + ", " + scaleY + _endParenthesis; 5073 } 5074 5075 target.style[_transformProp] = transforms || "translate(0, 0)"; 5076 }, 5077 _renderSVGTransforms = function _renderSVGTransforms(ratio, cache) { 5078 var _ref2 = cache || this, 5079 xPercent = _ref2.xPercent, 5080 yPercent = _ref2.yPercent, 5081 x = _ref2.x, 5082 y = _ref2.y, 5083 rotation = _ref2.rotation, 5084 skewX = _ref2.skewX, 5085 skewY = _ref2.skewY, 5086 scaleX = _ref2.scaleX, 5087 scaleY = _ref2.scaleY, 5088 target = _ref2.target, 5089 xOrigin = _ref2.xOrigin, 5090 yOrigin = _ref2.yOrigin, 5091 xOffset = _ref2.xOffset, 5092 yOffset = _ref2.yOffset, 5093 forceCSS = _ref2.forceCSS, 5094 tx = parseFloat(x), 5095 ty = parseFloat(y), 5096 a11, 5097 a21, 5098 a12, 5099 a22, 5100 temp; 5101 5102 rotation = parseFloat(rotation); 5103 skewX = parseFloat(skewX); 5104 skewY = parseFloat(skewY); 5105 5106 if (skewY) { 5107 skewY = parseFloat(skewY); 5108 skewX += skewY; 5109 rotation += skewY; 5110 } 5111 5112 if (rotation || skewX) { 5113 rotation *= _DEG2RAD; 5114 skewX *= _DEG2RAD; 5115 a11 = Math.cos(rotation) * scaleX; 5116 a21 = Math.sin(rotation) * scaleX; 5117 a12 = Math.sin(rotation - skewX) * -scaleY; 5118 a22 = Math.cos(rotation - skewX) * scaleY; 5119 5120 if (skewX) { 5121 skewY *= _DEG2RAD; 5122 temp = Math.tan(skewX - skewY); 5123 temp = Math.sqrt(1 + temp * temp); 5124 a12 *= temp; 5125 a22 *= temp; 5126 5127 if (skewY) { 5128 temp = Math.tan(skewY); 5129 temp = Math.sqrt(1 + temp * temp); 5130 a11 *= temp; 5131 a21 *= temp; 5132 } 5133 } 5134 5135 a11 = _round(a11); 5136 a21 = _round(a21); 5137 a12 = _round(a12); 5138 a22 = _round(a22); 5139 } else { 5140 a11 = scaleX; 5141 a22 = scaleY; 5142 a21 = a12 = 0; 5143 } 5144 5145 if (tx && !~(x + "").indexOf("px") || ty && !~(y + "").indexOf("px")) { 5146 tx = _convertToUnit(target, "x", x, "px"); 5147 ty = _convertToUnit(target, "y", y, "px"); 5148 } 5149 5150 if (xOrigin || yOrigin || xOffset || yOffset) { 5151 tx = _round(tx + xOrigin - (xOrigin * a11 + yOrigin * a12) + xOffset); 5152 ty = _round(ty + yOrigin - (xOrigin * a21 + yOrigin * a22) + yOffset); 5153 } 5154 5155 if (xPercent || yPercent) { 5156 temp = target.getBBox(); 5157 tx = _round(tx + xPercent / 100 * temp.width); 5158 ty = _round(ty + yPercent / 100 * temp.height); 5159 } 5160 5161 temp = "matrix(" + a11 + "," + a21 + "," + a12 + "," + a22 + "," + tx + "," + ty + ")"; 5162 target.setAttribute("transform", temp); 5163 forceCSS && (target.style[_transformProp] = temp); 5164 }, 5165 _addRotationalPropTween = function _addRotationalPropTween(plugin, target, property, startNum, endValue) { 5166 var cap = 360, 5167 isString = _isString(endValue), 5168 endNum = parseFloat(endValue) * (isString && ~endValue.indexOf("rad") ? _RAD2DEG : 1), 5169 change = endNum - startNum, 5170 finalValue = startNum + change + "deg", 5171 direction, 5172 pt; 5173 5174 if (isString) { 5175 direction = endValue.split("_")[1]; 5176 5177 if (direction === "short") { 5178 change %= cap; 5179 5180 if (change !== change % (cap / 2)) { 5181 change += change < 0 ? cap : -cap; 5182 } 5183 } 5184 5185 if (direction === "cw" && change < 0) { 5186 change = (change + cap * _bigNum$1) % cap - ~~(change / cap) * cap; 5187 } else if (direction === "ccw" && change > 0) { 5188 change = (change - cap * _bigNum$1) % cap - ~~(change / cap) * cap; 5189 } 5190 } 5191 5192 plugin._pt = pt = new PropTween(plugin._pt, target, property, startNum, change, _renderPropWithEnd); 5193 pt.e = finalValue; 5194 pt.u = "deg"; 5195 5196 plugin._props.push(property); 5197 5198 return pt; 5199 }, 5200 _assign = function _assign(target, source) { 5201 for (var p in source) { 5202 target[p] = source[p]; 5203 } 5204 5205 return target; 5206 }, 5207 _addRawTransformPTs = function _addRawTransformPTs(plugin, transforms, target) { 5208 var startCache = _assign({}, target._gsap), 5209 exclude = "perspective,force3D,transformOrigin,svgOrigin", 5210 style = target.style, 5211 endCache, 5212 p, 5213 startValue, 5214 endValue, 5215 startNum, 5216 endNum, 5217 startUnit, 5218 endUnit; 5219 5220 if (startCache.svg) { 5221 startValue = target.getAttribute("transform"); 5222 target.setAttribute("transform", ""); 5223 style[_transformProp] = transforms; 5224 endCache = _parseTransform(target, 1); 5225 5226 _removeProperty(target, _transformProp); 5227 5228 target.setAttribute("transform", startValue); 5229 } else { 5230 startValue = getComputedStyle(target)[_transformProp]; 5231 style[_transformProp] = transforms; 5232 endCache = _parseTransform(target, 1); 5233 style[_transformProp] = startValue; 5234 } 5235 5236 for (p in _transformProps) { 5237 startValue = startCache[p]; 5238 endValue = endCache[p]; 5239 5240 if (startValue !== endValue && exclude.indexOf(p) < 0) { 5241 startUnit = getUnit(startValue); 5242 endUnit = getUnit(endValue); 5243 startNum = startUnit !== endUnit ? _convertToUnit(target, p, startValue, endUnit) : parseFloat(startValue); 5244 endNum = parseFloat(endValue); 5245 plugin._pt = new PropTween(plugin._pt, endCache, p, startNum, endNum - startNum, _renderCSSProp); 5246 plugin._pt.u = endUnit || 0; 5247 5248 plugin._props.push(p); 5249 } 5250 } 5251 5252 _assign(endCache, startCache); 5253 }; 5254 5255 _forEachName("padding,margin,Width,Radius", function (name, index) { 5256 var t = "Top", 5257 r = "Right", 5258 b = "Bottom", 5259 l = "Left", 5260 props = (index < 3 ? [t, r, b, l] : [t + l, t + r, b + r, b + l]).map(function (side) { 5261 return index < 2 ? name + side : "border" + side + name; 5262 }); 5263 5264 _specialProps[index > 1 ? "border" + name : name] = function (plugin, target, property, endValue, tween) { 5265 var a, vars; 5266 5267 if (arguments.length < 4) { 5268 a = props.map(function (prop) { 5269 return _get(plugin, prop, property); 5270 }); 5271 vars = a.join(" "); 5272 return vars.split(a[0]).length === 5 ? a[0] : vars; 5273 } 5274 5275 a = (endValue + "").split(" "); 5276 vars = {}; 5277 props.forEach(function (prop, i) { 5278 return vars[prop] = a[i] = a[i] || a[(i - 1) / 2 | 0]; 5279 }); 5280 plugin.init(target, vars, tween); 5281 }; 5282 }); 5283 5284 var CSSPlugin = { 5285 name: "css", 5286 register: _initCore, 5287 targetTest: function targetTest(target) { 5288 return target.style && target.nodeType; 5289 }, 5290 init: function init(target, vars, tween, index, targets) { 5291 var props = this._props, 5292 style = target.style, 5293 startAt = tween.vars.startAt, 5294 startValue, 5295 endValue, 5296 endNum, 5297 startNum, 5298 type, 5299 specialProp, 5300 p, 5301 startUnit, 5302 endUnit, 5303 relative, 5304 isTransformRelated, 5305 transformPropTween, 5306 cache, 5307 smooth, 5308 hasPriority, 5309 inlineProps
vendor: 6,752 bytes, lines 5309-5466
5309; 5310 _pluginInitted || _initCore(); 5311 this.styles = this.styles || _getStyleSaver(target); 5312 inlineProps = this.styles.props; 5313 this.tween = tween; 5314 5315 for (p in vars) { 5316 if (p === "autoRound") { 5317 continue; 5318 } 5319 5320 endValue = vars[p]; 5321 5322 if (_plugins[p] && _checkPlugin(p, vars, tween, index, target, targets)) { 5323 continue; 5324 } 5325 5326 type = typeof endValue; 5327 specialProp = _specialProps[p]; 5328 5329 if (type === "function") { 5330 endValue = endValue.call(tween, index, target, targets); 5331 type = typeof endValue; 5332 } 5333 5334 if (type === "string" && ~endValue.indexOf("random(")) { 5335 endValue = _replaceRandom(endValue); 5336 } 5337 5338 if (specialProp) { 5339 specialProp(this, target, p, endValue, tween) && (hasPriority = 1); 5340 } else if (p.substr(0, 2) === "--") { 5341 startValue = (getComputedStyle(target).getPropertyValue(p) + "").trim(); 5342 endValue += ""; 5343 _colorExp.lastIndex = 0; 5344 5345 if (!_colorExp.test(startValue)) { 5346 startUnit = getUnit(startValue); 5347 endUnit = getUnit(endValue); 5348 } 5349 5350 endUnit ? startUnit !== endUnit && (startValue = _convertToUnit(target, p, startValue, endUnit) + endUnit) : startUnit && (endValue += startUnit); 5351 this.add(style, "setProperty", startValue, endValue, index, targets, 0, 0, p); 5352 props.push(p); 5353 inlineProps.push(p, 0, style[p]); 5354 } else if (type !== "undefined") { 5355 if (startAt && p in startAt) { 5356 startValue = typeof startAt[p] === "function" ? startAt[p].call(tween, index, target, targets) : startAt[p]; 5357 _isString(startValue) && ~startValue.indexOf("random(") && (startValue = _replaceRandom(startValue)); 5358 getUnit(startValue + "") || (startValue += _config.units[p] || getUnit(_get(target, p)) || ""); 5359 (startValue + "").charAt(1) === "=" && (startValue = _get(target, p)); 5360 } else { 5361 startValue = _get(target, p); 5362 } 5363 5364 startNum = parseFloat(startValue); 5365 relative = type === "string" && endValue.charAt(1) === "=" && endValue.substr(0, 2); 5366 relative && (endValue = endValue.substr(2)); 5367 endNum = parseFloat(endValue); 5368 5369 if (p in _propertyAliases) { 5370 if (p === "autoAlpha") { 5371 if (startNum === 1 && _get(target, "visibility") === "hidden" && endNum) { 5372 startNum = 0; 5373 } 5374 5375 inlineProps.push("visibility", 0, style.visibility); 5376 5377 _addNonTweeningPT(this, style, "visibility", startNum ? "inherit" : "hidden", endNum ? "inherit" : "hidden", !endNum); 5378 } 5379 5380 if (p !== "scale" && p !== "transform") { 5381 p = _propertyAliases[p]; 5382 ~p.indexOf(",") && (p = p.split(",")[0]); 5383 } 5384 } 5385 5386 isTransformRelated = p in _transformProps; 5387 5388 if (isTransformRelated) { 5389 this.styles.save(p); 5390 5391 if (!transformPropTween) { 5392 cache = target._gsap; 5393 cache.renderTransform && !vars.parseTransform || _parseTransform(target, vars.parseTransform); 5394 smooth = vars.smoothOrigin !== false && cache.smooth; 5395 transformPropTween = this._pt = new PropTween(this._pt, style, _transformProp, 0, 1, cache.renderTransform, cache, 0, -1); 5396 transformPropTween.dep = 1; 5397 } 5398 5399 if (p === "scale") { 5400 this._pt = new PropTween(this._pt, cache, "scaleY", startNum, (relative ? _parseRelative(startNum, relative + endNum) : endNum) - startNum || 0, _renderCSSProp); 5401 this._pt.u = 0; 5402 props.push("scaleY", p); 5403 p += "X"; 5404 } else if (p === "transformOrigin") { 5405 inlineProps.push(_transformOriginProp, 0, style[_transformOriginProp]); 5406 endValue = _convertKeywordsToPercentages(endValue); 5407 5408 if (cache.svg) { 5409 _applySVGOrigin(target, endValue, 0, smooth, 0, this); 5410 } else { 5411 endUnit = parseFloat(endValue.split(" ")[2]) || 0; 5412 endUnit !== cache.zOrigin && _addNonTweeningPT(this, cache, "zOrigin", cache.zOrigin, endUnit); 5413 5414 _addNonTweeningPT(this, style, p, _firstTwoOnly(startValue), _firstTwoOnly(endValue)); 5415 } 5416 5417 continue; 5418 } else if (p === "svgOrigin") { 5419 _applySVGOrigin(target, endValue, 1, smooth, 0, this); 5420 5421 continue; 5422 } else if (p in _rotationalProperties) { 5423 _addRotationalPropTween(this, cache, p, startNum, relative ? _parseRelative(startNum, relative + endValue) : endValue); 5424 5425 continue; 5426 } else if (p === "smoothOrigin") { 5427 _addNonTweeningPT(this, cache, "smooth", cache.smooth, endValue); 5428 5429 continue; 5430 } else if (p === "force3D") { 5431 cache[p] = endValue; 5432 continue; 5433 } else if (p === "transform") { 5434 _addRawTransformPTs(this, endValue, target); 5435 5436 continue; 5437 } 5438 } else if (!(p in style)) { 5439 p = _checkPropPrefix(p) || p; 5440 } 5441 5442 if (isTransformRelated || (endNum || endNum === 0) && (startNum || startNum === 0) && !_complexExp.test(endValue) && p in style) { 5443 startUnit = (startValue + "").substr((startNum + "").length); 5444 endNum || (endNum = 0); 5445 endUnit = getUnit(endValue) || (p in _config.units ? _config.units[p] : startUnit); 5446 startUnit !== endUnit && (startNum = _convertToUnit(target, p, startValue, endUnit)); 5447 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); 5448 this._pt.u = endUnit || 0; 5449 5450 if (startUnit !== endUnit && endUnit !== "%") { 5451 this._pt.b = startValue; 5452 this._pt.r = _renderCSSPropWithBeginning; 5453 } 5454 } else if (!(p in style)) { 5455 if (p in target) { 5456 this.add(target, p, startValue || target[p], relative ? relative + endValue : endValue, index, targets); 5457 } else { 5458 _missingPlugin(p, endValue); 5459 5460 continue; 5461 } 5462 } else { 5463 _tweenComplexCSSString.call(this, target, p, startValue, relative ? relative + endValue : endValue); 5464 } 5465 5466 isTransformRelated || (p in style ? inlineProps.push(p, 0, style[p]
vendor: 3,264 bytes, lines 5466-5555
5466) : inlineProps.push(p, 1, startValue || target[p])); 5467 props.push(p); 5468 } 5469 } 5470 5471 hasPriority && _sortPropTweensByPriority(this); 5472 }, 5473 render: function render(ratio, data) { 5474 if (data.tween._time || !_reverting$1()) { 5475 var pt = data._pt; 5476 5477 while (pt) { 5478 pt.r(ratio, pt.d); 5479 pt = pt._next; 5480 } 5481 } else { 5482 data.styles.revert(); 5483 } 5484 }, 5485 get: _get, 5486 aliases: _propertyAliases, 5487 getSetter: function getSetter(target, property, plugin) { 5488 var p = _propertyAliases[property]; 5489 p && p.indexOf(",") < 0 && (property = p); 5490 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); 5491 }, 5492 core: { 5493 _removeProperty: _removeProperty, 5494 _getMatrix: _getMatrix 5495 } 5496 }; 5497 gsap.utils.checkPrefix = _checkPropPrefix; 5498 gsap.core.getStyleSaver = _getStyleSaver; 5499 5500 (function (positionAndScale, rotation, others, aliases) { 5501 var all = _forEachName(positionAndScale + "," + rotation + "," + others, function (name) { 5502 _transformProps[name] = 1; 5503 }); 5504 5505 _forEachName(rotation, function (name) { 5506 _config.units[name] = "deg"; 5507 _rotationalProperties[name] = 1; 5508 }); 5509 5510 _propertyAliases[all[13]] = positionAndScale + "," + rotation; 5511 5512 _forEachName(aliases, function (name) { 5513 var split = name.split(":"); 5514 _propertyAliases[split[1]] = all[split[0]]; 5515 }); 5516 })("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"); 5517 5518 _forEachName("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective", function (name) { 5519 _config.units[name] = "px"; 5520 }); 5521 5522 gsap.registerPlugin(CSSPlugin); 5523 5524 var gsapWithCSS = gsap.registerPlugin(CSSPlugin) || gsap, 5525 TweenMaxWithCSS = gsapWithCSS.core.Tween; 5526 5527 exports.Back = Back; 5528 exports.Bounce = Bounce; 5529 exports.CSSPlugin = CSSPlugin; 5530 exports.Circ = Circ; 5531 exports.Cubic = Cubic; 5532 exports.Elastic = Elastic; 5533 exports.Expo = Expo; 5534 exports.Linear = Linear; 5535 exports.Power0 = Power0; 5536 exports.Power1 = Power1; 5537 exports.Power2 = Power2; 5538 exports.Power3 = Power3; 5539 exports.Power4 = Power4; 5540 exports.Quad = Quad; 5541 exports.Quart = Quart; 5542 exports.Quint = Quint; 5543 exports.Sine = Sine; 5544 exports.SteppedEase = SteppedEase; 5545 exports.Strong = Strong; 5546 exports.TimelineLite = Timeline; 5547 exports.TimelineMax = Timeline; 5548 exports.TweenLite = Tween; 5549 exports.TweenMax = TweenMaxWithCSS; 5550 exports.default = gsapWithCSS; 5551 exports.gsap = gsapWithCSS; 5552 5553 if (typeof(window) === 'undefined' || window !== exports) {Object.defineProperty(exports, '__esModule', { value: true });} else {delete window.default;} 5554 5555})));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.