greensock-rails 1.11.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE.txt +2 -0
- data/README.md +47 -0
- data/lib/greensock/rails.rb +9 -0
- data/lib/greensock/rails/version.rb +5 -0
- data/vendor/assets/javascripts/greensock/TimelineLite.js +622 -0
- data/vendor/assets/javascripts/greensock/TimelineMax.js +1060 -0
- data/vendor/assets/javascripts/greensock/TweenLite.js +1654 -0
- data/vendor/assets/javascripts/greensock/TweenMax.js +6662 -0
- data/vendor/assets/javascripts/greensock/easing/EasePack.js +343 -0
- data/vendor/assets/javascripts/greensock/jquery.gsap.js +167 -0
- data/vendor/assets/javascripts/greensock/plugins/AttrPlugin.js +51 -0
- data/vendor/assets/javascripts/greensock/plugins/BezierPlugin.js +574 -0
- data/vendor/assets/javascripts/greensock/plugins/CSSPlugin.js +2260 -0
- data/vendor/assets/javascripts/greensock/plugins/CSSRulePlugin.js +100 -0
- data/vendor/assets/javascripts/greensock/plugins/ColorPropsPlugin.js +122 -0
- data/vendor/assets/javascripts/greensock/plugins/DirectionalRotationPlugin.js +80 -0
- data/vendor/assets/javascripts/greensock/plugins/EaselPlugin.js +298 -0
- data/vendor/assets/javascripts/greensock/plugins/KineticPlugin.js +298 -0
- data/vendor/assets/javascripts/greensock/plugins/RaphaelPlugin.js +367 -0
- data/vendor/assets/javascripts/greensock/plugins/RoundPropsPlugin.js +73 -0
- data/vendor/assets/javascripts/greensock/plugins/ScrollToPlugin.js +115 -0
- data/vendor/assets/javascripts/greensock/plugins/TEMPLATE_Plugin.js +74 -0
- data/vendor/assets/javascripts/greensock/plugins/TextPlugin.js +108 -0
- data/vendor/assets/javascripts/greensock/utils/Draggable.js +1438 -0
- metadata +97 -0
@@ -0,0 +1,343 @@
|
|
1
|
+
/*!
|
2
|
+
* VERSION: beta 1.9.3
|
3
|
+
* DATE: 2013-04-02
|
4
|
+
* UPDATES AND DOCS AT: http://www.greensock.com
|
5
|
+
*
|
6
|
+
* @license Copyright (c) 2008-2014, GreenSock. All rights reserved.
|
7
|
+
* This work is subject to the terms at http://www.greensock.com/terms_of_use.html or for
|
8
|
+
* Club GreenSock members, the software agreement that was issued with your membership.
|
9
|
+
*
|
10
|
+
* @author: Jack Doyle, jack@greensock.com
|
11
|
+
**/
|
12
|
+
(window._gsQueue || (window._gsQueue = [])).push( function() {
|
13
|
+
|
14
|
+
"use strict";
|
15
|
+
|
16
|
+
window._gsDefine("easing.Back", ["easing.Ease"], function(Ease) {
|
17
|
+
|
18
|
+
var w = (window.GreenSockGlobals || window),
|
19
|
+
gs = w.com.greensock,
|
20
|
+
_2PI = Math.PI * 2,
|
21
|
+
_HALF_PI = Math.PI / 2,
|
22
|
+
_class = gs._class,
|
23
|
+
_create = function(n, f) {
|
24
|
+
var C = _class("easing." + n, function(){}, true),
|
25
|
+
p = C.prototype = new Ease();
|
26
|
+
p.constructor = C;
|
27
|
+
p.getRatio = f;
|
28
|
+
return C;
|
29
|
+
},
|
30
|
+
_easeReg = Ease.register || function(){}, //put an empty function in place just as a safety measure in case someone loads an OLD version of TweenLite.js where Ease.register doesn't exist.
|
31
|
+
_wrap = function(name, EaseOut, EaseIn, EaseInOut, aliases) {
|
32
|
+
var C = _class("easing."+name, {
|
33
|
+
easeOut:new EaseOut(),
|
34
|
+
easeIn:new EaseIn(),
|
35
|
+
easeInOut:new EaseInOut()
|
36
|
+
}, true);
|
37
|
+
_easeReg(C, name);
|
38
|
+
return C;
|
39
|
+
},
|
40
|
+
EasePoint = function(time, value, next) {
|
41
|
+
this.t = time;
|
42
|
+
this.v = value;
|
43
|
+
if (next) {
|
44
|
+
this.next = next;
|
45
|
+
next.prev = this;
|
46
|
+
this.c = next.v - value;
|
47
|
+
this.gap = next.t - time;
|
48
|
+
}
|
49
|
+
},
|
50
|
+
|
51
|
+
//Back
|
52
|
+
_createBack = function(n, f) {
|
53
|
+
var C = _class("easing." + n, function(overshoot) {
|
54
|
+
this._p1 = (overshoot || overshoot === 0) ? overshoot : 1.70158;
|
55
|
+
this._p2 = this._p1 * 1.525;
|
56
|
+
}, true),
|
57
|
+
p = C.prototype = new Ease();
|
58
|
+
p.constructor = C;
|
59
|
+
p.getRatio = f;
|
60
|
+
p.config = function(overshoot) {
|
61
|
+
return new C(overshoot);
|
62
|
+
};
|
63
|
+
return C;
|
64
|
+
},
|
65
|
+
|
66
|
+
Back = _wrap("Back",
|
67
|
+
_createBack("BackOut", function(p) {
|
68
|
+
return ((p = p - 1) * p * ((this._p1 + 1) * p + this._p1) + 1);
|
69
|
+
}),
|
70
|
+
_createBack("BackIn", function(p) {
|
71
|
+
return p * p * ((this._p1 + 1) * p - this._p1);
|
72
|
+
}),
|
73
|
+
_createBack("BackInOut", function(p) {
|
74
|
+
return ((p *= 2) < 1) ? 0.5 * p * p * ((this._p2 + 1) * p - this._p2) : 0.5 * ((p -= 2) * p * ((this._p2 + 1) * p + this._p2) + 2);
|
75
|
+
})
|
76
|
+
),
|
77
|
+
|
78
|
+
|
79
|
+
//SlowMo
|
80
|
+
SlowMo = _class("easing.SlowMo", function(linearRatio, power, yoyoMode) {
|
81
|
+
power = (power || power === 0) ? power : 0.7;
|
82
|
+
if (linearRatio == null) {
|
83
|
+
linearRatio = 0.7;
|
84
|
+
} else if (linearRatio > 1) {
|
85
|
+
linearRatio = 1;
|
86
|
+
}
|
87
|
+
this._p = (linearRatio !== 1) ? power : 0;
|
88
|
+
this._p1 = (1 - linearRatio) / 2;
|
89
|
+
this._p2 = linearRatio;
|
90
|
+
this._p3 = this._p1 + this._p2;
|
91
|
+
this._calcEnd = (yoyoMode === true);
|
92
|
+
}, true),
|
93
|
+
p = SlowMo.prototype = new Ease(),
|
94
|
+
SteppedEase, RoughEase, _createElastic;
|
95
|
+
|
96
|
+
p.constructor = SlowMo;
|
97
|
+
p.getRatio = function(p) {
|
98
|
+
var r = p + (0.5 - p) * this._p;
|
99
|
+
if (p < this._p1) {
|
100
|
+
return this._calcEnd ? 1 - ((p = 1 - (p / this._p1)) * p) : r - ((p = 1 - (p / this._p1)) * p * p * p * r);
|
101
|
+
} else if (p > this._p3) {
|
102
|
+
return this._calcEnd ? 1 - (p = (p - this._p3) / this._p1) * p : r + ((p - r) * (p = (p - this._p3) / this._p1) * p * p * p);
|
103
|
+
}
|
104
|
+
return this._calcEnd ? 1 : r;
|
105
|
+
};
|
106
|
+
SlowMo.ease = new SlowMo(0.7, 0.7);
|
107
|
+
|
108
|
+
p.config = SlowMo.config = function(linearRatio, power, yoyoMode) {
|
109
|
+
return new SlowMo(linearRatio, power, yoyoMode);
|
110
|
+
};
|
111
|
+
|
112
|
+
|
113
|
+
//SteppedEase
|
114
|
+
SteppedEase = _class("easing.SteppedEase", function(steps) {
|
115
|
+
steps = steps || 1;
|
116
|
+
this._p1 = 1 / steps;
|
117
|
+
this._p2 = steps + 1;
|
118
|
+
}, true);
|
119
|
+
p = SteppedEase.prototype = new Ease();
|
120
|
+
p.constructor = SteppedEase;
|
121
|
+
p.getRatio = function(p) {
|
122
|
+
if (p < 0) {
|
123
|
+
p = 0;
|
124
|
+
} else if (p >= 1) {
|
125
|
+
p = 0.999999999;
|
126
|
+
}
|
127
|
+
return ((this._p2 * p) >> 0) * this._p1;
|
128
|
+
};
|
129
|
+
p.config = SteppedEase.config = function(steps) {
|
130
|
+
return new SteppedEase(steps);
|
131
|
+
};
|
132
|
+
|
133
|
+
|
134
|
+
//RoughEase
|
135
|
+
RoughEase = _class("easing.RoughEase", function(vars) {
|
136
|
+
vars = vars || {};
|
137
|
+
var taper = vars.taper || "none",
|
138
|
+
a = [],
|
139
|
+
cnt = 0,
|
140
|
+
points = (vars.points || 20) | 0,
|
141
|
+
i = points,
|
142
|
+
randomize = (vars.randomize !== false),
|
143
|
+
clamp = (vars.clamp === true),
|
144
|
+
template = (vars.template instanceof Ease) ? vars.template : null,
|
145
|
+
strength = (typeof(vars.strength) === "number") ? vars.strength * 0.4 : 0.4,
|
146
|
+
x, y, bump, invX, obj, pnt;
|
147
|
+
while (--i > -1) {
|
148
|
+
x = randomize ? Math.random() : (1 / points) * i;
|
149
|
+
y = template ? template.getRatio(x) : x;
|
150
|
+
if (taper === "none") {
|
151
|
+
bump = strength;
|
152
|
+
} else if (taper === "out") {
|
153
|
+
invX = 1 - x;
|
154
|
+
bump = invX * invX * strength;
|
155
|
+
} else if (taper === "in") {
|
156
|
+
bump = x * x * strength;
|
157
|
+
} else if (x < 0.5) { //"both" (start)
|
158
|
+
invX = x * 2;
|
159
|
+
bump = invX * invX * 0.5 * strength;
|
160
|
+
} else { //"both" (end)
|
161
|
+
invX = (1 - x) * 2;
|
162
|
+
bump = invX * invX * 0.5 * strength;
|
163
|
+
}
|
164
|
+
if (randomize) {
|
165
|
+
y += (Math.random() * bump) - (bump * 0.5);
|
166
|
+
} else if (i % 2) {
|
167
|
+
y += bump * 0.5;
|
168
|
+
} else {
|
169
|
+
y -= bump * 0.5;
|
170
|
+
}
|
171
|
+
if (clamp) {
|
172
|
+
if (y > 1) {
|
173
|
+
y = 1;
|
174
|
+
} else if (y < 0) {
|
175
|
+
y = 0;
|
176
|
+
}
|
177
|
+
}
|
178
|
+
a[cnt++] = {x:x, y:y};
|
179
|
+
}
|
180
|
+
a.sort(function(a, b) {
|
181
|
+
return a.x - b.x;
|
182
|
+
});
|
183
|
+
|
184
|
+
pnt = new EasePoint(1, 1, null);
|
185
|
+
i = points;
|
186
|
+
while (--i > -1) {
|
187
|
+
obj = a[i];
|
188
|
+
pnt = new EasePoint(obj.x, obj.y, pnt);
|
189
|
+
}
|
190
|
+
|
191
|
+
this._prev = new EasePoint(0, 0, (pnt.t !== 0) ? pnt : pnt.next);
|
192
|
+
}, true);
|
193
|
+
p = RoughEase.prototype = new Ease();
|
194
|
+
p.constructor = RoughEase;
|
195
|
+
p.getRatio = function(p) {
|
196
|
+
var pnt = this._prev;
|
197
|
+
if (p > pnt.t) {
|
198
|
+
while (pnt.next && p >= pnt.t) {
|
199
|
+
pnt = pnt.next;
|
200
|
+
}
|
201
|
+
pnt = pnt.prev;
|
202
|
+
} else {
|
203
|
+
while (pnt.prev && p <= pnt.t) {
|
204
|
+
pnt = pnt.prev;
|
205
|
+
}
|
206
|
+
}
|
207
|
+
this._prev = pnt;
|
208
|
+
return (pnt.v + ((p - pnt.t) / pnt.gap) * pnt.c);
|
209
|
+
};
|
210
|
+
p.config = function(vars) {
|
211
|
+
return new RoughEase(vars);
|
212
|
+
};
|
213
|
+
RoughEase.ease = new RoughEase();
|
214
|
+
|
215
|
+
|
216
|
+
//Bounce
|
217
|
+
_wrap("Bounce",
|
218
|
+
_create("BounceOut", function(p) {
|
219
|
+
if (p < 1 / 2.75) {
|
220
|
+
return 7.5625 * p * p;
|
221
|
+
} else if (p < 2 / 2.75) {
|
222
|
+
return 7.5625 * (p -= 1.5 / 2.75) * p + 0.75;
|
223
|
+
} else if (p < 2.5 / 2.75) {
|
224
|
+
return 7.5625 * (p -= 2.25 / 2.75) * p + 0.9375;
|
225
|
+
}
|
226
|
+
return 7.5625 * (p -= 2.625 / 2.75) * p + 0.984375;
|
227
|
+
}),
|
228
|
+
_create("BounceIn", function(p) {
|
229
|
+
if ((p = 1 - p) < 1 / 2.75) {
|
230
|
+
return 1 - (7.5625 * p * p);
|
231
|
+
} else if (p < 2 / 2.75) {
|
232
|
+
return 1 - (7.5625 * (p -= 1.5 / 2.75) * p + 0.75);
|
233
|
+
} else if (p < 2.5 / 2.75) {
|
234
|
+
return 1 - (7.5625 * (p -= 2.25 / 2.75) * p + 0.9375);
|
235
|
+
}
|
236
|
+
return 1 - (7.5625 * (p -= 2.625 / 2.75) * p + 0.984375);
|
237
|
+
}),
|
238
|
+
_create("BounceInOut", function(p) {
|
239
|
+
var invert = (p < 0.5);
|
240
|
+
if (invert) {
|
241
|
+
p = 1 - (p * 2);
|
242
|
+
} else {
|
243
|
+
p = (p * 2) - 1;
|
244
|
+
}
|
245
|
+
if (p < 1 / 2.75) {
|
246
|
+
p = 7.5625 * p * p;
|
247
|
+
} else if (p < 2 / 2.75) {
|
248
|
+
p = 7.5625 * (p -= 1.5 / 2.75) * p + 0.75;
|
249
|
+
} else if (p < 2.5 / 2.75) {
|
250
|
+
p = 7.5625 * (p -= 2.25 / 2.75) * p + 0.9375;
|
251
|
+
} else {
|
252
|
+
p = 7.5625 * (p -= 2.625 / 2.75) * p + 0.984375;
|
253
|
+
}
|
254
|
+
return invert ? (1 - p) * 0.5 : p * 0.5 + 0.5;
|
255
|
+
})
|
256
|
+
);
|
257
|
+
|
258
|
+
|
259
|
+
//CIRC
|
260
|
+
_wrap("Circ",
|
261
|
+
_create("CircOut", function(p) {
|
262
|
+
return Math.sqrt(1 - (p = p - 1) * p);
|
263
|
+
}),
|
264
|
+
_create("CircIn", function(p) {
|
265
|
+
return -(Math.sqrt(1 - (p * p)) - 1);
|
266
|
+
}),
|
267
|
+
_create("CircInOut", function(p) {
|
268
|
+
return ((p*=2) < 1) ? -0.5 * (Math.sqrt(1 - p * p) - 1) : 0.5 * (Math.sqrt(1 - (p -= 2) * p) + 1);
|
269
|
+
})
|
270
|
+
);
|
271
|
+
|
272
|
+
|
273
|
+
//Elastic
|
274
|
+
_createElastic = function(n, f, def) {
|
275
|
+
var C = _class("easing." + n, function(amplitude, period) {
|
276
|
+
this._p1 = amplitude || 1;
|
277
|
+
this._p2 = period || def;
|
278
|
+
this._p3 = this._p2 / _2PI * (Math.asin(1 / this._p1) || 0);
|
279
|
+
}, true),
|
280
|
+
p = C.prototype = new Ease();
|
281
|
+
p.constructor = C;
|
282
|
+
p.getRatio = f;
|
283
|
+
p.config = function(amplitude, period) {
|
284
|
+
return new C(amplitude, period);
|
285
|
+
};
|
286
|
+
return C;
|
287
|
+
};
|
288
|
+
_wrap("Elastic",
|
289
|
+
_createElastic("ElasticOut", function(p) {
|
290
|
+
return this._p1 * Math.pow(2, -10 * p) * Math.sin( (p - this._p3) * _2PI / this._p2 ) + 1;
|
291
|
+
}, 0.3),
|
292
|
+
_createElastic("ElasticIn", function(p) {
|
293
|
+
return -(this._p1 * Math.pow(2, 10 * (p -= 1)) * Math.sin( (p - this._p3) * _2PI / this._p2 ));
|
294
|
+
}, 0.3),
|
295
|
+
_createElastic("ElasticInOut", function(p) {
|
296
|
+
return ((p *= 2) < 1) ? -0.5 * (this._p1 * Math.pow(2, 10 * (p -= 1)) * Math.sin( (p - this._p3) * _2PI / this._p2)) : this._p1 * Math.pow(2, -10 *(p -= 1)) * Math.sin( (p - this._p3) * _2PI / this._p2 ) *0.5 + 1;
|
297
|
+
}, 0.45)
|
298
|
+
);
|
299
|
+
|
300
|
+
|
301
|
+
//Expo
|
302
|
+
_wrap("Expo",
|
303
|
+
_create("ExpoOut", function(p) {
|
304
|
+
return 1 - Math.pow(2, -10 * p);
|
305
|
+
}),
|
306
|
+
_create("ExpoIn", function(p) {
|
307
|
+
return Math.pow(2, 10 * (p - 1)) - 0.001;
|
308
|
+
}),
|
309
|
+
_create("ExpoInOut", function(p) {
|
310
|
+
return ((p *= 2) < 1) ? 0.5 * Math.pow(2, 10 * (p - 1)) : 0.5 * (2 - Math.pow(2, -10 * (p - 1)));
|
311
|
+
})
|
312
|
+
);
|
313
|
+
|
314
|
+
|
315
|
+
//Sine
|
316
|
+
_wrap("Sine",
|
317
|
+
_create("SineOut", function(p) {
|
318
|
+
return Math.sin(p * _HALF_PI);
|
319
|
+
}),
|
320
|
+
_create("SineIn", function(p) {
|
321
|
+
return -Math.cos(p * _HALF_PI) + 1;
|
322
|
+
}),
|
323
|
+
_create("SineInOut", function(p) {
|
324
|
+
return -0.5 * (Math.cos(Math.PI * p) - 1);
|
325
|
+
})
|
326
|
+
);
|
327
|
+
|
328
|
+
_class("easing.EaseLookup", {
|
329
|
+
find:function(s) {
|
330
|
+
return Ease.map[s];
|
331
|
+
}
|
332
|
+
}, true);
|
333
|
+
|
334
|
+
//register the non-standard eases
|
335
|
+
_easeReg(w.SlowMo, "SlowMo", "ease,");
|
336
|
+
_easeReg(RoughEase, "RoughEase", "ease,");
|
337
|
+
_easeReg(SteppedEase, "SteppedEase", "ease,");
|
338
|
+
|
339
|
+
return Back;
|
340
|
+
|
341
|
+
}, true);
|
342
|
+
|
343
|
+
}); if (window._gsDefine) { window._gsQueue.pop()(); }
|
@@ -0,0 +1,167 @@
|
|
1
|
+
/*!
|
2
|
+
* VERSION: 0.1.6
|
3
|
+
* DATE: 2013-02-13
|
4
|
+
* UPDATES AND DOCS AT: http://www.greensock.com/jquery-gsap-plugin/
|
5
|
+
*
|
6
|
+
* Requires TweenLite version 1.8.0 or higher and CSSPlugin.
|
7
|
+
*
|
8
|
+
* @license Copyright (c) 2014, GreenSock. All rights reserved.
|
9
|
+
* This work is subject to the terms at http://www.greensock.com/terms_of_use.html or for
|
10
|
+
* Club GreenSock members, the software agreement that was issued with your membership.
|
11
|
+
*
|
12
|
+
* @author: Jack Doyle, jack@greensock.com
|
13
|
+
*/
|
14
|
+
(function($) {
|
15
|
+
"use strict";
|
16
|
+
|
17
|
+
var _animate = $.fn.animate,
|
18
|
+
_stop = $.fn.stop,
|
19
|
+
_enabled = true,
|
20
|
+
TweenLite, CSSPlugin, _warned,
|
21
|
+
_dequeue = function(func, next) {
|
22
|
+
if (typeof(func) === "function") {
|
23
|
+
this.each(func);
|
24
|
+
}
|
25
|
+
next();
|
26
|
+
},
|
27
|
+
_addCallback = function(type, func, obj, vars, next) {
|
28
|
+
next = (typeof(next) === "function") ? next : null;
|
29
|
+
func = (typeof(func) === "function") ? func : null;
|
30
|
+
if (!func && !next) {
|
31
|
+
return;
|
32
|
+
}
|
33
|
+
vars[type] = next ? _dequeue : obj.each;
|
34
|
+
vars[type + "Scope"] = obj;
|
35
|
+
vars[type + "Params"] = next ? [func, next] : [func];
|
36
|
+
},
|
37
|
+
_reserved = {overwrite:1, delay:1, useFrames:1, runBackwards:1, easeParams:1, yoyo:1, immediateRender:1, repeat:1, repeatDelay:1, autoCSS:1},
|
38
|
+
_copyCriticalReserved = function(main, sub) {
|
39
|
+
for (var p in _reserved) {
|
40
|
+
if (_reserved[p] && main[p] !== undefined) {
|
41
|
+
sub[p] = main[p];
|
42
|
+
}
|
43
|
+
}
|
44
|
+
},
|
45
|
+
_createEase = function(ease) {
|
46
|
+
return function(p) {
|
47
|
+
return ease.getRatio(p);
|
48
|
+
};
|
49
|
+
},
|
50
|
+
_easeMap = {},
|
51
|
+
_init = function() {
|
52
|
+
var globals = window.GreenSockGlobals || window,
|
53
|
+
version, stale, p;
|
54
|
+
TweenLite = globals.TweenMax || globals.TweenLite; //we prioritize TweenMax if it's loaded so that we can accommodate special features like repeat, yoyo, repeatDelay, etc.
|
55
|
+
if (TweenLite) {
|
56
|
+
version = (TweenLite.version + ".0.0").split("."); //in case an old version of TweenLite is used that had a numeric version like 1.68 instead of a string like "1.6.8"
|
57
|
+
stale = !(Number(version[0]) > 0 && Number(version[1]) > 7);
|
58
|
+
globals = globals.com.greensock;
|
59
|
+
CSSPlugin = globals.plugins.CSSPlugin;
|
60
|
+
_easeMap = globals.easing.Ease.map || {}; //don't do just window.Ease or window.CSSPlugin because some other libraries like EaselJS/TweenJS use those same names and there could be a collision.
|
61
|
+
}
|
62
|
+
if (!TweenLite || !CSSPlugin || stale) {
|
63
|
+
TweenLite = null;
|
64
|
+
if (!_warned && window.console) {
|
65
|
+
window.console.log("The jquery.gsap.js plugin requires the TweenMax (or at least TweenLite and CSSPlugin) JavaScript file(s)." + (stale ? " Version " + version.join(".") + " is too old." : ""));
|
66
|
+
_warned = true;
|
67
|
+
}
|
68
|
+
return;
|
69
|
+
}
|
70
|
+
if ($.easing) {
|
71
|
+
for (p in _easeMap) {
|
72
|
+
$.easing[p] = _createEase(_easeMap[p]);
|
73
|
+
}
|
74
|
+
_init = false;
|
75
|
+
}
|
76
|
+
};
|
77
|
+
|
78
|
+
$.fn.animate = function(prop, speed, easing, callback) {
|
79
|
+
prop = prop || {};
|
80
|
+
if (_init) {
|
81
|
+
_init();
|
82
|
+
if (!TweenLite || !CSSPlugin) {
|
83
|
+
return _animate.call(this, prop, speed, easing, callback);
|
84
|
+
}
|
85
|
+
}
|
86
|
+
if (!_enabled || prop.skipGSAP === true || (typeof(speed) === "object" && typeof(speed.step) === "function") || prop.scrollTop != null || prop.scrollLeft != null) { //we don't support the "step" feature because it's too costly performance-wise, so fall back to the native animate() call if we sense one. Same with scrollTop and scrollLeft which are handled in a special way in jQuery.
|
87
|
+
return _animate.call(this, prop, speed, easing, callback);
|
88
|
+
}
|
89
|
+
var config = $.speed(speed, easing, callback),
|
90
|
+
vars = {ease:(_easeMap[config.easing] || ((config.easing === false) ? _easeMap.linear : _easeMap.swing))},
|
91
|
+
obj = this,
|
92
|
+
specEasing = (typeof(speed) === "object") ? speed.specialEasing : null,
|
93
|
+
val, p, doAnimation, specEasingVars;
|
94
|
+
|
95
|
+
for (p in prop) {
|
96
|
+
val = prop[p];
|
97
|
+
if (val instanceof Array && _easeMap[val[1]]) {
|
98
|
+
specEasing = specEasing || {};
|
99
|
+
specEasing[p] = val[1];
|
100
|
+
val = val[0];
|
101
|
+
}
|
102
|
+
if (val === "toggle" || val === "hide" || val === "show") {
|
103
|
+
return _animate.call(this, prop, speed, easing, callback);
|
104
|
+
} else {
|
105
|
+
vars[(p.indexOf("-") === -1) ? p : $.camelCase(p)] = val;
|
106
|
+
}
|
107
|
+
}
|
108
|
+
|
109
|
+
if (specEasing) {
|
110
|
+
specEasingVars = [];
|
111
|
+
for (p in specEasing) {
|
112
|
+
val = specEasingVars[specEasingVars.length] = {};
|
113
|
+
_copyCriticalReserved(vars, val);
|
114
|
+
val.ease = (_easeMap[specEasing[p]] || vars.ease);
|
115
|
+
if (p.indexOf("-") !== -1) {
|
116
|
+
p = $.camelCase(p);
|
117
|
+
}
|
118
|
+
val[p] = vars[p];
|
119
|
+
}
|
120
|
+
if (specEasingVars.length === 0) {
|
121
|
+
specEasingVars = null;
|
122
|
+
}
|
123
|
+
}
|
124
|
+
|
125
|
+
doAnimation = function(next) {
|
126
|
+
if (specEasingVars) {
|
127
|
+
var i = specEasingVars.length;
|
128
|
+
while (--i > -1) {
|
129
|
+
TweenLite.to(obj, $.fx.off ? 0 : config.duration / 1000, specEasingVars[i]);
|
130
|
+
}
|
131
|
+
}
|
132
|
+
_addCallback("onComplete", config.old, obj, vars, next);
|
133
|
+
TweenLite.to(obj, $.fx.off ? 0 : config.duration / 1000, vars);
|
134
|
+
};
|
135
|
+
|
136
|
+
if (config.queue !== false) {
|
137
|
+
obj.queue(config.queue, doAnimation);
|
138
|
+
} else {
|
139
|
+
doAnimation();
|
140
|
+
}
|
141
|
+
|
142
|
+
return obj;
|
143
|
+
};
|
144
|
+
|
145
|
+
|
146
|
+
$.fn.stop = function(clearQueue, gotoEnd) {
|
147
|
+
_stop.call(this, clearQueue, gotoEnd);
|
148
|
+
if (TweenLite) {
|
149
|
+
if (gotoEnd) {
|
150
|
+
var tweens = TweenLite.getTweensOf(this),
|
151
|
+
i = tweens.length,
|
152
|
+
progress;
|
153
|
+
while (--i > -1) {
|
154
|
+
progress = tweens[i].totalTime() / tweens[i].totalDuration();
|
155
|
+
if (progress > 0 && progress < 1) {
|
156
|
+
tweens[i].seek(tweens[i].totalDuration());
|
157
|
+
}
|
158
|
+
}
|
159
|
+
}
|
160
|
+
TweenLite.killTweensOf(this);
|
161
|
+
}
|
162
|
+
return this;
|
163
|
+
};
|
164
|
+
|
165
|
+
$.gsap = {enabled:function(value) {_enabled = value;}, version:"0.1.6"};
|
166
|
+
|
167
|
+
}(jQuery));
|