greensock-rails 1.17.0.0 → 1.18.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -3
- data/lib/greensock/rails/version.rb +1 -1
- data/vendor/assets/javascripts/greensock/TimelineLite.js +71 -41
- data/vendor/assets/javascripts/greensock/TimelineMax.js +112 -45
- data/vendor/assets/javascripts/greensock/TweenLite.js +130 -52
- data/vendor/assets/javascripts/greensock/TweenMax.js +436 -213
- data/vendor/assets/javascripts/greensock/jquery.gsap.js +5 -5
- data/vendor/assets/javascripts/greensock/plugins/AttrPlugin.js +5 -41
- data/vendor/assets/javascripts/greensock/plugins/CSSPlugin.js +146 -68
- data/vendor/assets/javascripts/greensock/plugins/ColorPropsPlugin.js +168 -70
- data/vendor/assets/javascripts/greensock/plugins/RoundPropsPlugin.js +28 -16
- data/vendor/assets/javascripts/greensock/utils/Draggable.js +42 -26
- metadata +3 -3
@@ -1,6 +1,6 @@
|
|
1
1
|
/*!
|
2
|
-
* VERSION: 1.
|
3
|
-
* DATE: 2015-
|
2
|
+
* VERSION: 1.18.0
|
3
|
+
* DATE: 2015-09-03
|
4
4
|
* UPDATES AND DOCS AT: http://greensock.com
|
5
5
|
*
|
6
6
|
* @license Copyright (c) 2008-2015, GreenSock. All rights reserved.
|
@@ -30,7 +30,7 @@
|
|
30
30
|
var b = [],
|
31
31
|
l = a.length,
|
32
32
|
i;
|
33
|
-
for (i = 0; i !== l; b.push(a[i++]))
|
33
|
+
for (i = 0; i !== l; b.push(a[i++])) {}
|
34
34
|
return b;
|
35
35
|
},
|
36
36
|
_emptyFunc = function() {},
|
@@ -86,7 +86,7 @@
|
|
86
86
|
this.check = function(init) {
|
87
87
|
var i = dependencies.length,
|
88
88
|
missing = i,
|
89
|
-
cur, a, n, cl;
|
89
|
+
cur, a, n, cl, hasModule;
|
90
90
|
while (--i > -1) {
|
91
91
|
if ((cur = _defLookup[dependencies[i]] || new Definition(dependencies[i], [])).gsClass) {
|
92
92
|
_classes[i] = cur.gsClass;
|
@@ -103,9 +103,10 @@
|
|
103
103
|
//exports to multiple environments
|
104
104
|
if (global) {
|
105
105
|
_globals[n] = cl; //provides a way to avoid global namespace pollution. By default, the main classes like TweenLite, Power1, Strong, etc. are added to window unless a GreenSockGlobals is defined. So if you want to have things added to a custom object instead, just do something like window.GreenSockGlobals = {} before loading any GreenSock files. You can even set up an alias like window.GreenSockGlobals = windows.gs = {} so that you can access everything like gs.TweenLite. Also remember that ALL classes are added to the window.com.greensock object (in their respective packages, like com.greensock.easing.Power1, com.greensock.TweenLite, etc.)
|
106
|
-
|
106
|
+
hasModule = (typeof(module) !== "undefined" && module.exports);
|
107
|
+
if (!hasModule && typeof(define) === "function" && define.amd){ //AMD
|
107
108
|
define((window.GreenSockAMDPath ? window.GreenSockAMDPath + "/" : "") + ns.split(".").pop(), [], function() { return cl; });
|
108
|
-
} else if (ns === moduleName &&
|
109
|
+
} else if (ns === moduleName && hasModule){ //node
|
109
110
|
module.exports = cl;
|
110
111
|
}
|
111
112
|
}
|
@@ -640,6 +641,9 @@
|
|
640
641
|
this._enabled(true, false);
|
641
642
|
}
|
642
643
|
if (this._totalTime !== time || this._duration === 0) {
|
644
|
+
if (_lazyTweens.length) {
|
645
|
+
_lazyRender();
|
646
|
+
}
|
643
647
|
this.render(time, suppressEvents, false);
|
644
648
|
if (_lazyTweens.length) { //in case rendering caused any tweens to lazy-init, we should render them because typically when someone calls seek() or time() or progress(), they expect an immediate render.
|
645
649
|
_lazyRender();
|
@@ -650,7 +654,8 @@
|
|
650
654
|
};
|
651
655
|
|
652
656
|
p.progress = p.totalProgress = function(value, suppressEvents) {
|
653
|
-
|
657
|
+
var duration = this.duration();
|
658
|
+
return (!arguments.length) ? (duration ? this._time / duration : this.ratio) : this.totalTime(duration * value, suppressEvents);
|
654
659
|
};
|
655
660
|
|
656
661
|
p.startTime = function(value) {
|
@@ -715,7 +720,8 @@
|
|
715
720
|
this._paused = value;
|
716
721
|
this._active = this.isActive();
|
717
722
|
if (!value && elapsed !== 0 && this._initted && this.duration()) {
|
718
|
-
|
723
|
+
raw = tl.smoothChildTiming ? this._totalTime : (raw - this._startTime) / this._timeScale;
|
724
|
+
this.render(raw, (raw === this._totalTime), true); //in case the target's properties changed via some other tween or manual update by the user, we should force a render.
|
719
725
|
}
|
720
726
|
}
|
721
727
|
if (this._gc && !value) {
|
@@ -917,7 +923,7 @@
|
|
917
923
|
p._firstPT = p._targets = p._overwrittenProps = p._startAt = null;
|
918
924
|
p._notifyPluginsOfEnabled = p._lazy = false;
|
919
925
|
|
920
|
-
TweenLite.version = "1.
|
926
|
+
TweenLite.version = "1.18.0";
|
921
927
|
TweenLite.defaultEase = p._ease = new Ease(null, null, 1, 1);
|
922
928
|
TweenLite.defaultOverwrite = "auto";
|
923
929
|
TweenLite.ticker = _ticker;
|
@@ -937,11 +943,116 @@
|
|
937
943
|
|
938
944
|
var _lazyTweens = [],
|
939
945
|
_lazyLookup = {},
|
940
|
-
|
946
|
+
_numbersExp = /(?:(-|-=|\+=)?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/ig,
|
947
|
+
//_nonNumbersExp = /(?:([\-+](?!(\d|=)))|[^\d\-+=e]|(e(?![\-+][\d])))+/ig,
|
948
|
+
_setRatio = function(v) {
|
949
|
+
var pt = this._firstPT,
|
950
|
+
min = 0.000001,
|
951
|
+
val;
|
952
|
+
while (pt) {
|
953
|
+
val = !pt.blob ? pt.c * v + pt.s : v ? this.join("") : this.start;
|
954
|
+
if (pt.r) {
|
955
|
+
val = Math.round(val);
|
956
|
+
} else if (val < min) if (val > -min) { //prevents issues with converting very small numbers to strings in the browser
|
957
|
+
val = 0;
|
958
|
+
}
|
959
|
+
if (!pt.f) {
|
960
|
+
pt.t[pt.p] = val;
|
961
|
+
} else if (pt.fp) {
|
962
|
+
pt.t[pt.p](pt.fp, val);
|
963
|
+
} else {
|
964
|
+
pt.t[pt.p](val);
|
965
|
+
}
|
966
|
+
pt = pt._next;
|
967
|
+
}
|
968
|
+
},
|
969
|
+
//compares two strings (start/end), finds the numbers that are different and spits back an array representing the whole value but with the changing values isolated as elements. For example, "rgb(0,0,0)" and "rgb(100,50,0)" would become ["rgb(", 0, ",", 50, ",0)"]. Notice it merges the parts that are identical (performance optimization). The array also has a linked list of PropTweens attached starting with _firstPT that contain the tweening data (t, p, s, c, f, etc.). It also stores the starting value as a "start" property so that we can revert to it if/when necessary, like when a tween rewinds fully. If the quantity of numbers differs between the start and end, it will always prioritize the end value(s). The pt parameter is optional - it's for a PropTween that will be appended to the end of the linked list and is typically for actually setting the value after all of the elements have been updated (with array.join("")).
|
970
|
+
_blobDif = function(start, end, filter, pt) {
|
971
|
+
var a = [start, end],
|
972
|
+
charIndex = 0,
|
973
|
+
s = "",
|
974
|
+
color = 0,
|
975
|
+
startNums, endNums, num, i, l, nonNumbers, currentNum;
|
976
|
+
a.start = start;
|
977
|
+
if (filter) {
|
978
|
+
filter(a); //pass an array with the starting and ending values and let the filter do whatever it needs to the values.
|
979
|
+
start = a[0];
|
980
|
+
end = a[1];
|
981
|
+
}
|
982
|
+
a.length = 0;
|
983
|
+
startNums = start.match(_numbersExp) || [];
|
984
|
+
endNums = end.match(_numbersExp) || [];
|
985
|
+
if (pt) {
|
986
|
+
pt._next = null;
|
987
|
+
pt.blob = 1;
|
988
|
+
a._firstPT = pt; //apply last in the linked list (which means inserting it first)
|
989
|
+
}
|
990
|
+
l = endNums.length;
|
991
|
+
for (i = 0; i < l; i++) {
|
992
|
+
currentNum = endNums[i];
|
993
|
+
nonNumbers = end.substr(charIndex, end.indexOf(currentNum, charIndex)-charIndex);
|
994
|
+
s += (nonNumbers || !i) ? nonNumbers : ","; //note: SVG spec allows omission of comma/space when a negative sign is wedged between two numbers, like 2.5-5.3 instead of 2.5,-5.3 but when tweening, the negative value may switch to positive, so we insert the comma just in case.
|
995
|
+
charIndex += nonNumbers.length;
|
996
|
+
if (color) { //sense rgba() values and round them.
|
997
|
+
color = (color + 1) % 5;
|
998
|
+
} else if (nonNumbers.substr(-5) === "rgba(") {
|
999
|
+
color = 1;
|
1000
|
+
}
|
1001
|
+
if (currentNum === startNums[i] || startNums.length <= i) {
|
1002
|
+
s += currentNum;
|
1003
|
+
} else {
|
1004
|
+
if (s) {
|
1005
|
+
a.push(s);
|
1006
|
+
s = "";
|
1007
|
+
}
|
1008
|
+
num = parseFloat(startNums[i]);
|
1009
|
+
a.push(num);
|
1010
|
+
a._firstPT = {_next: a._firstPT, t:a, p: a.length-1, s:num, c:((currentNum.charAt(1) === "=") ? parseInt(currentNum.charAt(0) + "1", 10) * parseFloat(currentNum.substr(2)) : (parseFloat(currentNum) - num)) || 0, f:0, r:(color && color < 4)};
|
1011
|
+
//note: we don't set _prev because we'll never need to remove individual PropTweens from this list.
|
1012
|
+
}
|
1013
|
+
charIndex += currentNum.length;
|
1014
|
+
}
|
1015
|
+
s += end.substr(charIndex);
|
1016
|
+
if (s) {
|
1017
|
+
a.push(s);
|
1018
|
+
}
|
1019
|
+
a.setRatio = _setRatio;
|
1020
|
+
return a;
|
1021
|
+
},
|
1022
|
+
//note: "funcParam" is only necessary for function-based getters/setters that require an extra parameter like getAttribute("width") and setAttribute("width", value). In this example, funcParam would be "width". Used by AttrPlugin for example.
|
1023
|
+
_addPropTween = function(target, prop, start, end, overwriteProp, round, funcParam, stringFilter) {
|
1024
|
+
var s = (start === "get") ? target[prop] : start,
|
1025
|
+
type = typeof(target[prop]),
|
1026
|
+
isRelative = (typeof(end) === "string" && end.charAt(1) === "="),
|
1027
|
+
pt = {t:target, p:prop, s:s, f:(type === "function"), pg:0, n:overwriteProp || prop, r:round, pr:0, c:isRelative ? parseInt(end.charAt(0) + "1", 10) * parseFloat(end.substr(2)) : (parseFloat(end) - s) || 0},
|
1028
|
+
blob, getterName;
|
1029
|
+
if (type !== "number") {
|
1030
|
+
if (type === "function" && start === "get") {
|
1031
|
+
getterName = ((prop.indexOf("set") || typeof(target["get" + prop.substr(3)]) !== "function") ? prop : "get" + prop.substr(3));
|
1032
|
+
pt.s = s = funcParam ? target[getterName](funcParam) : target[getterName]();
|
1033
|
+
}
|
1034
|
+
if (typeof(s) === "string" && (funcParam || isNaN(s))) {
|
1035
|
+
//a blob (string that has multiple numbers in it)
|
1036
|
+
pt.fp = funcParam;
|
1037
|
+
blob = _blobDif(s, end, stringFilter || TweenLite.defaultStringFilter, pt);
|
1038
|
+
pt = {t:blob, p:"setRatio", s:0, c:1, f:2, pg:0, n:overwriteProp || prop, pr:0}; //"2" indicates it's a Blob property tween. Needed for RoundPropsPlugin for example.
|
1039
|
+
} else if (!isRelative) {
|
1040
|
+
pt.c = (parseFloat(end) - parseFloat(s)) || 0;
|
1041
|
+
}
|
1042
|
+
}
|
1043
|
+
if (pt.c) { //only add it to the linked list if there's a change.
|
1044
|
+
if ((pt._next = this._firstPT)) {
|
1045
|
+
pt._next._prev = pt;
|
1046
|
+
}
|
1047
|
+
this._firstPT = pt;
|
1048
|
+
return pt;
|
1049
|
+
}
|
1050
|
+
},
|
1051
|
+
_internals = TweenLite._internals = {isArray:_isArray, isSelector:_isSelector, lazyTweens:_lazyTweens, blobDif:_blobDif}, //gives us a way to expose certain private values to other GreenSock classes without contaminating tha main TweenLite object.
|
941
1052
|
_plugins = TweenLite._plugins = {},
|
942
1053
|
_tweenLookup = _internals.tweenLookup = {},
|
943
1054
|
_tweenLookupNum = 0,
|
944
|
-
_reservedProps = _internals.reservedProps = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, onCompleteScope:1, useFrames:1, runBackwards:1, startAt:1, onUpdate:1, onUpdateParams:1, onUpdateScope:1, onStart:1, onStartParams:1, onStartScope:1, onReverseComplete:1, onReverseCompleteParams:1, onReverseCompleteScope:1, onRepeat:1, onRepeatParams:1, onRepeatScope:1, easeParams:1, yoyo:1, immediateRender:1, repeat:1, repeatDelay:1, data:1, paused:1, reversed:1, autoCSS:1, lazy:1, onOverwrite:1, callbackScope:1},
|
1055
|
+
_reservedProps = _internals.reservedProps = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, onCompleteScope:1, useFrames:1, runBackwards:1, startAt:1, onUpdate:1, onUpdateParams:1, onUpdateScope:1, onStart:1, onStartParams:1, onStartScope:1, onReverseComplete:1, onReverseCompleteParams:1, onReverseCompleteScope:1, onRepeat:1, onRepeatParams:1, onRepeatScope:1, easeParams:1, yoyo:1, immediateRender:1, repeat:1, repeatDelay:1, data:1, paused:1, reversed:1, autoCSS:1, lazy:1, onOverwrite:1, callbackScope:1, stringFilter:1},
|
945
1056
|
_overwriteLookup = {none:0, all:1, auto:2, concurrent:3, allOnStart:4, preexisting:5, "true":1, "false":0},
|
946
1057
|
_rootFramesTimeline = Animation._rootFramesTimeline = new SimpleTimeline(),
|
947
1058
|
_rootTimeline = Animation._rootTimeline = new SimpleTimeline(),
|
@@ -1022,7 +1133,6 @@
|
|
1022
1133
|
}
|
1023
1134
|
return _tweenLookup[id].tweens;
|
1024
1135
|
},
|
1025
|
-
|
1026
1136
|
_onOverwrite = function(overwrittenTween, overwritingTween, target, killedProps) {
|
1027
1137
|
var func = overwrittenTween.vars.onOverwrite, r1, r2;
|
1028
1138
|
if (func) {
|
@@ -1088,7 +1198,6 @@
|
|
1088
1198
|
}
|
1089
1199
|
return changed;
|
1090
1200
|
},
|
1091
|
-
|
1092
1201
|
_checkOverlap = function(tween, reference, zeroDur) {
|
1093
1202
|
var tl = tween._timeline,
|
1094
1203
|
ts = tl._timeScale,
|
@@ -1235,7 +1344,7 @@
|
|
1235
1344
|
//n - name [string]
|
1236
1345
|
//pg - isPlugin [boolean]
|
1237
1346
|
//pr - priority [number]
|
1238
|
-
this._firstPT = pt = {_next:this._firstPT, t:plugin, p:"setRatio", s:0, c:1, f:
|
1347
|
+
this._firstPT = pt = {_next:this._firstPT, t:plugin, p:"setRatio", s:0, c:1, f:1, n:p, pg:1, pr:plugin._priority};
|
1239
1348
|
i = plugin._overwriteProps.length;
|
1240
1349
|
while (--i > -1) {
|
1241
1350
|
propLookup[plugin._overwriteProps[i]] = this._firstPT;
|
@@ -1246,14 +1355,12 @@
|
|
1246
1355
|
if (plugin._onDisable || plugin._onEnable) {
|
1247
1356
|
this._notifyPluginsOfEnabled = true;
|
1248
1357
|
}
|
1358
|
+
if (pt._next) {
|
1359
|
+
pt._next._prev = pt;
|
1360
|
+
}
|
1249
1361
|
|
1250
1362
|
} else {
|
1251
|
-
|
1252
|
-
pt.s = (!pt.f) ? parseFloat(target[p]) : target[ ((p.indexOf("set") || typeof(target["get" + p.substr(3)]) !== "function") ? p : "get" + p.substr(3)) ]();
|
1253
|
-
pt.c = (typeof(v) === "string" && v.charAt(1) === "=") ? parseInt(v.charAt(0) + "1", 10) * Number(v.substr(2)) : (Number(v) - pt.s) || 0;
|
1254
|
-
}
|
1255
|
-
if (pt) if (pt._next) {
|
1256
|
-
pt._next._prev = pt;
|
1363
|
+
propLookup[p] = _addPropTween.call(this, target, p, "get", v, p, 0, null, this.vars.stringFilter);
|
1257
1364
|
}
|
1258
1365
|
}
|
1259
1366
|
|
@@ -1642,40 +1749,11 @@
|
|
1642
1749
|
}, true);
|
1643
1750
|
|
1644
1751
|
p = TweenPlugin.prototype;
|
1645
|
-
TweenPlugin.version = "1.
|
1752
|
+
TweenPlugin.version = "1.18.0";
|
1646
1753
|
TweenPlugin.API = 2;
|
1647
1754
|
p._firstPT = null;
|
1648
|
-
|
1649
|
-
p.
|
1650
|
-
var c, pt;
|
1651
|
-
if (end != null && (c = (typeof(end) === "number" || end.charAt(1) !== "=") ? Number(end) - Number(start) : parseInt(end.charAt(0) + "1", 10) * Number(end.substr(2)))) {
|
1652
|
-
this._firstPT = pt = {_next:this._firstPT, t:target, p:prop, s:start, c:c, f:(typeof(target[prop]) === "function"), n:overwriteProp || prop, r:round};
|
1653
|
-
if (pt._next) {
|
1654
|
-
pt._next._prev = pt;
|
1655
|
-
}
|
1656
|
-
return pt;
|
1657
|
-
}
|
1658
|
-
};
|
1659
|
-
|
1660
|
-
p.setRatio = function(v) {
|
1661
|
-
var pt = this._firstPT,
|
1662
|
-
min = 0.000001,
|
1663
|
-
val;
|
1664
|
-
while (pt) {
|
1665
|
-
val = pt.c * v + pt.s;
|
1666
|
-
if (pt.r) {
|
1667
|
-
val = Math.round(val);
|
1668
|
-
} else if (val < min) if (val > -min) { //prevents issues with converting very small numbers to strings in the browser
|
1669
|
-
val = 0;
|
1670
|
-
}
|
1671
|
-
if (pt.f) {
|
1672
|
-
pt.t[pt.p](val);
|
1673
|
-
} else {
|
1674
|
-
pt.t[pt.p] = val;
|
1675
|
-
}
|
1676
|
-
pt = pt._next;
|
1677
|
-
}
|
1678
|
-
};
|
1755
|
+
p._addTween = _addPropTween;
|
1756
|
+
p.setRatio = _setRatio;
|
1679
1757
|
|
1680
1758
|
p._kill = function(lookup) {
|
1681
1759
|
var a = this._overwriteProps,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*!
|
2
|
-
* VERSION: 1.
|
3
|
-
* DATE: 2015-05
|
2
|
+
* VERSION: 1.18.0
|
3
|
+
* DATE: 2015-09-05
|
4
4
|
* UPDATES AND DOCS AT: http://greensock.com
|
5
5
|
*
|
6
6
|
* Includes all of the following: TweenLite, TweenMax, TimelineLite, TimelineMax, EasePack, CSSPlugin, RoundPropsPlugin, BezierPlugin, AttrPlugin, DirectionalRotationPlugin
|
@@ -25,6 +25,15 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
25
25
|
for (i = 0; i !== l; b.push(a[i++]));
|
26
26
|
return b;
|
27
27
|
},
|
28
|
+
_applyCycle = function(vars, targets, i) {
|
29
|
+
var alt = vars.cycle,
|
30
|
+
p, val;
|
31
|
+
for (p in alt) {
|
32
|
+
val = alt[p];
|
33
|
+
vars[p] = (typeof(val) === "function") ? val.call(targets[i], i) : val[i % val.length];
|
34
|
+
}
|
35
|
+
delete vars.cycle;
|
36
|
+
},
|
28
37
|
TweenMax = function(target, duration, vars) {
|
29
38
|
TweenLite.call(this, target, duration, vars);
|
30
39
|
this._cycle = 0;
|
@@ -41,7 +50,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
41
50
|
p = TweenMax.prototype = TweenLite.to({}, 0.1, {}),
|
42
51
|
_blankArray = [];
|
43
52
|
|
44
|
-
TweenMax.version = "1.
|
53
|
+
TweenMax.version = "1.18.0";
|
45
54
|
p.constructor = TweenMax;
|
46
55
|
p.kill()._gc = false;
|
47
56
|
TweenMax.killTweensOf = TweenMax.killDelayedCallsTo = TweenLite.killTweensOf;
|
@@ -340,6 +349,8 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
340
349
|
}
|
341
350
|
onCompleteAll.apply(onCompleteAllScope || vars.callbackScope || this, onCompleteAllParams || _blankArray);
|
342
351
|
},
|
352
|
+
cycle = vars.cycle,
|
353
|
+
fromCycle = (vars.startAt && vars.startAt.cycle),
|
343
354
|
l, copy, i, p;
|
344
355
|
if (!_isArray(targets)) {
|
345
356
|
if (typeof(targets) === "string") {
|
@@ -361,6 +372,16 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
361
372
|
for (p in vars) {
|
362
373
|
copy[p] = vars[p];
|
363
374
|
}
|
375
|
+
if (cycle) {
|
376
|
+
_applyCycle(copy, targets, i);
|
377
|
+
}
|
378
|
+
if (fromCycle) {
|
379
|
+
fromCycle = copy.startAt = {};
|
380
|
+
for (p in vars.startAt) {
|
381
|
+
fromCycle[p] = vars.startAt[p];
|
382
|
+
}
|
383
|
+
_applyCycle(copy.startAt, targets, i);
|
384
|
+
}
|
364
385
|
copy.delay = delay;
|
365
386
|
if (i === l && onCompleteAll) {
|
366
387
|
copy.onComplete = finalComplete;
|
@@ -634,7 +655,6 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
634
655
|
_isArray = TweenLiteInternals.isArray,
|
635
656
|
_lazyTweens = TweenLiteInternals.lazyTweens,
|
636
657
|
_lazyRender = TweenLiteInternals.lazyRender,
|
637
|
-
_blankArray = [],
|
638
658
|
_globals = _gsScope._gsDefine.globals,
|
639
659
|
_copy = function(vars) {
|
640
660
|
var copy = {}, p;
|
@@ -643,35 +663,16 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
643
663
|
}
|
644
664
|
return copy;
|
645
665
|
},
|
646
|
-
|
647
|
-
var
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
if (callback || !this._forcingPlayhead) { //if the user calls a method that moves the playhead (like progress() or time()), it should honor that and skip any pauses (although if there's a callback positioned at that pause, it must jump there and make the call to ensure the time is EXACTLY what it is supposed to be, and then proceed to where the playhead is being forced). Otherwise, imagine placing a pause in the middle of a timeline and then doing timeline.progress(0.9) - it would get stuck where the pause is.
|
655
|
-
tl.pause(startTime);
|
656
|
-
//now find sibling tweens that are EXACTLY at the same spot on the timeline and adjust the _rawPrevTime so that they fire (or don't fire) correctly on the next render. This is primarily to accommodate zero-duration tweens/callbacks that are positioned right on top of a pause. For example, tl.to(...).call(...).addPause(...).call(...) - notice that there's a call() on each side of the pause, so when it's running forward it should call the first one and then pause, and then when resumed, call the other. Zero-duration tweens use _rawPrevTime to sense momentum figure out if events were suppressed when arriving directly on top of that time.
|
657
|
-
sibling = tween._prev;
|
658
|
-
while (sibling && sibling._startTime === startTime) {
|
659
|
-
sibling._rawPrevTime = prev;
|
660
|
-
sibling = sibling._prev;
|
661
|
-
}
|
662
|
-
sibling = tween._next;
|
663
|
-
while (sibling && sibling._startTime === startTime) {
|
664
|
-
sibling._rawPrevTime = next;
|
665
|
-
sibling = sibling._next;
|
666
|
-
}
|
667
|
-
if (callback) {
|
668
|
-
callback.apply(scope || tl.vars.callbackScope || tl, params || _blankArray);
|
669
|
-
}
|
670
|
-
if (this._forcingPlayhead || !tl._paused) { //the callback could have called resume().
|
671
|
-
tl.seek(time);
|
672
|
-
}
|
673
|
-
}
|
666
|
+
_applyCycle = function(vars, targets, i) {
|
667
|
+
var alt = vars.cycle,
|
668
|
+
p, val;
|
669
|
+
for (p in alt) {
|
670
|
+
val = alt[p];
|
671
|
+
vars[p] = (typeof(val) === "function") ? val.call(targets[i], i) : val[i % val.length];
|
672
|
+
}
|
673
|
+
delete vars.cycle;
|
674
674
|
},
|
675
|
+
_pauseCallback = _internals.pauseCallback = function() {},
|
675
676
|
_slice = function(a) { //don't use [].slice because that doesn't work in IE8 with a NodeList that's returned by querySelectorAll()
|
676
677
|
var b = [],
|
677
678
|
l = a.length,
|
@@ -681,9 +682,9 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
681
682
|
},
|
682
683
|
p = TimelineLite.prototype = new SimpleTimeline();
|
683
684
|
|
684
|
-
TimelineLite.version = "1.
|
685
|
+
TimelineLite.version = "1.18.0";
|
685
686
|
p.constructor = TimelineLite;
|
686
|
-
p.kill()._gc = p._forcingPlayhead = false;
|
687
|
+
p.kill()._gc = p._forcingPlayhead = p._hasPause = false;
|
687
688
|
|
688
689
|
/* might use later...
|
689
690
|
//translates a local time inside an animation to the corresponding time on the root/global timeline, factoring in all nesting and timeScales.
|
@@ -723,7 +724,8 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
723
724
|
|
724
725
|
p.staggerTo = function(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope) {
|
725
726
|
var tl = new TimelineLite({onComplete:onCompleteAll, onCompleteParams:onCompleteAllParams, callbackScope:onCompleteAllScope, smoothChildTiming:this.smoothChildTiming}),
|
726
|
-
|
727
|
+
cycle = vars.cycle,
|
728
|
+
copy, i;
|
727
729
|
if (typeof(targets) === "string") {
|
728
730
|
targets = TweenLite.selector(targets) || targets;
|
729
731
|
}
|
@@ -738,10 +740,17 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
738
740
|
stagger *= -1;
|
739
741
|
}
|
740
742
|
for (i = 0; i < targets.length; i++) {
|
741
|
-
|
742
|
-
|
743
|
+
copy = _copy(vars);
|
744
|
+
if (copy.startAt) {
|
745
|
+
copy.startAt = _copy(copy.startAt);
|
746
|
+
if (copy.startAt.cycle) {
|
747
|
+
_applyCycle(copy.startAt, targets, i);
|
748
|
+
}
|
749
|
+
}
|
750
|
+
if (cycle) {
|
751
|
+
_applyCycle(copy, targets, i);
|
743
752
|
}
|
744
|
-
tl.to(targets[i], duration,
|
753
|
+
tl.to(targets[i], duration, copy, i * stagger);
|
745
754
|
}
|
746
755
|
return this.add(tl, position);
|
747
756
|
};
|
@@ -853,7 +862,10 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
853
862
|
|
854
863
|
p.remove = function(value) {
|
855
864
|
if (value instanceof Animation) {
|
856
|
-
|
865
|
+
this._remove(value, false);
|
866
|
+
var tl = value._timeline = value.vars.useFrames ? Animation._rootFramesTimeline : Animation._rootTimeline; //now that it's removed, default it to the root timeline so that if it gets played again, it doesn't jump back into this timeline.
|
867
|
+
value._startTime = (value._paused ? value._pauseTime : tl._time) - ((!value._reversed ? value._totalTime : value.totalDuration() - value._totalTime) / value._timeScale); //ensure that if it gets played again, the timing is correct.
|
868
|
+
return this;
|
857
869
|
} else if (value instanceof Array || (value && value.push && _isArray(value))) {
|
858
870
|
var i = value.length;
|
859
871
|
while (--i > -1) {
|
@@ -896,8 +908,10 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
896
908
|
};
|
897
909
|
|
898
910
|
p.addPause = function(position, callback, params, scope) {
|
899
|
-
var t = TweenLite.delayedCall(0, _pauseCallback,
|
900
|
-
t.
|
911
|
+
var t = TweenLite.delayedCall(0, _pauseCallback, params, scope || this);
|
912
|
+
t.vars.onComplete = t.vars.onReverseComplete = callback;
|
913
|
+
t.data = "isPause";
|
914
|
+
this._hasPause = true;
|
901
915
|
return this.add(t, position);
|
902
916
|
};
|
903
917
|
|
@@ -968,7 +982,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
968
982
|
prevStart = this._startTime,
|
969
983
|
prevTimeScale = this._timeScale,
|
970
984
|
prevPaused = this._paused,
|
971
|
-
tween, isComplete, next, callback, internalForce;
|
985
|
+
tween, isComplete, next, callback, internalForce, pauseTween;
|
972
986
|
if (time >= totalDur) {
|
973
987
|
this._totalTime = this._time = totalDur;
|
974
988
|
if (!this._reversed) if (!this._hasPausedChild()) {
|
@@ -1018,9 +1032,34 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
1018
1032
|
}
|
1019
1033
|
|
1020
1034
|
} else {
|
1035
|
+
|
1036
|
+
if (this._hasPause && !this._forcingPlayhead && !suppressEvents) {
|
1037
|
+
if (time >= prevTime) {
|
1038
|
+
tween = this._first;
|
1039
|
+
while (tween && tween._startTime <= time && !pauseTween) {
|
1040
|
+
if (!tween._duration) if (tween.data === "isPause" && !tween.ratio && !(tween._startTime === 0 && this._rawPrevTime === 0)) {
|
1041
|
+
pauseTween = tween;
|
1042
|
+
}
|
1043
|
+
tween = tween._next;
|
1044
|
+
}
|
1045
|
+
} else {
|
1046
|
+
tween = this._last;
|
1047
|
+
while (tween && tween._startTime >= time && !pauseTween) {
|
1048
|
+
if (!tween._duration) if (tween.data === "isPause" && tween._rawPrevTime > 0) {
|
1049
|
+
pauseTween = tween;
|
1050
|
+
}
|
1051
|
+
tween = tween._prev;
|
1052
|
+
}
|
1053
|
+
}
|
1054
|
+
if (pauseTween) {
|
1055
|
+
this._time = time = pauseTween._startTime;
|
1056
|
+
this._totalTime = time + (this._cycle * (this._totalDuration + this._repeatDelay));
|
1057
|
+
}
|
1058
|
+
}
|
1059
|
+
|
1021
1060
|
this._totalTime = this._time = this._rawPrevTime = time;
|
1022
1061
|
}
|
1023
|
-
if ((this._time === prevTime || !this._first) && !force && !internalForce) {
|
1062
|
+
if ((this._time === prevTime || !this._first) && !force && !internalForce && !pauseTween) {
|
1024
1063
|
return;
|
1025
1064
|
} else if (!this._initted) {
|
1026
1065
|
this._initted = true;
|
@@ -1041,6 +1080,9 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
1041
1080
|
if (this._paused && !prevPaused) { //in case a tween pauses the timeline when rendering
|
1042
1081
|
break;
|
1043
1082
|
} else if (tween._active || (tween._startTime <= this._time && !tween._paused && !tween._gc)) {
|
1083
|
+
if (pauseTween === tween) {
|
1084
|
+
this.pause();
|
1085
|
+
}
|
1044
1086
|
if (!tween._reversed) {
|
1045
1087
|
tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force);
|
1046
1088
|
} else {
|
@@ -1056,6 +1098,15 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
1056
1098
|
if (this._paused && !prevPaused) { //in case a tween pauses the timeline when rendering
|
1057
1099
|
break;
|
1058
1100
|
} else if (tween._active || (tween._startTime <= prevTime && !tween._paused && !tween._gc)) {
|
1101
|
+
if (pauseTween === tween) {
|
1102
|
+
pauseTween = tween._prev; //the linked list is organized by _startTime, thus it's possible that a tween could start BEFORE the pause and end after it, in which case it would be positioned before the pause tween in the linked list, but we should render it before we pause() the timeline and cease rendering. This is only a concern when going in reverse.
|
1103
|
+
while (pauseTween && pauseTween.endTime() > this._time) {
|
1104
|
+
pauseTween.render( (pauseTween._reversed ? pauseTween.totalDuration() - ((time - pauseTween._startTime) * pauseTween._timeScale) : (time - pauseTween._startTime) * pauseTween._timeScale), suppressEvents, force);
|
1105
|
+
pauseTween = pauseTween._prev;
|
1106
|
+
}
|
1107
|
+
pauseTween = null;
|
1108
|
+
this.pause();
|
1109
|
+
}
|
1059
1110
|
if (!tween._reversed) {
|
1060
1111
|
tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force);
|
1061
1112
|
} else {
|
@@ -1359,7 +1410,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
1359
1410
|
|
1360
1411
|
p.constructor = TimelineMax;
|
1361
1412
|
p.kill()._gc = false;
|
1362
|
-
TimelineMax.version = "1.
|
1413
|
+
TimelineMax.version = "1.18.0";
|
1363
1414
|
|
1364
1415
|
p.invalidate = function() {
|
1365
1416
|
this._yoyo = (this.vars.yoyo === true);
|
@@ -1439,7 +1490,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
1439
1490
|
prevRawPrevTime = this._rawPrevTime,
|
1440
1491
|
prevPaused = this._paused,
|
1441
1492
|
prevCycle = this._cycle,
|
1442
|
-
tween, isComplete, next, callback, internalForce, cycleDuration;
|
1493
|
+
tween, isComplete, next, callback, internalForce, cycleDuration, pauseTween;
|
1443
1494
|
if (time >= totalDur) {
|
1444
1495
|
if (!this._locked) {
|
1445
1496
|
this._totalTime = totalDur;
|
@@ -1526,6 +1577,32 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
1526
1577
|
}
|
1527
1578
|
}
|
1528
1579
|
}
|
1580
|
+
|
1581
|
+
if (this._hasPause && !this._forcingPlayhead && !suppressEvents) {
|
1582
|
+
time = this._time;
|
1583
|
+
if (time >= prevTime) {
|
1584
|
+
tween = this._first;
|
1585
|
+
while (tween && tween._startTime <= time && !pauseTween) {
|
1586
|
+
if (!tween._duration) if (tween.data === "isPause" && !tween.ratio && !(tween._startTime === 0 && this._rawPrevTime === 0)) {
|
1587
|
+
pauseTween = tween;
|
1588
|
+
}
|
1589
|
+
tween = tween._next;
|
1590
|
+
}
|
1591
|
+
} else {
|
1592
|
+
tween = this._last;
|
1593
|
+
while (tween && tween._startTime >= time && !pauseTween) {
|
1594
|
+
if (!tween._duration) if (tween.data === "isPause" && tween._rawPrevTime > 0) {
|
1595
|
+
pauseTween = tween;
|
1596
|
+
}
|
1597
|
+
tween = tween._prev;
|
1598
|
+
}
|
1599
|
+
}
|
1600
|
+
if (pauseTween) {
|
1601
|
+
this._time = time = pauseTween._startTime;
|
1602
|
+
this._totalTime = time + (this._cycle * (this._totalDuration + this._repeatDelay));
|
1603
|
+
}
|
1604
|
+
}
|
1605
|
+
|
1529
1606
|
}
|
1530
1607
|
|
1531
1608
|
if (this._cycle !== prevCycle) if (!this._locked) {
|
@@ -1576,7 +1653,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
1576
1653
|
this._rawPrevTime = recRawPrevTime;
|
1577
1654
|
}
|
1578
1655
|
|
1579
|
-
if ((this._time === prevTime || !this._first) && !force && !internalForce) {
|
1656
|
+
if ((this._time === prevTime || !this._first) && !force && !internalForce && !pauseTween) {
|
1580
1657
|
if (prevTotalTime !== this._totalTime) if (this._onUpdate) if (!suppressEvents) { //so that onUpdate fires even during the repeatDelay - as long as the totalTime changed, we should trigger onUpdate.
|
1581
1658
|
this._callback("onUpdate");
|
1582
1659
|
}
|
@@ -1600,12 +1677,14 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
1600
1677
|
if (this._paused && !prevPaused) { //in case a tween pauses the timeline when rendering
|
1601
1678
|
break;
|
1602
1679
|
} else if (tween._active || (tween._startTime <= this._time && !tween._paused && !tween._gc)) {
|
1680
|
+
if (pauseTween === tween) {
|
1681
|
+
this.pause();
|
1682
|
+
}
|
1603
1683
|
if (!tween._reversed) {
|
1604
1684
|
tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force);
|
1605
1685
|
} else {
|
1606
1686
|
tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, force);
|
1607
1687
|
}
|
1608
|
-
|
1609
1688
|
}
|
1610
1689
|
tween = next;
|
1611
1690
|
}
|
@@ -1616,6 +1695,15 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
1616
1695
|
if (this._paused && !prevPaused) { //in case a tween pauses the timeline when rendering
|
1617
1696
|
break;
|
1618
1697
|
} else if (tween._active || (tween._startTime <= prevTime && !tween._paused && !tween._gc)) {
|
1698
|
+
if (pauseTween === tween) {
|
1699
|
+
pauseTween = tween._prev; //the linked list is organized by _startTime, thus it's possible that a tween could start BEFORE the pause and end after it, in which case it would be positioned before the pause tween in the linked list, but we should render it before we pause() the timeline and cease rendering. This is only a concern when going in reverse.
|
1700
|
+
while (pauseTween && pauseTween.endTime() > this._time) {
|
1701
|
+
pauseTween.render( (pauseTween._reversed ? pauseTween.totalDuration() - ((time - pauseTween._startTime) * pauseTween._timeScale) : (time - pauseTween._startTime) * pauseTween._timeScale), suppressEvents, force);
|
1702
|
+
pauseTween = pauseTween._prev;
|
1703
|
+
}
|
1704
|
+
pauseTween = null;
|
1705
|
+
this.pause();
|
1706
|
+
}
|
1619
1707
|
if (!tween._reversed) {
|
1620
1708
|
tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force);
|
1621
1709
|
} else {
|
@@ -2411,7 +2499,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
2411
2499
|
p = CSSPlugin.prototype = new TweenPlugin("css");
|
2412
2500
|
|
2413
2501
|
p.constructor = CSSPlugin;
|
2414
|
-
CSSPlugin.version = "1.
|
2502
|
+
CSSPlugin.version = "1.18.0";
|
2415
2503
|
CSSPlugin.API = 2;
|
2416
2504
|
CSSPlugin.defaultTransformPerspective = 0;
|
2417
2505
|
CSSPlugin.defaultSkewType = "compensated";
|
@@ -2554,7 +2642,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
2554
2642
|
pix = (v / 100) * (horiz ? t.clientWidth : t.clientHeight);
|
2555
2643
|
} else {
|
2556
2644
|
style.cssText = "border:0 solid red;position:" + _getStyle(t, "position") + ";line-height:0;";
|
2557
|
-
if (sfx === "%" || !node.appendChild) {
|
2645
|
+
if (sfx === "%" || !node.appendChild || sfx.charAt(0) === "v" || sfx === "rem") {
|
2558
2646
|
node = t.parentNode || _doc.body;
|
2559
2647
|
cache = node._gsCache;
|
2560
2648
|
time = TweenLite.ticker.frame;
|
@@ -2680,7 +2768,10 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
2680
2768
|
|
2681
2769
|
// @private Parses position-related complex strings like "top left" or "50px 10px" or "70% 20%", etc. which are used for things like transformOrigin or backgroundPosition. Optionally decorates a supplied object (recObj) with the following properties: "ox" (offsetX), "oy" (offsetY), "oxp" (if true, "ox" is a percentage not a pixel value), and "oxy" (if true, "oy" is a percentage not a pixel value)
|
2682
2770
|
_parsePosition = function(v, recObj) {
|
2683
|
-
if (v
|
2771
|
+
if (v === "contain" || v === "auto" || v === "auto auto") {
|
2772
|
+
return v + " ";
|
2773
|
+
}
|
2774
|
+
if (v == null || v === "") { //note: Firefox uses "auto auto" as default whereas Chrome uses "auto".
|
2684
2775
|
v = "0 0";
|
2685
2776
|
}
|
2686
2777
|
var a = v.split(" "),
|
@@ -2798,57 +2889,96 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
2798
2889
|
},
|
2799
2890
|
|
2800
2891
|
/**
|
2801
|
-
* @private Parses a color (like #9F0, #FF9900,
|
2892
|
+
* @private Parses a color (like #9F0, #FF9900, rgb(255,51,153) or hsl(108, 50%, 10%)) into an array with 3 elements for red, green, and blue or if toHSL parameter is true, it will populate the array with hue, saturation, and lightness values. If a relative value is found in an hsl() or hsla() string, it will preserve those relative prefixes and all the values in the array will be strings instead of numbers (in all other cases it will be populated with numbers).
|
2802
2893
|
* @param {(string|number)} v The value the should be parsed which could be a string like #9F0 or rgb(255,102,51) or rgba(255,0,0,0.5) or it could be a number like 0xFF00CC or even a named color like red, blue, purple, etc.
|
2803
|
-
* @
|
2894
|
+
* @param {(boolean)} toHSL If true, an hsl() or hsla() value will be returned instead of rgb() or rgba()
|
2895
|
+
* @return {Array.<number>} An array containing red, green, and blue (and optionally alpha) in that order, or if the toHSL parameter was true, the array will contain hue, saturation and lightness (and optionally alpha) in that order. Always numbers unless there's a relative prefix found in an hsl() or hsla() string and toHSL is true.
|
2804
2896
|
*/
|
2805
|
-
_parseColor = CSSPlugin.parseColor = function(v) {
|
2806
|
-
var
|
2807
|
-
if (!v
|
2808
|
-
|
2809
|
-
}
|
2810
|
-
|
2811
|
-
|
2812
|
-
|
2813
|
-
|
2814
|
-
|
2815
|
-
|
2816
|
-
|
2817
|
-
|
2818
|
-
|
2819
|
-
|
2820
|
-
|
2821
|
-
|
2822
|
-
|
2823
|
-
|
2824
|
-
v =
|
2825
|
-
|
2826
|
-
|
2827
|
-
|
2828
|
-
|
2829
|
-
|
2830
|
-
|
2831
|
-
|
2832
|
-
|
2833
|
-
|
2834
|
-
|
2835
|
-
|
2836
|
-
|
2837
|
-
|
2838
|
-
|
2839
|
-
|
2840
|
-
|
2841
|
-
|
2842
|
-
|
2843
|
-
|
2844
|
-
|
2845
|
-
|
2846
|
-
|
2847
|
-
|
2848
|
-
|
2849
|
-
|
2897
|
+
_parseColor = CSSPlugin.parseColor = function(v, toHSL) {
|
2898
|
+
var a, r, g, b, h, s, l, max, min, d, wasHSL;
|
2899
|
+
if (!v) {
|
2900
|
+
a = _colorLookup.black;
|
2901
|
+
} else if (typeof(v) === "number") {
|
2902
|
+
a = [v >> 16, (v >> 8) & 255, v & 255];
|
2903
|
+
} else {
|
2904
|
+
if (v.charAt(v.length - 1) === ",") { //sometimes a trailing comma is included and we should chop it off (typically from a comma-delimited list of values like a textShadow:"2px 2px 2px blue, 5px 5px 5px rgb(255,0,0)" - in this example "blue," has a trailing comma. We could strip it out inside parseComplex() but we'd need to do it to the beginning and ending values plus it wouldn't provide protection from other potential scenarios like if the user passes in a similar value.
|
2905
|
+
v = v.substr(0, v.length - 1);
|
2906
|
+
}
|
2907
|
+
if (_colorLookup[v]) {
|
2908
|
+
a = _colorLookup[v];
|
2909
|
+
} else if (v.charAt(0) === "#") {
|
2910
|
+
if (v.length === 4) { //for shorthand like #9F0
|
2911
|
+
r = v.charAt(1);
|
2912
|
+
g = v.charAt(2);
|
2913
|
+
b = v.charAt(3);
|
2914
|
+
v = "#" + r + r + g + g + b + b;
|
2915
|
+
}
|
2916
|
+
v = parseInt(v.substr(1), 16);
|
2917
|
+
a = [v >> 16, (v >> 8) & 255, v & 255];
|
2918
|
+
} else if (v.substr(0, 3) === "hsl") {
|
2919
|
+
a = wasHSL = v.match(_numExp);
|
2920
|
+
if (!toHSL) {
|
2921
|
+
h = (Number(a[0]) % 360) / 360;
|
2922
|
+
s = Number(a[1]) / 100;
|
2923
|
+
l = Number(a[2]) / 100;
|
2924
|
+
g = (l <= 0.5) ? l * (s + 1) : l + s - l * s;
|
2925
|
+
r = l * 2 - g;
|
2926
|
+
if (a.length > 3) {
|
2927
|
+
a[3] = Number(v[3]);
|
2928
|
+
}
|
2929
|
+
a[0] = _hue(h + 1 / 3, r, g);
|
2930
|
+
a[1] = _hue(h, r, g);
|
2931
|
+
a[2] = _hue(h - 1 / 3, r, g);
|
2932
|
+
} else if (v.indexOf("=") !== -1) { //if relative values are found, just return the raw strings with the relative prefixes in place.
|
2933
|
+
return v.match(_relNumExp);
|
2934
|
+
}
|
2935
|
+
} else {
|
2936
|
+
a = v.match(_numExp) || _colorLookup.transparent;
|
2937
|
+
}
|
2938
|
+
a[0] = Number(a[0]);
|
2939
|
+
a[1] = Number(a[1]);
|
2940
|
+
a[2] = Number(a[2]);
|
2941
|
+
if (a.length > 3) {
|
2942
|
+
a[3] = Number(a[3]);
|
2943
|
+
}
|
2944
|
+
}
|
2945
|
+
if (toHSL && !wasHSL) {
|
2946
|
+
r = a[0] / 255;
|
2947
|
+
g = a[1] / 255;
|
2948
|
+
b = a[2] / 255;
|
2949
|
+
max = Math.max(r, g, b);
|
2950
|
+
min = Math.min(r, g, b);
|
2951
|
+
l = (max + min) / 2;
|
2952
|
+
if (max === min) {
|
2953
|
+
h = s = 0;
|
2954
|
+
} else {
|
2955
|
+
d = max - min;
|
2956
|
+
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
|
2957
|
+
h = (max === r) ? (g - b) / d + (g < b ? 6 : 0) : (max === g) ? (b - r) / d + 2 : (r - g) / d + 4;
|
2958
|
+
h *= 60;
|
2959
|
+
}
|
2960
|
+
a[0] = (h + 0.5) | 0;
|
2961
|
+
a[1] = (s * 100 + 0.5) | 0;
|
2962
|
+
a[2] = (l * 100 + 0.5) | 0;
|
2850
2963
|
}
|
2851
|
-
return
|
2964
|
+
return a;
|
2965
|
+
},
|
2966
|
+
_formatColors = function(s, toHSL) {
|
2967
|
+
var colors = s.match(_colorExp) || [],
|
2968
|
+
charIndex = 0,
|
2969
|
+
parsed = colors.length ? "" : s,
|
2970
|
+
i, color, temp;
|
2971
|
+
for (i = 0; i < colors.length; i++) {
|
2972
|
+
color = colors[i];
|
2973
|
+
temp = s.substr(charIndex, s.indexOf(color, charIndex)-charIndex);
|
2974
|
+
charIndex += temp.length + color.length;
|
2975
|
+
color = _parseColor(color, toHSL);
|
2976
|
+
if (color.length === 3) {
|
2977
|
+
color.push(1);
|
2978
|
+
}
|
2979
|
+
parsed += temp + (toHSL ? "hsla(" + color[0] + "," + color[1] + "%," + color[2] + "%," + color[3] : "rgba(" + color.join(",")) + ")";
|
2980
|
+
}
|
2981
|
+
return parsed;
|
2852
2982
|
},
|
2853
2983
|
_colorExp = "(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#.+?\\b"; //we'll dynamically build this Regular Expression to conserve file size. After building it, it will be able to find rgb(), rgba(), # (hexadecimal), and named color values like red, blue, purple, etc.
|
2854
2984
|
|
@@ -2857,6 +2987,21 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
2857
2987
|
}
|
2858
2988
|
_colorExp = new RegExp(_colorExp+")", "gi");
|
2859
2989
|
|
2990
|
+
CSSPlugin.colorStringFilter = function(a) {
|
2991
|
+
var combined = a[0] + a[1],
|
2992
|
+
toHSL;
|
2993
|
+
_colorExp.lastIndex = 0;
|
2994
|
+
if (_colorExp.test(combined)) {
|
2995
|
+
toHSL = (combined.indexOf("hsl(") !== -1 || combined.indexOf("hsla(") !== -1);
|
2996
|
+
a[0] = _formatColors(a[0], toHSL);
|
2997
|
+
a[1] = _formatColors(a[1], toHSL);
|
2998
|
+
}
|
2999
|
+
};
|
3000
|
+
|
3001
|
+
if (!TweenLite.defaultStringFilter) {
|
3002
|
+
TweenLite.defaultStringFilter = CSSPlugin.colorStringFilter;
|
3003
|
+
}
|
3004
|
+
|
2860
3005
|
/**
|
2861
3006
|
* @private Returns a formatter function that handles taking a string (or number in some cases) and returning a consistently formatted one in terms of delimiters, quantity of values, etc. For example, we may get boxShadow values defined as "0px red" or "0px 0px 10px rgb(255,0,0)" or "0px 0px 20px 20px #F00" and we need to ensure that what we get back is described with 4 numbers and a color. This allows us to feed it into the _parseComplex() method and split the values up appropriately. The neat thing about this _getFormatter() function is that the dflt defines a pattern as well as a default, so for example, _getFormatter("0px 0px 0px 0px #777", true) not only sets the default as 0px for all distances and #777 for the color, but also sets the pattern such that 4 numbers and a color will always get returned.
|
2862
3007
|
* @param {!string} dflt The default value and pattern to follow. So "0px 0px 0px 0px #777" will ensure that 4 numbers and a color will always get returned.
|
@@ -3146,7 +3291,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
3146
3291
|
ea = e.split(", ").join(",").split(" "), //ending array
|
3147
3292
|
l = ba.length,
|
3148
3293
|
autoRound = (_autoRound !== false),
|
3149
|
-
i, xi, ni, bv, ev, bnums, enums, bn,
|
3294
|
+
i, xi, ni, bv, ev, bnums, enums, bn, hasAlpha, temp, cv, str, useHSL;
|
3150
3295
|
if (e.indexOf(",") !== -1 || b.indexOf(",") !== -1) {
|
3151
3296
|
ba = ba.join(" ").replace(_commasOutsideParenExp, ", ").split(" ");
|
3152
3297
|
ea = ea.join(" ").replace(_commasOutsideParenExp, ", ").split(" ");
|
@@ -3159,6 +3304,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
3159
3304
|
}
|
3160
3305
|
pt.plugin = plugin;
|
3161
3306
|
pt.setRatio = setRatio;
|
3307
|
+
_colorExp.lastIndex = 0;
|
3162
3308
|
for (i = 0; i < l; i++) {
|
3163
3309
|
bv = ba[i];
|
3164
3310
|
ev = ea[i];
|
@@ -3168,26 +3314,35 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
3168
3314
|
pt.appendXtra("", bn, _parseChange(ev, bn), ev.replace(_relNumExp, ""), (autoRound && ev.indexOf("px") !== -1), true);
|
3169
3315
|
|
3170
3316
|
//if the value is a color
|
3171
|
-
} else if (clrs &&
|
3317
|
+
} else if (clrs && _colorExp.test(bv)) {
|
3172
3318
|
str = ev.charAt(ev.length - 1) === "," ? ")," : ")"; //if there's a comma at the end, retain it.
|
3173
|
-
|
3174
|
-
|
3175
|
-
|
3176
|
-
|
3319
|
+
useHSL = (ev.indexOf("hsl") !== -1 && _supportsOpacity);
|
3320
|
+
bv = _parseColor(bv, useHSL);
|
3321
|
+
ev = _parseColor(ev, useHSL);
|
3322
|
+
hasAlpha = (bv.length + ev.length > 6);
|
3323
|
+
if (hasAlpha && !_supportsOpacity && ev[3] === 0) { //older versions of IE don't support rgba(), so if the destination alpha is 0, just use "transparent" for the end color
|
3177
3324
|
pt["xs" + pt.l] += pt.l ? " transparent" : "transparent";
|
3178
3325
|
pt.e = pt.e.split(ea[i]).join("transparent");
|
3179
3326
|
} else {
|
3180
3327
|
if (!_supportsOpacity) { //old versions of IE don't support rgba().
|
3181
|
-
|
3328
|
+
hasAlpha = false;
|
3329
|
+
}
|
3330
|
+
if (useHSL) {
|
3331
|
+
pt.appendXtra((hasAlpha ? "hsla(" : "hsl("), bv[0], _parseChange(ev[0], bv[0]), ",", false, true)
|
3332
|
+
.appendXtra("", bv[1], _parseChange(ev[1], bv[1]), "%,", false)
|
3333
|
+
.appendXtra("", bv[2], _parseChange(ev[2], bv[2]), (hasAlpha ? "%," : "%" + str), false);
|
3334
|
+
} else {
|
3335
|
+
pt.appendXtra((hasAlpha ? "rgba(" : "rgb("), bv[0], ev[0] - bv[0], ",", true, true)
|
3336
|
+
.appendXtra("", bv[1], ev[1] - bv[1], ",", true)
|
3337
|
+
.appendXtra("", bv[2], ev[2] - bv[2], (hasAlpha ? "," : str), true);
|
3182
3338
|
}
|
3183
|
-
|
3184
|
-
|
3185
|
-
.appendXtra("", bv[2], ev[2] - bv[2], (rgba ? "," : str), true);
|
3186
|
-
if (rgba) {
|
3339
|
+
|
3340
|
+
if (hasAlpha) {
|
3187
3341
|
bv = (bv.length < 4) ? 1 : bv[3];
|
3188
3342
|
pt.appendXtra("", bv, ((ev.length < 4) ? 1 : ev[3]) - bv, str, false);
|
3189
3343
|
}
|
3190
3344
|
}
|
3345
|
+
_colorExp.lastIndex = 0; //otherwise the test() on the RegExp could move the lastIndex and taint future results.
|
3191
3346
|
|
3192
3347
|
} else {
|
3193
3348
|
bnums = bv.match(_numExp); //gets each group of numbers in the beginning value string and drops them into an array
|
@@ -4061,14 +4216,22 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
4061
4216
|
if (cssp._lastParsedTransform === vars) { return pt; } //only need to parse the transform once, and only if the browser supports it.
|
4062
4217
|
cssp._lastParsedTransform = vars;
|
4063
4218
|
var originalGSTransform = t._gsTransform,
|
4064
|
-
m1 = cssp._transform = _getTransform(t, _cs, true, vars.parseTransform),
|
4065
4219
|
style = t.style,
|
4066
4220
|
min = 0.000001,
|
4067
4221
|
i = _transformProps.length,
|
4068
4222
|
v = vars,
|
4069
4223
|
endRotations = {},
|
4070
4224
|
transformOriginString = "transformOrigin",
|
4071
|
-
m2, skewY, copy, orig, has3D, hasChange, dr, x, y;
|
4225
|
+
m1, m2, skewY, copy, orig, has3D, hasChange, dr, x, y;
|
4226
|
+
if (vars.display) { //if the user is setting display during this tween, it may not be instantiated yet but we must force it here in order to get accurate readings. If display is "none", some browsers refuse to report the transform properties correctly.
|
4227
|
+
copy = _getStyle(t, "display");
|
4228
|
+
style.display = "block";
|
4229
|
+
m1 = _getTransform(t, _cs, true, vars.parseTransform);
|
4230
|
+
style.display = copy;
|
4231
|
+
} else {
|
4232
|
+
m1 = _getTransform(t, _cs, true, vars.parseTransform);
|
4233
|
+
}
|
4234
|
+
cssp._transform = m1;
|
4072
4235
|
if (typeof(v.transform) === "string" && _transformProp) { //for values like transform:"rotate(60deg) scale(0.5, 0.8)"
|
4073
4236
|
copy = _tempDiv.style; //don't use the original target because it might be SVG in which case some browsers don't report computed style correctly.
|
4074
4237
|
copy[_transformProp] = v.transform;
|
@@ -4077,6 +4240,9 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
4077
4240
|
_doc.body.appendChild(_tempDiv);
|
4078
4241
|
m2 = _getTransform(_tempDiv, null, false);
|
4079
4242
|
_doc.body.removeChild(_tempDiv);
|
4243
|
+
if (!m2.perspective) {
|
4244
|
+
m2.perspective = m1.perspective; //tweening to no perspective gives very unintuitive results - just keep the same perspective in that case.
|
4245
|
+
}
|
4080
4246
|
if (v.xPercent != null) {
|
4081
4247
|
m2.xPercent = _parseVal(v.xPercent, m1.xPercent);
|
4082
4248
|
}
|
@@ -4674,8 +4840,8 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
4674
4840
|
bs = bn + "%";
|
4675
4841
|
}
|
4676
4842
|
|
4677
|
-
} else if (esfx === "em") {
|
4678
|
-
bn /= _convertToPixels(target, p, 1,
|
4843
|
+
} else if (esfx === "em" || esfx === "rem") {
|
4844
|
+
bn /= _convertToPixels(target, p, 1, esfx);
|
4679
4845
|
|
4680
4846
|
//otherwise convert to pixels.
|
4681
4847
|
} else if (esfx !== "px") {
|
@@ -4980,6 +5146,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
4980
5146
|
|
4981
5147
|
var RoundPropsPlugin = _gsScope._gsDefine.plugin({
|
4982
5148
|
propName: "roundProps",
|
5149
|
+
version: "1.5",
|
4983
5150
|
priority: -1,
|
4984
5151
|
API: 2,
|
4985
5152
|
|
@@ -4990,11 +5157,19 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
4990
5157
|
}
|
4991
5158
|
|
4992
5159
|
}),
|
5160
|
+
_roundLinkedList = function(node) {
|
5161
|
+
while (node) {
|
5162
|
+
if (!node.f && !node.blob) {
|
5163
|
+
node.r = 1;
|
5164
|
+
}
|
5165
|
+
node = node._next;
|
5166
|
+
}
|
5167
|
+
},
|
4993
5168
|
p = RoundPropsPlugin.prototype;
|
4994
5169
|
|
4995
5170
|
p._onInitAllProps = function() {
|
4996
5171
|
var tween = this._tween,
|
4997
|
-
rp = (tween.vars.roundProps
|
5172
|
+
rp = (tween.vars.roundProps.join) ? tween.vars.roundProps : tween.vars.roundProps.split(","),
|
4998
5173
|
i = rp.length,
|
4999
5174
|
lookup = {},
|
5000
5175
|
rpt = tween._propLookup.roundProps,
|
@@ -5011,18 +5186,22 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
5011
5186
|
if (pt.pg) {
|
5012
5187
|
pt.t._roundProps(lookup, true);
|
5013
5188
|
} else if (pt.n === prop) {
|
5014
|
-
|
5015
|
-
|
5016
|
-
|
5017
|
-
|
5018
|
-
|
5019
|
-
|
5020
|
-
|
5021
|
-
|
5022
|
-
|
5189
|
+
if (pt.f === 2 && pt.t) { //a blob (text containing multiple numeric values)
|
5190
|
+
_roundLinkedList(pt.t._firstPT);
|
5191
|
+
} else {
|
5192
|
+
this._add(pt.t, prop, pt.s, pt.c);
|
5193
|
+
//remove from linked list
|
5194
|
+
if (next) {
|
5195
|
+
next._prev = pt._prev;
|
5196
|
+
}
|
5197
|
+
if (pt._prev) {
|
5198
|
+
pt._prev._next = next;
|
5199
|
+
} else if (tween._firstPT === pt) {
|
5200
|
+
tween._firstPT = next;
|
5201
|
+
}
|
5202
|
+
pt._next = pt._prev = null;
|
5203
|
+
tween._propLookup[prop] = rpt;
|
5023
5204
|
}
|
5024
|
-
pt._next = pt._prev = null;
|
5025
|
-
tween._propLookup[prop] = rpt;
|
5026
5205
|
}
|
5027
5206
|
pt = next;
|
5028
5207
|
}
|
@@ -5053,61 +5232,27 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
5053
5232
|
*/
|
5054
5233
|
|
5055
5234
|
(function() {
|
5056
|
-
var _numExp = /(?:\d|\-|\+|=|#|\.)*/g,
|
5057
|
-
_suffixExp = /[A-Za-z%]/g;
|
5058
5235
|
|
5059
5236
|
_gsScope._gsDefine.plugin({
|
5060
5237
|
propName: "attr",
|
5061
5238
|
API: 2,
|
5062
|
-
version: "0.
|
5239
|
+
version: "0.5.0",
|
5063
5240
|
|
5064
5241
|
//called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run.
|
5065
5242
|
init: function(target, value, tween) {
|
5066
|
-
var p
|
5243
|
+
var p;
|
5067
5244
|
if (typeof(target.setAttribute) !== "function") {
|
5068
5245
|
return false;
|
5069
5246
|
}
|
5070
|
-
this._target = target;
|
5071
|
-
this._proxy = {};
|
5072
|
-
this._start = {}; // we record start and end values exactly as they are in case they're strings (not numbers) - we need to be able to revert to them cleanly.
|
5073
|
-
this._end = {};
|
5074
|
-
this._suffix = {};
|
5075
5247
|
for (p in value) {
|
5076
|
-
this.
|
5077
|
-
this._end[p] = end = value[p] + "";
|
5078
|
-
this._suffix[p] = suffix = _suffixExp.test(end) ? end.replace(_numExp, "") : _suffixExp.test(start) ? start.replace(_numExp, "") : "";
|
5079
|
-
if (suffix) {
|
5080
|
-
i = end.indexOf(suffix);
|
5081
|
-
if (i !== -1) {
|
5082
|
-
end = end.substr(0, i);
|
5083
|
-
}
|
5084
|
-
}
|
5085
|
-
if(!this._addTween(this._proxy, p, parseFloat(start), end, p)) {
|
5086
|
-
this._suffix[p] = ""; //not a valid tween - perhaps something like an <img src=""> attribute.
|
5087
|
-
}
|
5088
|
-
if (end.charAt(1) === "=") {
|
5089
|
-
this._end[p] = (this._firstPT.s + this._firstPT.c) + suffix;
|
5090
|
-
}
|
5248
|
+
this._addTween(target, "setAttribute", target.getAttribute(p) + "", value[p] + "", p, false, p);
|
5091
5249
|
this._overwriteProps.push(p);
|
5092
5250
|
}
|
5093
5251
|
return true;
|
5094
|
-
},
|
5095
|
-
|
5096
|
-
//called each time the values should be updated, and the ratio gets passed as the only parameter (typically it's a value between 0 and 1, but it can exceed those when using an ease like Elastic.easeOut or Back.easeOut, etc.)
|
5097
|
-
set: function(ratio) {
|
5098
|
-
this._super.setRatio.call(this, ratio);
|
5099
|
-
var props = this._overwriteProps,
|
5100
|
-
i = props.length,
|
5101
|
-
lookup = (ratio === 1) ? this._end : ratio ? this._proxy : this._start,
|
5102
|
-
useSuffix = (lookup === this._proxy),
|
5103
|
-
p;
|
5104
|
-
while (--i > -1) {
|
5105
|
-
p = props[i];
|
5106
|
-
this._target.setAttribute(p, lookup[p] + (useSuffix ? this._suffix[p] : ""));
|
5107
|
-
}
|
5108
5252
|
}
|
5109
5253
|
|
5110
5254
|
});
|
5255
|
+
|
5111
5256
|
}());
|
5112
5257
|
|
5113
5258
|
|
@@ -5572,7 +5717,7 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween
|
|
5572
5717
|
var b = [],
|
5573
5718
|
l = a.length,
|
5574
5719
|
i;
|
5575
|
-
for (i = 0; i !== l; b.push(a[i++]))
|
5720
|
+
for (i = 0; i !== l; b.push(a[i++])) {}
|
5576
5721
|
return b;
|
5577
5722
|
},
|
5578
5723
|
_emptyFunc = function() {},
|
@@ -5628,7 +5773,7 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween
|
|
5628
5773
|
this.check = function(init) {
|
5629
5774
|
var i = dependencies.length,
|
5630
5775
|
missing = i,
|
5631
|
-
cur, a, n, cl;
|
5776
|
+
cur, a, n, cl, hasModule;
|
5632
5777
|
while (--i > -1) {
|
5633
5778
|
if ((cur = _defLookup[dependencies[i]] || new Definition(dependencies[i], [])).gsClass) {
|
5634
5779
|
_classes[i] = cur.gsClass;
|
@@ -5645,9 +5790,10 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween
|
|
5645
5790
|
//exports to multiple environments
|
5646
5791
|
if (global) {
|
5647
5792
|
_globals[n] = cl; //provides a way to avoid global namespace pollution. By default, the main classes like TweenLite, Power1, Strong, etc. are added to window unless a GreenSockGlobals is defined. So if you want to have things added to a custom object instead, just do something like window.GreenSockGlobals = {} before loading any GreenSock files. You can even set up an alias like window.GreenSockGlobals = windows.gs = {} so that you can access everything like gs.TweenLite. Also remember that ALL classes are added to the window.com.greensock object (in their respective packages, like com.greensock.easing.Power1, com.greensock.TweenLite, etc.)
|
5648
|
-
|
5793
|
+
hasModule = (typeof(module) !== "undefined" && module.exports);
|
5794
|
+
if (!hasModule && typeof(define) === "function" && define.amd){ //AMD
|
5649
5795
|
define((window.GreenSockAMDPath ? window.GreenSockAMDPath + "/" : "") + ns.split(".").pop(), [], function() { return cl; });
|
5650
|
-
} else if (ns === moduleName &&
|
5796
|
+
} else if (ns === moduleName && hasModule){ //node
|
5651
5797
|
module.exports = cl;
|
5652
5798
|
}
|
5653
5799
|
}
|
@@ -6182,6 +6328,9 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween
|
|
6182
6328
|
this._enabled(true, false);
|
6183
6329
|
}
|
6184
6330
|
if (this._totalTime !== time || this._duration === 0) {
|
6331
|
+
if (_lazyTweens.length) {
|
6332
|
+
_lazyRender();
|
6333
|
+
}
|
6185
6334
|
this.render(time, suppressEvents, false);
|
6186
6335
|
if (_lazyTweens.length) { //in case rendering caused any tweens to lazy-init, we should render them because typically when someone calls seek() or time() or progress(), they expect an immediate render.
|
6187
6336
|
_lazyRender();
|
@@ -6192,7 +6341,8 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween
|
|
6192
6341
|
};
|
6193
6342
|
|
6194
6343
|
p.progress = p.totalProgress = function(value, suppressEvents) {
|
6195
|
-
|
6344
|
+
var duration = this.duration();
|
6345
|
+
return (!arguments.length) ? (duration ? this._time / duration : this.ratio) : this.totalTime(duration * value, suppressEvents);
|
6196
6346
|
};
|
6197
6347
|
|
6198
6348
|
p.startTime = function(value) {
|
@@ -6257,7 +6407,8 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween
|
|
6257
6407
|
this._paused = value;
|
6258
6408
|
this._active = this.isActive();
|
6259
6409
|
if (!value && elapsed !== 0 && this._initted && this.duration()) {
|
6260
|
-
|
6410
|
+
raw = tl.smoothChildTiming ? this._totalTime : (raw - this._startTime) / this._timeScale;
|
6411
|
+
this.render(raw, (raw === this._totalTime), true); //in case the target's properties changed via some other tween or manual update by the user, we should force a render.
|
6261
6412
|
}
|
6262
6413
|
}
|
6263
6414
|
if (this._gc && !value) {
|
@@ -6459,7 +6610,7 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween
|
|
6459
6610
|
p._firstPT = p._targets = p._overwrittenProps = p._startAt = null;
|
6460
6611
|
p._notifyPluginsOfEnabled = p._lazy = false;
|
6461
6612
|
|
6462
|
-
TweenLite.version = "1.
|
6613
|
+
TweenLite.version = "1.18.0";
|
6463
6614
|
TweenLite.defaultEase = p._ease = new Ease(null, null, 1, 1);
|
6464
6615
|
TweenLite.defaultOverwrite = "auto";
|
6465
6616
|
TweenLite.ticker = _ticker;
|
@@ -6479,11 +6630,116 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween
|
|
6479
6630
|
|
6480
6631
|
var _lazyTweens = [],
|
6481
6632
|
_lazyLookup = {},
|
6482
|
-
|
6633
|
+
_numbersExp = /(?:(-|-=|\+=)?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/ig,
|
6634
|
+
//_nonNumbersExp = /(?:([\-+](?!(\d|=)))|[^\d\-+=e]|(e(?![\-+][\d])))+/ig,
|
6635
|
+
_setRatio = function(v) {
|
6636
|
+
var pt = this._firstPT,
|
6637
|
+
min = 0.000001,
|
6638
|
+
val;
|
6639
|
+
while (pt) {
|
6640
|
+
val = !pt.blob ? pt.c * v + pt.s : v ? this.join("") : this.start;
|
6641
|
+
if (pt.r) {
|
6642
|
+
val = Math.round(val);
|
6643
|
+
} else if (val < min) if (val > -min) { //prevents issues with converting very small numbers to strings in the browser
|
6644
|
+
val = 0;
|
6645
|
+
}
|
6646
|
+
if (!pt.f) {
|
6647
|
+
pt.t[pt.p] = val;
|
6648
|
+
} else if (pt.fp) {
|
6649
|
+
pt.t[pt.p](pt.fp, val);
|
6650
|
+
} else {
|
6651
|
+
pt.t[pt.p](val);
|
6652
|
+
}
|
6653
|
+
pt = pt._next;
|
6654
|
+
}
|
6655
|
+
},
|
6656
|
+
//compares two strings (start/end), finds the numbers that are different and spits back an array representing the whole value but with the changing values isolated as elements. For example, "rgb(0,0,0)" and "rgb(100,50,0)" would become ["rgb(", 0, ",", 50, ",0)"]. Notice it merges the parts that are identical (performance optimization). The array also has a linked list of PropTweens attached starting with _firstPT that contain the tweening data (t, p, s, c, f, etc.). It also stores the starting value as a "start" property so that we can revert to it if/when necessary, like when a tween rewinds fully. If the quantity of numbers differs between the start and end, it will always prioritize the end value(s). The pt parameter is optional - it's for a PropTween that will be appended to the end of the linked list and is typically for actually setting the value after all of the elements have been updated (with array.join("")).
|
6657
|
+
_blobDif = function(start, end, filter, pt) {
|
6658
|
+
var a = [start, end],
|
6659
|
+
charIndex = 0,
|
6660
|
+
s = "",
|
6661
|
+
color = 0,
|
6662
|
+
startNums, endNums, num, i, l, nonNumbers, currentNum;
|
6663
|
+
a.start = start;
|
6664
|
+
if (filter) {
|
6665
|
+
filter(a); //pass an array with the starting and ending values and let the filter do whatever it needs to the values.
|
6666
|
+
start = a[0];
|
6667
|
+
end = a[1];
|
6668
|
+
}
|
6669
|
+
a.length = 0;
|
6670
|
+
startNums = start.match(_numbersExp) || [];
|
6671
|
+
endNums = end.match(_numbersExp) || [];
|
6672
|
+
if (pt) {
|
6673
|
+
pt._next = null;
|
6674
|
+
pt.blob = 1;
|
6675
|
+
a._firstPT = pt; //apply last in the linked list (which means inserting it first)
|
6676
|
+
}
|
6677
|
+
l = endNums.length;
|
6678
|
+
for (i = 0; i < l; i++) {
|
6679
|
+
currentNum = endNums[i];
|
6680
|
+
nonNumbers = end.substr(charIndex, end.indexOf(currentNum, charIndex)-charIndex);
|
6681
|
+
s += (nonNumbers || !i) ? nonNumbers : ","; //note: SVG spec allows omission of comma/space when a negative sign is wedged between two numbers, like 2.5-5.3 instead of 2.5,-5.3 but when tweening, the negative value may switch to positive, so we insert the comma just in case.
|
6682
|
+
charIndex += nonNumbers.length;
|
6683
|
+
if (color) { //sense rgba() values and round them.
|
6684
|
+
color = (color + 1) % 5;
|
6685
|
+
} else if (nonNumbers.substr(-5) === "rgba(") {
|
6686
|
+
color = 1;
|
6687
|
+
}
|
6688
|
+
if (currentNum === startNums[i] || startNums.length <= i) {
|
6689
|
+
s += currentNum;
|
6690
|
+
} else {
|
6691
|
+
if (s) {
|
6692
|
+
a.push(s);
|
6693
|
+
s = "";
|
6694
|
+
}
|
6695
|
+
num = parseFloat(startNums[i]);
|
6696
|
+
a.push(num);
|
6697
|
+
a._firstPT = {_next: a._firstPT, t:a, p: a.length-1, s:num, c:((currentNum.charAt(1) === "=") ? parseInt(currentNum.charAt(0) + "1", 10) * parseFloat(currentNum.substr(2)) : (parseFloat(currentNum) - num)) || 0, f:0, r:(color && color < 4)};
|
6698
|
+
//note: we don't set _prev because we'll never need to remove individual PropTweens from this list.
|
6699
|
+
}
|
6700
|
+
charIndex += currentNum.length;
|
6701
|
+
}
|
6702
|
+
s += end.substr(charIndex);
|
6703
|
+
if (s) {
|
6704
|
+
a.push(s);
|
6705
|
+
}
|
6706
|
+
a.setRatio = _setRatio;
|
6707
|
+
return a;
|
6708
|
+
},
|
6709
|
+
//note: "funcParam" is only necessary for function-based getters/setters that require an extra parameter like getAttribute("width") and setAttribute("width", value). In this example, funcParam would be "width". Used by AttrPlugin for example.
|
6710
|
+
_addPropTween = function(target, prop, start, end, overwriteProp, round, funcParam, stringFilter) {
|
6711
|
+
var s = (start === "get") ? target[prop] : start,
|
6712
|
+
type = typeof(target[prop]),
|
6713
|
+
isRelative = (typeof(end) === "string" && end.charAt(1) === "="),
|
6714
|
+
pt = {t:target, p:prop, s:s, f:(type === "function"), pg:0, n:overwriteProp || prop, r:round, pr:0, c:isRelative ? parseInt(end.charAt(0) + "1", 10) * parseFloat(end.substr(2)) : (parseFloat(end) - s) || 0},
|
6715
|
+
blob, getterName;
|
6716
|
+
if (type !== "number") {
|
6717
|
+
if (type === "function" && start === "get") {
|
6718
|
+
getterName = ((prop.indexOf("set") || typeof(target["get" + prop.substr(3)]) !== "function") ? prop : "get" + prop.substr(3));
|
6719
|
+
pt.s = s = funcParam ? target[getterName](funcParam) : target[getterName]();
|
6720
|
+
}
|
6721
|
+
if (typeof(s) === "string" && (funcParam || isNaN(s))) {
|
6722
|
+
//a blob (string that has multiple numbers in it)
|
6723
|
+
pt.fp = funcParam;
|
6724
|
+
blob = _blobDif(s, end, stringFilter || TweenLite.defaultStringFilter, pt);
|
6725
|
+
pt = {t:blob, p:"setRatio", s:0, c:1, f:2, pg:0, n:overwriteProp || prop, pr:0}; //"2" indicates it's a Blob property tween. Needed for RoundPropsPlugin for example.
|
6726
|
+
} else if (!isRelative) {
|
6727
|
+
pt.c = (parseFloat(end) - parseFloat(s)) || 0;
|
6728
|
+
}
|
6729
|
+
}
|
6730
|
+
if (pt.c) { //only add it to the linked list if there's a change.
|
6731
|
+
if ((pt._next = this._firstPT)) {
|
6732
|
+
pt._next._prev = pt;
|
6733
|
+
}
|
6734
|
+
this._firstPT = pt;
|
6735
|
+
return pt;
|
6736
|
+
}
|
6737
|
+
},
|
6738
|
+
_internals = TweenLite._internals = {isArray:_isArray, isSelector:_isSelector, lazyTweens:_lazyTweens, blobDif:_blobDif}, //gives us a way to expose certain private values to other GreenSock classes without contaminating tha main TweenLite object.
|
6483
6739
|
_plugins = TweenLite._plugins = {},
|
6484
6740
|
_tweenLookup = _internals.tweenLookup = {},
|
6485
6741
|
_tweenLookupNum = 0,
|
6486
|
-
_reservedProps = _internals.reservedProps = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, onCompleteScope:1, useFrames:1, runBackwards:1, startAt:1, onUpdate:1, onUpdateParams:1, onUpdateScope:1, onStart:1, onStartParams:1, onStartScope:1, onReverseComplete:1, onReverseCompleteParams:1, onReverseCompleteScope:1, onRepeat:1, onRepeatParams:1, onRepeatScope:1, easeParams:1, yoyo:1, immediateRender:1, repeat:1, repeatDelay:1, data:1, paused:1, reversed:1, autoCSS:1, lazy:1, onOverwrite:1, callbackScope:1},
|
6742
|
+
_reservedProps = _internals.reservedProps = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, onCompleteScope:1, useFrames:1, runBackwards:1, startAt:1, onUpdate:1, onUpdateParams:1, onUpdateScope:1, onStart:1, onStartParams:1, onStartScope:1, onReverseComplete:1, onReverseCompleteParams:1, onReverseCompleteScope:1, onRepeat:1, onRepeatParams:1, onRepeatScope:1, easeParams:1, yoyo:1, immediateRender:1, repeat:1, repeatDelay:1, data:1, paused:1, reversed:1, autoCSS:1, lazy:1, onOverwrite:1, callbackScope:1, stringFilter:1},
|
6487
6743
|
_overwriteLookup = {none:0, all:1, auto:2, concurrent:3, allOnStart:4, preexisting:5, "true":1, "false":0},
|
6488
6744
|
_rootFramesTimeline = Animation._rootFramesTimeline = new SimpleTimeline(),
|
6489
6745
|
_rootTimeline = Animation._rootTimeline = new SimpleTimeline(),
|
@@ -6564,7 +6820,6 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween
|
|
6564
6820
|
}
|
6565
6821
|
return _tweenLookup[id].tweens;
|
6566
6822
|
},
|
6567
|
-
|
6568
6823
|
_onOverwrite = function(overwrittenTween, overwritingTween, target, killedProps) {
|
6569
6824
|
var func = overwrittenTween.vars.onOverwrite, r1, r2;
|
6570
6825
|
if (func) {
|
@@ -6630,7 +6885,6 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween
|
|
6630
6885
|
}
|
6631
6886
|
return changed;
|
6632
6887
|
},
|
6633
|
-
|
6634
6888
|
_checkOverlap = function(tween, reference, zeroDur) {
|
6635
6889
|
var tl = tween._timeline,
|
6636
6890
|
ts = tl._timeScale,
|
@@ -6777,7 +7031,7 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween
|
|
6777
7031
|
//n - name [string]
|
6778
7032
|
//pg - isPlugin [boolean]
|
6779
7033
|
//pr - priority [number]
|
6780
|
-
this._firstPT = pt = {_next:this._firstPT, t:plugin, p:"setRatio", s:0, c:1, f:
|
7034
|
+
this._firstPT = pt = {_next:this._firstPT, t:plugin, p:"setRatio", s:0, c:1, f:1, n:p, pg:1, pr:plugin._priority};
|
6781
7035
|
i = plugin._overwriteProps.length;
|
6782
7036
|
while (--i > -1) {
|
6783
7037
|
propLookup[plugin._overwriteProps[i]] = this._firstPT;
|
@@ -6788,14 +7042,12 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween
|
|
6788
7042
|
if (plugin._onDisable || plugin._onEnable) {
|
6789
7043
|
this._notifyPluginsOfEnabled = true;
|
6790
7044
|
}
|
7045
|
+
if (pt._next) {
|
7046
|
+
pt._next._prev = pt;
|
7047
|
+
}
|
6791
7048
|
|
6792
7049
|
} else {
|
6793
|
-
|
6794
|
-
pt.s = (!pt.f) ? parseFloat(target[p]) : target[ ((p.indexOf("set") || typeof(target["get" + p.substr(3)]) !== "function") ? p : "get" + p.substr(3)) ]();
|
6795
|
-
pt.c = (typeof(v) === "string" && v.charAt(1) === "=") ? parseInt(v.charAt(0) + "1", 10) * Number(v.substr(2)) : (Number(v) - pt.s) || 0;
|
6796
|
-
}
|
6797
|
-
if (pt) if (pt._next) {
|
6798
|
-
pt._next._prev = pt;
|
7050
|
+
propLookup[p] = _addPropTween.call(this, target, p, "get", v, p, 0, null, this.vars.stringFilter);
|
6799
7051
|
}
|
6800
7052
|
}
|
6801
7053
|
|
@@ -7184,40 +7436,11 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween
|
|
7184
7436
|
}, true);
|
7185
7437
|
|
7186
7438
|
p = TweenPlugin.prototype;
|
7187
|
-
TweenPlugin.version = "1.
|
7439
|
+
TweenPlugin.version = "1.18.0";
|
7188
7440
|
TweenPlugin.API = 2;
|
7189
7441
|
p._firstPT = null;
|
7190
|
-
|
7191
|
-
p.
|
7192
|
-
var c, pt;
|
7193
|
-
if (end != null && (c = (typeof(end) === "number" || end.charAt(1) !== "=") ? Number(end) - Number(start) : parseInt(end.charAt(0) + "1", 10) * Number(end.substr(2)))) {
|
7194
|
-
this._firstPT = pt = {_next:this._firstPT, t:target, p:prop, s:start, c:c, f:(typeof(target[prop]) === "function"), n:overwriteProp || prop, r:round};
|
7195
|
-
if (pt._next) {
|
7196
|
-
pt._next._prev = pt;
|
7197
|
-
}
|
7198
|
-
return pt;
|
7199
|
-
}
|
7200
|
-
};
|
7201
|
-
|
7202
|
-
p.setRatio = function(v) {
|
7203
|
-
var pt = this._firstPT,
|
7204
|
-
min = 0.000001,
|
7205
|
-
val;
|
7206
|
-
while (pt) {
|
7207
|
-
val = pt.c * v + pt.s;
|
7208
|
-
if (pt.r) {
|
7209
|
-
val = Math.round(val);
|
7210
|
-
} else if (val < min) if (val > -min) { //prevents issues with converting very small numbers to strings in the browser
|
7211
|
-
val = 0;
|
7212
|
-
}
|
7213
|
-
if (pt.f) {
|
7214
|
-
pt.t[pt.p](val);
|
7215
|
-
} else {
|
7216
|
-
pt.t[pt.p] = val;
|
7217
|
-
}
|
7218
|
-
pt = pt._next;
|
7219
|
-
}
|
7220
|
-
};
|
7442
|
+
p._addTween = _addPropTween;
|
7443
|
+
p.setRatio = _setRatio;
|
7221
7444
|
|
7222
7445
|
p._kill = function(lookup) {
|
7223
7446
|
var a = this._overwriteProps,
|