1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | ;(function (factory) {
|
8 |
|
9 | if (typeof require === "function" && typeof exports === "object" ) {
|
10 | module.exports = factory();
|
11 |
|
12 | } else if (typeof define === "function" && define.amd) {
|
13 | define([ "velocity" ], factory);
|
14 |
|
15 | } else {
|
16 | factory();
|
17 | }
|
18 | }(function() {
|
19 | return function (global, window, document, undefined) {
|
20 |
|
21 | |
22 |
|
23 |
|
24 |
|
25 | if (!global.Velocity || !global.Velocity.Utilities) {
|
26 | window.console && console.log("Velocity UI Pack: Velocity must be loaded first. Aborting.");
|
27 | return;
|
28 | } else {
|
29 | var Velocity = global.Velocity,
|
30 | $ = Velocity.Utilities;
|
31 | }
|
32 |
|
33 | var velocityVersion = Velocity.version,
|
34 | requiredVersion = { major: 1, minor: 1, patch: 0 };
|
35 |
|
36 | function greaterSemver (primary, secondary) {
|
37 | var versionInts = [];
|
38 |
|
39 | if (!primary || !secondary) { return false; }
|
40 |
|
41 | $.each([ primary, secondary ], function(i, versionObject) {
|
42 | var versionIntsComponents = [];
|
43 |
|
44 | $.each(versionObject, function(component, value) {
|
45 | while (value.toString().length < 5) {
|
46 | value = "0" + value;
|
47 | }
|
48 | versionIntsComponents.push(value);
|
49 | });
|
50 |
|
51 | versionInts.push(versionIntsComponents.join(""))
|
52 | });
|
53 |
|
54 | return (parseFloat(versionInts[0]) > parseFloat(versionInts[1]));
|
55 | }
|
56 |
|
57 | if (greaterSemver(requiredVersion, velocityVersion)){
|
58 | var abortError = "Velocity UI Pack: You need to update Velocity (jquery.velocity.js) to a newer version. Visit http://github.com/julianshapiro/velocity.";
|
59 | alert(abortError);
|
60 | throw new Error(abortError);
|
61 | }
|
62 |
|
63 | |
64 |
|
65 |
|
66 |
|
67 |
|
68 | Velocity.RegisterEffect = Velocity.RegisterUI = function (effectName, properties) {
|
69 |
|
70 | function animateParentHeight (elements, direction, totalDuration, stagger) {
|
71 | var totalHeightDelta = 0,
|
72 | parentNode;
|
73 |
|
74 |
|
75 | $.each(elements.nodeType ? [ elements ] : elements, function(i, element) {
|
76 | if (stagger) {
|
77 |
|
78 | totalDuration += i * stagger;
|
79 | }
|
80 |
|
81 | parentNode = element.parentNode;
|
82 |
|
83 | $.each([ "height", "paddingTop", "paddingBottom", "marginTop", "marginBottom"], function(i, property) {
|
84 | totalHeightDelta += parseFloat(Velocity.CSS.getPropertyValue(element, property));
|
85 | });
|
86 | });
|
87 |
|
88 |
|
89 | Velocity.animate(
|
90 | parentNode,
|
91 | { height: (direction === "In" ? "+" : "-") + "=" + totalHeightDelta },
|
92 | { queue: false, easing: "ease-in-out", duration: totalDuration * (direction === "In" ? 0.6 : 1) }
|
93 | );
|
94 | }
|
95 |
|
96 |
|
97 | Velocity.Redirects[effectName] = function (element, redirectOptions, elementsIndex, elementsSize, elements, promiseData) {
|
98 | var finalElement = (elementsIndex === elementsSize - 1);
|
99 |
|
100 | if (typeof properties.defaultDuration === "function") {
|
101 | properties.defaultDuration = properties.defaultDuration.call(elements, elements);
|
102 | } else {
|
103 | properties.defaultDuration = parseFloat(properties.defaultDuration);
|
104 | }
|
105 |
|
106 |
|
107 | for (var callIndex = 0; callIndex < properties.calls.length; callIndex++) {
|
108 | var call = properties.calls[callIndex],
|
109 | propertyMap = call[0],
|
110 | redirectDuration = (redirectOptions.duration || properties.defaultDuration || 1000),
|
111 | durationPercentage = call[1],
|
112 | callOptions = call[2] || {},
|
113 | opts = {};
|
114 |
|
115 |
|
116 | opts.duration = redirectDuration * (durationPercentage || 1);
|
117 | opts.queue = redirectOptions.queue || "";
|
118 | opts.easing = callOptions.easing || "ease";
|
119 | opts.delay = parseFloat(callOptions.delay) || 0;
|
120 | opts._cacheValues = callOptions._cacheValues || true;
|
121 |
|
122 |
|
123 | if (callIndex === 0) {
|
124 |
|
125 | opts.delay += (parseFloat(redirectOptions.delay) || 0);
|
126 |
|
127 | if (elementsIndex === 0) {
|
128 | opts.begin = function() {
|
129 |
|
130 | redirectOptions.begin && redirectOptions.begin.call(elements, elements);
|
131 |
|
132 | var direction = effectName.match(/(In|Out)$/);
|
133 |
|
134 | |
135 |
|
136 | if ((direction && direction[0] === "In") && propertyMap.opacity !== undefined) {
|
137 | $.each(elements.nodeType ? [ elements ] : elements, function(i, element) {
|
138 | Velocity.CSS.setPropertyValue(element, "opacity", 0);
|
139 | });
|
140 | }
|
141 |
|
142 |
|
143 | if (redirectOptions.animateParentHeight && direction) {
|
144 | animateParentHeight(elements, direction[0], redirectDuration + opts.delay, redirectOptions.stagger);
|
145 | }
|
146 | }
|
147 | }
|
148 |
|
149 |
|
150 | if (redirectOptions.display !== null) {
|
151 | if (redirectOptions.display !== undefined && redirectOptions.display !== "none") {
|
152 | opts.display = redirectOptions.display;
|
153 | } else if (/In$/.test(effectName)) {
|
154 |
|
155 | var defaultDisplay = Velocity.CSS.Values.getDisplayType(element);
|
156 | opts.display = (defaultDisplay === "inline") ? "inline-block" : defaultDisplay;
|
157 | }
|
158 | }
|
159 |
|
160 | if (redirectOptions.visibility && redirectOptions.visibility !== "hidden") {
|
161 | opts.visibility = redirectOptions.visibility;
|
162 | }
|
163 | }
|
164 |
|
165 |
|
166 | if (callIndex === properties.calls.length - 1) {
|
167 |
|
168 | function injectFinalCallbacks () {
|
169 | if ((redirectOptions.display === undefined || redirectOptions.display === "none") && /Out$/.test(effectName)) {
|
170 | $.each(elements.nodeType ? [ elements ] : elements, function(i, element) {
|
171 | Velocity.CSS.setPropertyValue(element, "display", "none");
|
172 | });
|
173 | }
|
174 |
|
175 | redirectOptions.complete && redirectOptions.complete.call(elements, elements);
|
176 |
|
177 | if (promiseData) {
|
178 | promiseData.resolver(elements || element);
|
179 | }
|
180 | }
|
181 |
|
182 | opts.complete = function() {
|
183 | if (properties.reset) {
|
184 | for (var resetProperty in properties.reset) {
|
185 | var resetValue = properties.reset[resetProperty];
|
186 |
|
187 | |
188 |
|
189 |
|
190 | if (Velocity.CSS.Hooks.registered[resetProperty] === undefined && (typeof resetValue === "string" || typeof resetValue === "number")) {
|
191 | properties.reset[resetProperty] = [ properties.reset[resetProperty], properties.reset[resetProperty] ];
|
192 | }
|
193 | }
|
194 |
|
195 |
|
196 | var resetOptions = { duration: 0, queue: false };
|
197 |
|
198 |
|
199 | if (finalElement) {
|
200 | resetOptions.complete = injectFinalCallbacks;
|
201 | }
|
202 |
|
203 | Velocity.animate(element, properties.reset, resetOptions);
|
204 |
|
205 | } else if (finalElement) {
|
206 | injectFinalCallbacks();
|
207 | }
|
208 | };
|
209 |
|
210 | if (redirectOptions.visibility === "hidden") {
|
211 | opts.visibility = redirectOptions.visibility;
|
212 | }
|
213 | }
|
214 |
|
215 | Velocity.animate(element, propertyMap, opts);
|
216 | }
|
217 | };
|
218 |
|
219 |
|
220 | return Velocity;
|
221 | };
|
222 |
|
223 | |
224 |
|
225 |
|
226 |
|
227 |
|
228 |
|
229 | Velocity.RegisterEffect.packagedEffects =
|
230 | {
|
231 |
|
232 | "callout.bounce": {
|
233 | defaultDuration: 550,
|
234 | calls: [
|
235 | [ { translateY: -30 }, 0.25 ],
|
236 | [ { translateY: 0 }, 0.125 ],
|
237 | [ { translateY: -15 }, 0.125 ],
|
238 | [ { translateY: 0 }, 0.25 ]
|
239 | ]
|
240 | },
|
241 |
|
242 | "callout.shake": {
|
243 | defaultDuration: 800,
|
244 | calls: [
|
245 | [ { translateX: -11 }, 0.125 ],
|
246 | [ { translateX: 11 }, 0.125 ],
|
247 | [ { translateX: -11 }, 0.125 ],
|
248 | [ { translateX: 11 }, 0.125 ],
|
249 | [ { translateX: -11 }, 0.125 ],
|
250 | [ { translateX: 11 }, 0.125 ],
|
251 | [ { translateX: -11 }, 0.125 ],
|
252 | [ { translateX: 0 }, 0.125 ]
|
253 | ]
|
254 | },
|
255 |
|
256 | "callout.flash": {
|
257 | defaultDuration: 1100,
|
258 | calls: [
|
259 | [ { opacity: [ 0, "easeInOutQuad", 1 ] }, 0.25 ],
|
260 | [ { opacity: [ 1, "easeInOutQuad" ] }, 0.25 ],
|
261 | [ { opacity: [ 0, "easeInOutQuad" ] }, 0.25 ],
|
262 | [ { opacity: [ 1, "easeInOutQuad" ] }, 0.25 ]
|
263 | ]
|
264 | },
|
265 |
|
266 | "callout.pulse": {
|
267 | defaultDuration: 825,
|
268 | calls: [
|
269 | [ { scaleX: 1.1, scaleY: 1.1 }, 0.50 ],
|
270 | [ { scaleX: 1, scaleY: 1 }, 0.50 ]
|
271 | ]
|
272 | },
|
273 |
|
274 | "callout.swing": {
|
275 | defaultDuration: 950,
|
276 | calls: [
|
277 | [ { rotateZ: 15 }, 0.20 ],
|
278 | [ { rotateZ: -10 }, 0.20 ],
|
279 | [ { rotateZ: 5 }, 0.20 ],
|
280 | [ { rotateZ: -5 }, 0.20 ],
|
281 | [ { rotateZ: 0 }, 0.20 ]
|
282 | ]
|
283 | },
|
284 |
|
285 | "callout.tada": {
|
286 | defaultDuration: 1000,
|
287 | calls: [
|
288 | [ { scaleX: 0.9, scaleY: 0.9, rotateZ: -3 }, 0.10 ],
|
289 | [ { scaleX: 1.1, scaleY: 1.1, rotateZ: 3 }, 0.10 ],
|
290 | [ { scaleX: 1.1, scaleY: 1.1, rotateZ: -3 }, 0.10 ],
|
291 | [ "reverse", 0.125 ],
|
292 | [ "reverse", 0.125 ],
|
293 | [ "reverse", 0.125 ],
|
294 | [ "reverse", 0.125 ],
|
295 | [ "reverse", 0.125 ],
|
296 | [ { scaleX: 1, scaleY: 1, rotateZ: 0 }, 0.20 ]
|
297 | ]
|
298 | },
|
299 | "transition.fadeIn": {
|
300 | defaultDuration: 500,
|
301 | calls: [
|
302 | [ { opacity: [ 1, 0 ] } ]
|
303 | ]
|
304 | },
|
305 | "transition.fadeOut": {
|
306 | defaultDuration: 500,
|
307 | calls: [
|
308 | [ { opacity: [ 0, 1 ] } ]
|
309 | ]
|
310 | },
|
311 |
|
312 | "transition.flipXIn": {
|
313 | defaultDuration: 700,
|
314 | calls: [
|
315 | [ { opacity: [ 1, 0 ], transformPerspective: [ 800, 800 ], rotateY: [ 0, -55 ] } ]
|
316 | ],
|
317 | reset: { transformPerspective: 0 }
|
318 | },
|
319 |
|
320 | "transition.flipXOut": {
|
321 | defaultDuration: 700,
|
322 | calls: [
|
323 | [ { opacity: [ 0, 1 ], transformPerspective: [ 800, 800 ], rotateY: 55 } ]
|
324 | ],
|
325 | reset: { transformPerspective: 0, rotateY: 0 }
|
326 | },
|
327 |
|
328 | "transition.flipYIn": {
|
329 | defaultDuration: 800,
|
330 | calls: [
|
331 | [ { opacity: [ 1, 0 ], transformPerspective: [ 800, 800 ], rotateX: [ 0, -45 ] } ]
|
332 | ],
|
333 | reset: { transformPerspective: 0 }
|
334 | },
|
335 |
|
336 | "transition.flipYOut": {
|
337 | defaultDuration: 800,
|
338 | calls: [
|
339 | [ { opacity: [ 0, 1 ], transformPerspective: [ 800, 800 ], rotateX: 25 } ]
|
340 | ],
|
341 | reset: { transformPerspective: 0, rotateX: 0 }
|
342 | },
|
343 |
|
344 |
|
345 | "transition.flipBounceXIn": {
|
346 | defaultDuration: 900,
|
347 | calls: [
|
348 | [ { opacity: [ 0.725, 0 ], transformPerspective: [ 400, 400 ], rotateY: [ -10, 90 ] }, 0.50 ],
|
349 | [ { opacity: 0.80, rotateY: 10 }, 0.25 ],
|
350 | [ { opacity: 1, rotateY: 0 }, 0.25 ]
|
351 | ],
|
352 | reset: { transformPerspective: 0 }
|
353 | },
|
354 |
|
355 |
|
356 | "transition.flipBounceXOut": {
|
357 | defaultDuration: 800,
|
358 | calls: [
|
359 | [ { opacity: [ 0.9, 1 ], transformPerspective: [ 400, 400 ], rotateY: -10 }, 0.50 ],
|
360 | [ { opacity: 0, rotateY: 90 }, 0.50 ]
|
361 | ],
|
362 | reset: { transformPerspective: 0, rotateY: 0 }
|
363 | },
|
364 |
|
365 |
|
366 | "transition.flipBounceYIn": {
|
367 | defaultDuration: 850,
|
368 | calls: [
|
369 | [ { opacity: [ 0.725, 0 ], transformPerspective: [ 400, 400 ], rotateX: [ -10, 90 ] }, 0.50 ],
|
370 | [ { opacity: 0.80, rotateX: 10 }, 0.25 ],
|
371 | [ { opacity: 1, rotateX: 0 }, 0.25 ]
|
372 | ],
|
373 | reset: { transformPerspective: 0 }
|
374 | },
|
375 |
|
376 |
|
377 | "transition.flipBounceYOut": {
|
378 | defaultDuration: 800,
|
379 | calls: [
|
380 | [ { opacity: [ 0.9, 1 ], transformPerspective: [ 400, 400 ], rotateX: -15 }, 0.50 ],
|
381 | [ { opacity: 0, rotateX: 90 }, 0.50 ]
|
382 | ],
|
383 | reset: { transformPerspective: 0, rotateX: 0 }
|
384 | },
|
385 |
|
386 | "transition.swoopIn": {
|
387 | defaultDuration: 850,
|
388 | calls: [
|
389 | [ { opacity: [ 1, 0 ], transformOriginX: [ "100%", "50%" ], transformOriginY: [ "100%", "100%" ], scaleX: [ 1, 0 ], scaleY: [ 1, 0 ], translateX: [ 0, -700 ], translateZ: 0 } ]
|
390 | ],
|
391 | reset: { transformOriginX: "50%", transformOriginY: "50%" }
|
392 | },
|
393 |
|
394 | "transition.swoopOut": {
|
395 | defaultDuration: 850,
|
396 | calls: [
|
397 | [ { opacity: [ 0, 1 ], transformOriginX: [ "50%", "100%" ], transformOriginY: [ "100%", "100%" ], scaleX: 0, scaleY: 0, translateX: -700, translateZ: 0 } ]
|
398 | ],
|
399 | reset: { transformOriginX: "50%", transformOriginY: "50%", scaleX: 1, scaleY: 1, translateX: 0 }
|
400 | },
|
401 |
|
402 |
|
403 | "transition.whirlIn": {
|
404 | defaultDuration: 850,
|
405 | calls: [
|
406 | [ { opacity: [ 1, 0 ], transformOriginX: [ "50%", "50%" ], transformOriginY: [ "50%", "50%" ], scaleX: [ 1, 0 ], scaleY: [ 1, 0 ], rotateY: [ 0, 160 ] }, 1, { easing: "easeInOutSine" } ]
|
407 | ]
|
408 | },
|
409 |
|
410 |
|
411 | "transition.whirlOut": {
|
412 | defaultDuration: 750,
|
413 | calls: [
|
414 | [ { opacity: [ 0, "easeInOutQuint", 1 ], transformOriginX: [ "50%", "50%" ], transformOriginY: [ "50%", "50%" ], scaleX: 0, scaleY: 0, rotateY: 160 }, 1, { easing: "swing" } ]
|
415 | ],
|
416 | reset: { scaleX: 1, scaleY: 1, rotateY: 0 }
|
417 | },
|
418 | "transition.shrinkIn": {
|
419 | defaultDuration: 750,
|
420 | calls: [
|
421 | [ { opacity: [ 1, 0 ], transformOriginX: [ "50%", "50%" ], transformOriginY: [ "50%", "50%" ], scaleX: [ 1, 1.5 ], scaleY: [ 1, 1.5 ], translateZ: 0 } ]
|
422 | ]
|
423 | },
|
424 | "transition.shrinkOut": {
|
425 | defaultDuration: 600,
|
426 | calls: [
|
427 | [ { opacity: [ 0, 1 ], transformOriginX: [ "50%", "50%" ], transformOriginY: [ "50%", "50%" ], scaleX: 1.3, scaleY: 1.3, translateZ: 0 } ]
|
428 | ],
|
429 | reset: { scaleX: 1, scaleY: 1 }
|
430 | },
|
431 | "transition.expandIn": {
|
432 | defaultDuration: 700,
|
433 | calls: [
|
434 | [ { opacity: [ 1, 0 ], transformOriginX: [ "50%", "50%" ], transformOriginY: [ "50%", "50%" ], scaleX: [ 1, 0.625 ], scaleY: [ 1, 0.625 ], translateZ: 0 } ]
|
435 | ]
|
436 | },
|
437 | "transition.expandOut": {
|
438 | defaultDuration: 700,
|
439 | calls: [
|
440 | [ { opacity: [ 0, 1 ], transformOriginX: [ "50%", "50%" ], transformOriginY: [ "50%", "50%" ], scaleX: 0.5, scaleY: 0.5, translateZ: 0 } ]
|
441 | ],
|
442 | reset: { scaleX: 1, scaleY: 1 }
|
443 | },
|
444 |
|
445 | "transition.bounceIn": {
|
446 | defaultDuration: 800,
|
447 | calls: [
|
448 | [ { opacity: [ 1, 0 ], scaleX: [ 1.05, 0.3 ], scaleY: [ 1.05, 0.3 ] }, 0.40 ],
|
449 | [ { scaleX: 0.9, scaleY: 0.9, translateZ: 0 }, 0.20 ],
|
450 | [ { scaleX: 1, scaleY: 1 }, 0.50 ]
|
451 | ]
|
452 | },
|
453 |
|
454 | "transition.bounceOut": {
|
455 | defaultDuration: 800,
|
456 | calls: [
|
457 | [ { scaleX: 0.95, scaleY: 0.95 }, 0.35 ],
|
458 | [ { scaleX: 1.1, scaleY: 1.1, translateZ: 0 }, 0.35 ],
|
459 | [ { opacity: [ 0, 1 ], scaleX: 0.3, scaleY: 0.3 }, 0.30 ]
|
460 | ],
|
461 | reset: { scaleX: 1, scaleY: 1 }
|
462 | },
|
463 |
|
464 | "transition.bounceUpIn": {
|
465 | defaultDuration: 800,
|
466 | calls: [
|
467 | [ { opacity: [ 1, 0 ], translateY: [ -30, 1000 ] }, 0.60, { easing: "easeOutCirc" } ],
|
468 | [ { translateY: 10 }, 0.20 ],
|
469 | [ { translateY: 0 }, 0.20 ]
|
470 | ]
|
471 | },
|
472 |
|
473 | "transition.bounceUpOut": {
|
474 | defaultDuration: 1000,
|
475 | calls: [
|
476 | [ { translateY: 20 }, 0.20 ],
|
477 | [ { opacity: [ 0, "easeInCirc", 1 ], translateY: -1000 }, 0.80 ]
|
478 | ],
|
479 | reset: { translateY: 0 }
|
480 | },
|
481 |
|
482 | "transition.bounceDownIn": {
|
483 | defaultDuration: 800,
|
484 | calls: [
|
485 | [ { opacity: [ 1, 0 ], translateY: [ 30, -1000 ] }, 0.60, { easing: "easeOutCirc" } ],
|
486 | [ { translateY: -10 }, 0.20 ],
|
487 | [ { translateY: 0 }, 0.20 ]
|
488 | ]
|
489 | },
|
490 |
|
491 | "transition.bounceDownOut": {
|
492 | defaultDuration: 1000,
|
493 | calls: [
|
494 | [ { translateY: -20 }, 0.20 ],
|
495 | [ { opacity: [ 0, "easeInCirc", 1 ], translateY: 1000 }, 0.80 ]
|
496 | ],
|
497 | reset: { translateY: 0 }
|
498 | },
|
499 |
|
500 | "transition.bounceLeftIn": {
|
501 | defaultDuration: 750,
|
502 | calls: [
|
503 | [ { opacity: [ 1, 0 ], translateX: [ 30, -1250 ] }, 0.60, { easing: "easeOutCirc" } ],
|
504 | [ { translateX: -10 }, 0.20 ],
|
505 | [ { translateX: 0 }, 0.20 ]
|
506 | ]
|
507 | },
|
508 |
|
509 | "transition.bounceLeftOut": {
|
510 | defaultDuration: 750,
|
511 | calls: [
|
512 | [ { translateX: 30 }, 0.20 ],
|
513 | [ { opacity: [ 0, "easeInCirc", 1 ], translateX: -1250 }, 0.80 ]
|
514 | ],
|
515 | reset: { translateX: 0 }
|
516 | },
|
517 |
|
518 | "transition.bounceRightIn": {
|
519 | defaultDuration: 750,
|
520 | calls: [
|
521 | [ { opacity: [ 1, 0 ], translateX: [ -30, 1250 ] }, 0.60, { easing: "easeOutCirc" } ],
|
522 | [ { translateX: 10 }, 0.20 ],
|
523 | [ { translateX: 0 }, 0.20 ]
|
524 | ]
|
525 | },
|
526 |
|
527 | "transition.bounceRightOut": {
|
528 | defaultDuration: 750,
|
529 | calls: [
|
530 | [ { translateX: -30 }, 0.20 ],
|
531 | [ { opacity: [ 0, "easeInCirc", 1 ], translateX: 1250 }, 0.80 ]
|
532 | ],
|
533 | reset: { translateX: 0 }
|
534 | },
|
535 | "transition.slideUpIn": {
|
536 | defaultDuration: 900,
|
537 | calls: [
|
538 | [ { opacity: [ 1, 0 ], translateY: [ 0, 20 ], translateZ: 0 } ]
|
539 | ]
|
540 | },
|
541 | "transition.slideUpOut": {
|
542 | defaultDuration: 900,
|
543 | calls: [
|
544 | [ { opacity: [ 0, 1 ], translateY: -20, translateZ: 0 } ]
|
545 | ],
|
546 | reset: { translateY: 0 }
|
547 | },
|
548 | "transition.slideDownIn": {
|
549 | defaultDuration: 900,
|
550 | calls: [
|
551 | [ { opacity: [ 1, 0 ], translateY: [ 0, -20 ], translateZ: 0 } ]
|
552 | ]
|
553 | },
|
554 | "transition.slideDownOut": {
|
555 | defaultDuration: 900,
|
556 | calls: [
|
557 | [ { opacity: [ 0, 1 ], translateY: 20, translateZ: 0 } ]
|
558 | ],
|
559 | reset: { translateY: 0 }
|
560 | },
|
561 | "transition.slideLeftIn": {
|
562 | defaultDuration: 1000,
|
563 | calls: [
|
564 | [ { opacity: [ 1, 0 ], translateX: [ 0, -20 ], translateZ: 0 } ]
|
565 | ]
|
566 | },
|
567 | "transition.slideLeftOut": {
|
568 | defaultDuration: 1050,
|
569 | calls: [
|
570 | [ { opacity: [ 0, 1 ], translateX: -20, translateZ: 0 } ]
|
571 | ],
|
572 | reset: { translateX: 0 }
|
573 | },
|
574 | "transition.slideRightIn": {
|
575 | defaultDuration: 1000,
|
576 | calls: [
|
577 | [ { opacity: [ 1, 0 ], translateX: [ 0, 20 ], translateZ: 0 } ]
|
578 | ]
|
579 | },
|
580 | "transition.slideRightOut": {
|
581 | defaultDuration: 1050,
|
582 | calls: [
|
583 | [ { opacity: [ 0, 1 ], translateX: 20, translateZ: 0 } ]
|
584 | ],
|
585 | reset: { translateX: 0 }
|
586 | },
|
587 | "transition.slideUpBigIn": {
|
588 | defaultDuration: 850,
|
589 | calls: [
|
590 | [ { opacity: [ 1, 0 ], translateY: [ 0, 75 ], translateZ: 0 } ]
|
591 | ]
|
592 | },
|
593 | "transition.slideUpBigOut": {
|
594 | defaultDuration: 800,
|
595 | calls: [
|
596 | [ { opacity: [ 0, 1 ], translateY: -75, translateZ: 0 } ]
|
597 | ],
|
598 | reset: { translateY: 0 }
|
599 | },
|
600 | "transition.slideDownBigIn": {
|
601 | defaultDuration: 850,
|
602 | calls: [
|
603 | [ { opacity: [ 1, 0 ], translateY: [ 0, -75 ], translateZ: 0 } ]
|
604 | ]
|
605 | },
|
606 | "transition.slideDownBigOut": {
|
607 | defaultDuration: 800,
|
608 | calls: [
|
609 | [ { opacity: [ 0, 1 ], translateY: 75, translateZ: 0 } ]
|
610 | ],
|
611 | reset: { translateY: 0 }
|
612 | },
|
613 | "transition.slideLeftBigIn": {
|
614 | defaultDuration: 800,
|
615 | calls: [
|
616 | [ { opacity: [ 1, 0 ], translateX: [ 0, -75 ], translateZ: 0 } ]
|
617 | ]
|
618 | },
|
619 | "transition.slideLeftBigOut": {
|
620 | defaultDuration: 750,
|
621 | calls: [
|
622 | [ { opacity: [ 0, 1 ], translateX: -75, translateZ: 0 } ]
|
623 | ],
|
624 | reset: { translateX: 0 }
|
625 | },
|
626 | "transition.slideRightBigIn": {
|
627 | defaultDuration: 800,
|
628 | calls: [
|
629 | [ { opacity: [ 1, 0 ], translateX: [ 0, 75 ], translateZ: 0 } ]
|
630 | ]
|
631 | },
|
632 | "transition.slideRightBigOut": {
|
633 | defaultDuration: 750,
|
634 | calls: [
|
635 | [ { opacity: [ 0, 1 ], translateX: 75, translateZ: 0 } ]
|
636 | ],
|
637 | reset: { translateX: 0 }
|
638 | },
|
639 |
|
640 | "transition.perspectiveUpIn": {
|
641 | defaultDuration: 800,
|
642 | calls: [
|
643 | [ { opacity: [ 1, 0 ], transformPerspective: [ 800, 800 ], transformOriginX: [ 0, 0 ], transformOriginY: [ "100%", "100%" ], rotateX: [ 0, -180 ] } ]
|
644 | ]
|
645 | },
|
646 |
|
647 |
|
648 | "transition.perspectiveUpOut": {
|
649 | defaultDuration: 850,
|
650 | calls: [
|
651 | [ { opacity: [ 0, 1 ], transformPerspective: [ 800, 800 ], transformOriginX: [ 0, 0 ], transformOriginY: [ "100%", "100%" ], rotateX: -180 } ]
|
652 | ],
|
653 | reset: { transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%", rotateX: 0 }
|
654 | },
|
655 |
|
656 |
|
657 | "transition.perspectiveDownIn": {
|
658 | defaultDuration: 800,
|
659 | calls: [
|
660 | [ { opacity: [ 1, 0 ], transformPerspective: [ 800, 800 ], transformOriginX: [ 0, 0 ], transformOriginY: [ 0, 0 ], rotateX: [ 0, 180 ] } ]
|
661 | ],
|
662 | reset: { transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%" }
|
663 | },
|
664 |
|
665 |
|
666 | "transition.perspectiveDownOut": {
|
667 | defaultDuration: 850,
|
668 | calls: [
|
669 | [ { opacity: [ 0, 1 ], transformPerspective: [ 800, 800 ], transformOriginX: [ 0, 0 ], transformOriginY: [ 0, 0 ], rotateX: 180 } ]
|
670 | ],
|
671 | reset: { transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%", rotateX: 0 }
|
672 | },
|
673 |
|
674 |
|
675 | "transition.perspectiveLeftIn": {
|
676 | defaultDuration: 950,
|
677 | calls: [
|
678 | [ { opacity: [ 1, 0 ], transformPerspective: [ 2000, 2000 ], transformOriginX: [ 0, 0 ], transformOriginY: [ 0, 0 ], rotateY: [ 0, -180 ] } ]
|
679 | ],
|
680 | reset: { transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%" }
|
681 | },
|
682 |
|
683 |
|
684 | "transition.perspectiveLeftOut": {
|
685 | defaultDuration: 950,
|
686 | calls: [
|
687 | [ { opacity: [ 0, 1 ], transformPerspective: [ 2000, 2000 ], transformOriginX: [ 0, 0 ], transformOriginY: [ 0, 0 ], rotateY: -180 } ]
|
688 | ],
|
689 | reset: { transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%", rotateY: 0 }
|
690 | },
|
691 |
|
692 |
|
693 | "transition.perspectiveRightIn": {
|
694 | defaultDuration: 950,
|
695 | calls: [
|
696 | [ { opacity: [ 1, 0 ], transformPerspective: [ 2000, 2000 ], transformOriginX: [ "100%", "100%" ], transformOriginY: [ 0, 0 ], rotateY: [ 0, 180 ] } ]
|
697 | ],
|
698 | reset: { transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%" }
|
699 | },
|
700 |
|
701 |
|
702 | "transition.perspectiveRightOut": {
|
703 | defaultDuration: 950,
|
704 | calls: [
|
705 | [ { opacity: [ 0, 1 ], transformPerspective: [ 2000, 2000 ], transformOriginX: [ "100%", "100%" ], transformOriginY: [ 0, 0 ], rotateY: 180 } ]
|
706 | ],
|
707 | reset: { transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%", rotateY: 0 }
|
708 | }
|
709 | };
|
710 |
|
711 |
|
712 | for (var effectName in Velocity.RegisterEffect.packagedEffects) {
|
713 | Velocity.RegisterEffect(effectName, Velocity.RegisterEffect.packagedEffects[effectName]);
|
714 | }
|
715 |
|
716 | |
717 |
|
718 |
|
719 |
|
720 |
|
721 | Velocity.RunSequence = function (originalSequence) {
|
722 | var sequence = $.extend(true, [], originalSequence);
|
723 |
|
724 | if (sequence.length > 1) {
|
725 | $.each(sequence.reverse(), function(i, currentCall) {
|
726 | var nextCall = sequence[i + 1];
|
727 |
|
728 | if (nextCall) {
|
729 | |
730 |
|
731 |
|
732 | var timing = (currentCall.options && currentCall.options.sequenceQueue === false) ? "begin" : "complete",
|
733 | callbackOriginal = nextCall.options && nextCall.options[timing],
|
734 | options = {};
|
735 |
|
736 | options[timing] = function() {
|
737 | var elements = nextCall.elements.nodeType ? [ nextCall.elements ] : nextCall.elements;
|
738 |
|
739 | callbackOriginal && callbackOriginal.call(elements, elements);
|
740 | Velocity(currentCall);
|
741 | }
|
742 |
|
743 | nextCall.options = $.extend({}, nextCall.options, options);
|
744 | }
|
745 | });
|
746 |
|
747 | sequence.reverse();
|
748 | }
|
749 |
|
750 | Velocity(sequence[0]);
|
751 | };
|
752 | }((window.jQuery || window.Zepto || window), window, document);
|
753 | })); |
\ | No newline at end of file |