vendor/assets/javascripts/greensock/TweenMax.js in greensock-rails-1.20.3.0 vs vendor/assets/javascripts/greensock/TweenMax.js in greensock-rails-1.20.4.0

- old
+ new

@@ -1,13 +1,13 @@ /*! - * VERSION: 1.20.3 - * DATE: 2017-10-02 + * VERSION: 1.20.4 + * DATE: 2018-02-15 * UPDATES AND DOCS AT: http://greensock.com * * Includes all of the following: TweenLite, TweenMax, TimelineLite, TimelineMax, EasePack, CSSPlugin, RoundPropsPlugin, BezierPlugin, AttrPlugin, DirectionalRotationPlugin * - * @license Copyright (c) 2008-2017, GreenSock. All rights reserved. + * @license Copyright (c) 2008-2018, GreenSock. All rights reserved. * This work is subject to the terms at http://greensock.com/standard-license or for * Club GreenSock members, the software agreement that was issued with your membership. * * @author: Jack Doyle, jack@greensock.com **/ @@ -50,11 +50,11 @@ _isSelector = TweenLiteInternals.isSelector, _isArray = TweenLiteInternals.isArray, p = TweenMax.prototype = TweenLite.to({}, 0.1, {}), _blankArray = []; - TweenMax.version = "1.20.3"; + TweenMax.version = "1.20.4"; p.constructor = TweenMax; p.kill()._gc = false; TweenMax.killTweensOf = TweenMax.killDelayedCallsTo = TweenLite.killTweensOf; TweenMax.getTweensOf = TweenLite.getTweensOf; TweenMax.lagSmoothing = TweenLite.lagSmoothing; @@ -209,11 +209,10 @@ this._time = duration; } else if (this._time < 0) { this._time = 0; } } - if (this._easeType && !yoyoEase) { r = this._time / duration; type = this._easeType; pow = this._easePower; if (type === 1 || (type === 3 && r >= 0.5)) { @@ -700,11 +699,11 @@ for (i = 0; i !== l; b.push(a[i++])); return b; }, p = TimelineLite.prototype = new SimpleTimeline(); - TimelineLite.version = "1.20.3"; + TimelineLite.version = "1.20.4"; p.constructor = TimelineLite; p.kill()._gc = p._forcingPlayhead = p._hasPause = false; /* might use later... //translates a local time inside an animation to the corresponding time on the root/global timeline, factoring in all nesting and timeScales. @@ -1451,11 +1450,11 @@ _easeNone = new Ease(null, null, 1, 0), p = TimelineMax.prototype = new TimelineLite(); p.constructor = TimelineMax; p.kill()._gc = false; - TimelineMax.version = "1.20.3"; + TimelineMax.version = "1.20.4"; p.invalidate = function() { this._yoyo = (this.vars.yoyo === true); this._repeat = this.vars.repeat || 0; this._repeatDelay = this.vars.repeatDelay || 0; @@ -1489,23 +1488,23 @@ return this.removeCallback(TimelineLite._internals.pauseCallback, position); }; p.tweenTo = function(position, vars) { vars = vars || {}; - var copy = {ease:_easeNone, useFrames:this.usesFrames(), immediateRender:false}, + var copy = {ease:_easeNone, useFrames:this.usesFrames(), immediateRender:false, lazy:false}, Engine = (vars.repeat && _globals.TweenMax) || TweenLite, duration, p, t; for (p in vars) { copy[p] = vars[p]; } copy.time = this._parseTimeOrLabel(position); duration = (Math.abs(Number(copy.time) - this._time) / this._timeScale) || 0.001; t = new Engine(this, duration, copy); copy.onStart = function() { t.target.paused(true); - if (t.vars.time !== t.target.time() && duration === t.duration()) { //don't make the duration zero - if it's supposed to be zero, don't worry because it's already initting the tween and will complete immediately, effectively making the duration zero anyway. If we make duration zero, the tween won't run at all. - t.duration( Math.abs( t.vars.time - t.target.time()) / t.target._timeScale ); + if (t.vars.time !== t.target.time() && duration === t.duration() && !t.isFromTo) { //don't make the duration zero - if it's supposed to be zero, don't worry because it's already initting the tween and will complete immediately, effectively making the duration zero anyway. If we make duration zero, the tween won't run at all. + t.duration( Math.abs( t.vars.time - t.target.time()) / t.target._timeScale ).render(t.time(), true, true); //render() right away to ensure that things look right, especially in the case of .tweenTo(0). } if (vars.onStart) { //in case the user had an onStart in the vars - we don't want to overwrite it. vars.onStart.apply(vars.onStartScope || vars.callbackScope || t, vars.onStartParams || []); //don't use t._callback("onStart") or it'll point to the copy.onStart and we'll get a recursion error. } }; @@ -1516,10 +1515,11 @@ vars = vars || {}; fromPosition = this._parseTimeOrLabel(fromPosition); vars.startAt = {onComplete:this.seek, onCompleteParams:[fromPosition], callbackScope:this}; vars.immediateRender = (vars.immediateRender !== false); var t = this.tweenTo(toPosition, vars); + t.isFromTo = 1; //to ensure we don't mess with the duration in the onStart (we've got the start and end values here, so lock it in) return t.duration((Math.abs( t.vars.time - fromPosition) / this._timeScale) || 0.001); }; p.render = function(time, suppressEvents, force) { if (this._gc) { @@ -1946,12 +1946,12 @@ + - /* * ---------------------------------------------------------------- * BezierPlugin * ---------------------------------------------------------------- */ @@ -2581,11 +2581,11 @@ _overwriteProps, //alias to the currently instantiating CSSPlugin's _overwriteProps array. We use this closure in order to avoid having to pass a reference around from method to method and aid in minification. _specialProps = {}, p = CSSPlugin.prototype = new TweenPlugin("css"); p.constructor = CSSPlugin; - CSSPlugin.version = "1.20.3"; + CSSPlugin.version = "1.20.4"; CSSPlugin.API = 2; CSSPlugin.defaultTransformPerspective = 0; CSSPlugin.defaultSkewType = "compensated"; CSSPlugin.defaultSmoothOrigin = true; p = "px"; //we'll reuse the "p" variable to keep file size down @@ -3921,17 +3921,13 @@ s = style[_transformProp]; isDefault = 0; } m = e.getAttribute("transform"); if (isDefault && m) { - if (m.indexOf("matrix") !== -1) { //just in case there's a "transform" value specified as an attribute instead of CSS style. Accept either a matrix() or simple translate() value though. - s = m; - isDefault = 0; - } else if (m.indexOf("translate") !== -1) { - s = "matrix(1,0,0,1," + m.match(/(?:\-|\b)[\d\-\.e]+\b/gi).join(",") + ")"; - isDefault = 0; - } + m = e.transform.baseVal.consolidate().matrix; //ensures that even complex values like "translate(50,60) rotate(135,0,0)" are parsed because it mashes it into a matrix. + s = "matrix(" + m.a + "," + m.b + "," + m.c + "," + m.d + "," + m.e + "," + m.f + ")"; + isDefault = 0; } } if (isDefault) { return _identity2DMatrix; } @@ -5756,11 +5752,11 @@ this._p2 = linearRatio; this._p3 = this._p1 + this._p2; this._calcEnd = (yoyoMode === true); }, true), p = SlowMo.prototype = new Ease(), - SteppedEase, RoughEase, _createElastic; + SteppedEase, ExpoScaleEase, RoughEase, _createElastic; p.constructor = SlowMo; p.getRatio = function(p) { var r = p + (0.5 - p) * this._p; if (p < this._p1) { @@ -5796,11 +5792,30 @@ }; p.config = SteppedEase.config = function(steps, immediateStart) { return new SteppedEase(steps, immediateStart); }; + //ExpoScaleEase + ExpoScaleEase = _class("easing.ExpoScaleEase", function(start, end, ease) { + this._p1 = Math.log(end / start); + this._p2 = end - start; + this._p3 = start; + this._ease = ease; + }, true); + p = ExpoScaleEase.prototype = new Ease(); + p.constructor = ExpoScaleEase; + p.getRatio = function(p) { + if (this._ease) { + p = this._ease.getRatio(p); + } + return (this._p3 * Math.exp(this._p1 * p) - this._p3) / this._p2; + }; + p.config = ExpoScaleEase.config = function(start, end, ease) { + return new ExpoScaleEase(start, end, ease); + }; + //RoughEase RoughEase = _class("easing.RoughEase", function(vars) { vars = vars || {}; var taper = vars.taper || "none", a = [], @@ -6409,11 +6424,11 @@ }; _self.fps(fps); //a bug in iOS 6 Safari occasionally prevents the requestAnimationFrame from working initially, so we use a 1.5-second timeout that automatically falls back to setTimeout() if it senses this condition. setTimeout(function() { - if (_useRAF === "auto" && _self.frame < 5 && _doc.visibilityState !== "hidden") { + if (_useRAF === "auto" && _self.frame < 5 && (_doc || {}).visibilityState !== "hidden") { _self.useRAF(false); } }, 1500); }); @@ -6459,11 +6474,11 @@ p._paused = false; //some browsers (like iOS) occasionally drop the requestAnimationFrame event when the user switches to a different tab and then comes back again, so we use a 2-second setTimeout() to sense if/when that condition occurs and then wake() the ticker. var _checkTimeout = function() { - if (_tickerActive && _getTime() - _lastUpdate > 2000 && (_doc.visibilityState !== "hidden" || !_ticker.lagSmoothing())) { //note: if the tab is hidden, we should still wake if lagSmoothing has been disabled. + if (_tickerActive && _getTime() - _lastUpdate > 2000 && ((_doc || {}).visibilityState !== "hidden" || !_ticker.lagSmoothing())) { //note: if the tab is hidden, we should still wake if lagSmoothing has been disabled. _ticker.wake(); } var t = setTimeout(_checkTimeout, 2000); if (t.unref) { // allows a node process to exit even if the timeout’s callback hasn't been invoked. Without it, the node process could hang as this function is called every two seconds. @@ -6976,11 +6991,11 @@ p.ratio = 0; p._firstPT = p._targets = p._overwrittenProps = p._startAt = null; p._notifyPluginsOfEnabled = p._lazy = false; - TweenLite.version = "1.20.3"; + TweenLite.version = "1.20.4"; TweenLite.defaultEase = p._ease = new Ease(null, null, 1, 1); TweenLite.defaultOverwrite = "auto"; TweenLite.ticker = _ticker; TweenLite.autoSleep = 120; TweenLite.lagSmoothing = function(threshold, adjustedLag) { @@ -7095,10 +7110,10 @@ if (typeof(s) !== "number" || (typeof(end) !== "number" && !isRelative)) { if (funcParam || isNaN(s) || (!isRelative && isNaN(end)) || typeof(s) === "boolean" || typeof(end) === "boolean") { //a blob (string that has multiple numbers in it) pt.fp = funcParam; - blob = _blobDif(s, (isRelative ? parseFloat(pt.s) + pt.c : end), stringFilter || TweenLite.defaultStringFilter, pt); + blob = _blobDif(s, (isRelative ? (parseFloat(pt.s) + pt.c) + (pt.s + "").replace(/[0-9\-\.]/g, "") : end), stringFilter || TweenLite.defaultStringFilter, pt); pt = {t: blob, p: "setRatio", s: 0, c: 1, f: 2, pg: 0, n: overwriteProp || prop, pr: 0, m: 0}; //"2" indicates it's a Blob property tween. Needed for RoundPropsPlugin for example. } else { pt.s = parseFloat(s); if (!isRelative) { pt.c = (parseFloat(end) - pt.s) || 0; \ No newline at end of file