corrade-http-templates – Blame information for rev
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
31 | office | 1 | /********************** |
2 | Velocity UI Pack |
||
3 | **********************/ |
||
4 | |||
5 | /* VelocityJS.org UI Pack (5.2.0). (C) 2014 Julian Shapiro. MIT @license: en.wikipedia.org/wiki/MIT_License. Portions copyright Daniel Eden, Christian Pucci. */ |
||
6 | |||
7 | (function(factory) { |
||
8 | "use strict"; |
||
9 | /* CommonJS module. */ |
||
10 | if (typeof require === "function" && typeof exports === "object") { |
||
11 | module.exports = factory(); |
||
12 | /* AMD module. */ |
||
13 | } else if (typeof define === "function" && define.amd) { |
||
14 | define(["velocity"], factory); |
||
15 | /* Browser globals. */ |
||
16 | } else { |
||
17 | factory(); |
||
18 | } |
||
19 | }(function() { |
||
20 | "use strict"; |
||
21 | return function(global, window, document, undefined) { |
||
22 | |||
23 | /************* |
||
24 | Checks |
||
25 | *************/ |
||
26 | var Velocity = global.Velocity; |
||
27 | |||
28 | if (!Velocity || !Velocity.Utilities) { |
||
29 | if (window.console) { |
||
30 | console.log("Velocity UI Pack: Velocity must be loaded first. Aborting."); |
||
31 | } |
||
32 | return; |
||
33 | } |
||
34 | var $ = Velocity.Utilities; |
||
35 | |||
36 | var velocityVersion = Velocity.version, |
||
37 | requiredVersion = {major: 1, minor: 1, patch: 0}; |
||
38 | |||
39 | function greaterSemver(primary, secondary) { |
||
40 | var versionInts = []; |
||
41 | |||
42 | if (!primary || !secondary) { |
||
43 | return false; |
||
44 | } |
||
45 | |||
46 | $.each([primary, secondary], function(i, versionObject) { |
||
47 | var versionIntsComponents = []; |
||
48 | |||
49 | $.each(versionObject, function(component, value) { |
||
50 | while (value.toString().length < 5) { |
||
51 | value = "0" + value; |
||
52 | } |
||
53 | versionIntsComponents.push(value); |
||
54 | }); |
||
55 | |||
56 | versionInts.push(versionIntsComponents.join("")); |
||
57 | }); |
||
58 | |||
59 | return (parseFloat(versionInts[0]) > parseFloat(versionInts[1])); |
||
60 | } |
||
61 | |||
62 | if (greaterSemver(requiredVersion, velocityVersion)) { |
||
63 | var abortError = "Velocity UI Pack: You need to update Velocity (velocity.js) to a newer version. Visit http://github.com/julianshapiro/velocity."; |
||
64 | alert(abortError); |
||
65 | throw new Error(abortError); |
||
66 | } |
||
67 | |||
68 | /************************ |
||
69 | Effect Registration |
||
70 | ************************/ |
||
71 | |||
72 | /* Note: RegisterUI is a legacy name. */ |
||
73 | Velocity.RegisterEffect = Velocity.RegisterUI = function(effectName, properties) { |
||
74 | /* Animate the expansion/contraction of the elements' parent's height for In/Out effects. */ |
||
75 | function animateParentHeight(elements, direction, totalDuration, stagger) { |
||
76 | var totalHeightDelta = 0, |
||
77 | parentNode; |
||
78 | |||
79 | /* Sum the total height (including padding and margin) of all targeted elements. */ |
||
80 | $.each(elements.nodeType ? [elements] : elements, function(i, element) { |
||
81 | if (stagger) { |
||
82 | /* Increase the totalDuration by the successive delay amounts produced by the stagger option. */ |
||
83 | totalDuration += i * stagger; |
||
84 | } |
||
85 | |||
86 | parentNode = element.parentNode; |
||
87 | |||
88 | var propertiesToSum = ["height", "paddingTop", "paddingBottom", "marginTop", "marginBottom"]; |
||
89 | |||
90 | /* If box-sizing is border-box, the height already includes padding and margin */ |
||
91 | if (Velocity.CSS.getPropertyValue(element, "boxSizing").toString().toLowerCase() === "border-box") { |
||
92 | propertiesToSum = ["height"]; |
||
93 | } |
||
94 | |||
95 | $.each(propertiesToSum, function(i, property) { |
||
96 | totalHeightDelta += parseFloat(Velocity.CSS.getPropertyValue(element, property)); |
||
97 | }); |
||
98 | }); |
||
99 | |||
100 | /* Animate the parent element's height adjustment (with a varying duration multiplier for aesthetic benefits). */ |
||
101 | Velocity.animate( |
||
102 | parentNode, |
||
103 | {height: (direction === "In" ? "+" : "-") + "=" + totalHeightDelta}, |
||
104 | {queue: false, easing: "ease-in-out", duration: totalDuration * (direction === "In" ? 0.6 : 1)} |
||
105 | ); |
||
106 | } |
||
107 | |||
108 | /* Register a custom redirect for each effect. */ |
||
109 | Velocity.Redirects[effectName] = function(element, redirectOptions, elementsIndex, elementsSize, elements, promiseData, loop) { |
||
110 | var finalElement = (elementsIndex === elementsSize - 1), |
||
111 | totalDuration = 0; |
||
112 | |||
113 | loop = loop || properties.loop; |
||
114 | if (typeof properties.defaultDuration === "function") { |
||
115 | properties.defaultDuration = properties.defaultDuration.call(elements, elements); |
||
116 | } else { |
||
117 | properties.defaultDuration = parseFloat(properties.defaultDuration); |
||
118 | } |
||
119 | |||
120 | /* Get the total duration used, so we can share it out with everything that doesn't have a duration */ |
||
121 | for (var callIndex = 0; callIndex < properties.calls.length; callIndex++) { |
||
122 | durationPercentage = properties.calls[callIndex][1]; |
||
123 | if (typeof durationPercentage === "number") { |
||
124 | totalDuration += durationPercentage; |
||
125 | } |
||
126 | } |
||
127 | var shareDuration = totalDuration >= 1 ? 0 : properties.calls.length ? (1 - totalDuration) / properties.calls.length : 1; |
||
128 | |||
129 | /* Iterate through each effect's call array. */ |
||
130 | for (callIndex = 0; callIndex < properties.calls.length; callIndex++) { |
||
131 | var call = properties.calls[callIndex], |
||
132 | propertyMap = call[0], |
||
133 | redirectDuration = 1000, |
||
134 | durationPercentage = call[1], |
||
135 | callOptions = call[2] || {}, |
||
136 | opts = {}; |
||
137 | |||
138 | if (redirectOptions.duration !== undefined) { |
||
139 | redirectDuration = redirectOptions.duration; |
||
140 | } else if (properties.defaultDuration !== undefined) { |
||
141 | redirectDuration = properties.defaultDuration; |
||
142 | } |
||
143 | |||
144 | /* Assign the whitelisted per-call options. */ |
||
145 | opts.duration = redirectDuration * (typeof durationPercentage === "number" ? durationPercentage : shareDuration); |
||
146 | opts.queue = redirectOptions.queue || ""; |
||
147 | opts.easing = callOptions.easing || "ease"; |
||
148 | opts.delay = parseFloat(callOptions.delay) || 0; |
||
149 | opts.loop = !properties.loop && callOptions.loop; |
||
150 | opts._cacheValues = callOptions._cacheValues || true; |
||
151 | |||
152 | /* Special processing for the first effect call. */ |
||
153 | if (callIndex === 0) { |
||
154 | /* If a delay was passed into the redirect, combine it with the first call's delay. */ |
||
155 | opts.delay += (parseFloat(redirectOptions.delay) || 0); |
||
156 | |||
157 | if (elementsIndex === 0) { |
||
158 | opts.begin = function() { |
||
159 | /* Only trigger a begin callback on the first effect call with the first element in the set. */ |
||
160 | if (redirectOptions.begin) { |
||
161 | redirectOptions.begin.call(elements, elements); |
||
162 | } |
||
163 | |||
164 | var direction = effectName.match(/(In|Out)$/); |
||
165 | |||
166 | /* Make "in" transitioning elements invisible immediately so that there's no FOUC between now |
||
167 | and the first RAF tick. */ |
||
168 | if ((direction && direction[0] === "In") && propertyMap.opacity !== undefined) { |
||
169 | $.each(elements.nodeType ? [elements] : elements, function(i, element) { |
||
170 | Velocity.CSS.setPropertyValue(element, "opacity", 0); |
||
171 | }); |
||
172 | } |
||
173 | |||
174 | /* Only trigger animateParentHeight() if we're using an In/Out transition. */ |
||
175 | if (redirectOptions.animateParentHeight && direction) { |
||
176 | animateParentHeight(elements, direction[0], redirectDuration + opts.delay, redirectOptions.stagger); |
||
177 | } |
||
178 | }; |
||
179 | } |
||
180 | |||
181 | /* If the user isn't overriding the display option, default to "auto" for "In"-suffixed transitions. */ |
||
182 | if (redirectOptions.display !== null) { |
||
183 | if (redirectOptions.display !== undefined && redirectOptions.display !== "none") { |
||
184 | opts.display = redirectOptions.display; |
||
185 | } else if (/In$/.test(effectName)) { |
||
186 | /* Inline elements cannot be subjected to transforms, so we switch them to inline-block. */ |
||
187 | var defaultDisplay = Velocity.CSS.Values.getDisplayType(element); |
||
188 | opts.display = (defaultDisplay === "inline") ? "inline-block" : defaultDisplay; |
||
189 | } |
||
190 | } |
||
191 | |||
192 | if (redirectOptions.visibility && redirectOptions.visibility !== "hidden") { |
||
193 | opts.visibility = redirectOptions.visibility; |
||
194 | } |
||
195 | } |
||
196 | |||
197 | /* Special processing for the last effect call. */ |
||
198 | if (callIndex === properties.calls.length - 1) { |
||
199 | /* Append promise resolving onto the user's redirect callback. */ |
||
200 | var injectFinalCallbacks = function() { |
||
201 | if ((redirectOptions.display === undefined || redirectOptions.display === "none") && /Out$/.test(effectName)) { |
||
202 | $.each(elements.nodeType ? [elements] : elements, function(i, element) { |
||
203 | Velocity.CSS.setPropertyValue(element, "display", "none"); |
||
204 | }); |
||
205 | } |
||
206 | if (redirectOptions.complete) { |
||
207 | redirectOptions.complete.call(elements, elements); |
||
208 | } |
||
209 | if (promiseData) { |
||
210 | promiseData.resolver(elements || element); |
||
211 | } |
||
212 | }; |
||
213 | |||
214 | opts.complete = function() { |
||
215 | if (loop) { |
||
216 | Velocity.Redirects[effectName](element, redirectOptions, elementsIndex, elementsSize, elements, promiseData, loop === true ? true : Math.max(0, loop - 1)); |
||
217 | } |
||
218 | if (properties.reset) { |
||
219 | for (var resetProperty in properties.reset) { |
||
220 | if (!properties.reset.hasOwnProperty(resetProperty)) { |
||
221 | continue; |
||
222 | } |
||
223 | var resetValue = properties.reset[resetProperty]; |
||
224 | |||
225 | /* Format each non-array value in the reset property map to [ value, value ] so that changes apply |
||
226 | immediately and DOM querying is avoided (via forcefeeding). */ |
||
227 | /* Note: Don't forcefeed hooks, otherwise their hook roots will be defaulted to their null values. */ |
||
228 | if (Velocity.CSS.Hooks.registered[resetProperty] === undefined && (typeof resetValue === "string" || typeof resetValue === "number")) { |
||
229 | properties.reset[resetProperty] = [properties.reset[resetProperty], properties.reset[resetProperty]]; |
||
230 | } |
||
231 | } |
||
232 | |||
233 | /* So that the reset values are applied instantly upon the next rAF tick, use a zero duration and parallel queueing. */ |
||
234 | var resetOptions = {duration: 0, queue: false}; |
||
235 | |||
236 | /* Since the reset option uses up the complete callback, we trigger the user's complete callback at the end of ours. */ |
||
237 | if (finalElement) { |
||
238 | resetOptions.complete = injectFinalCallbacks; |
||
239 | } |
||
240 | |||
241 | Velocity.animate(element, properties.reset, resetOptions); |
||
242 | /* Only trigger the user's complete callback on the last effect call with the last element in the set. */ |
||
243 | } else if (finalElement) { |
||
244 | injectFinalCallbacks(); |
||
245 | } |
||
246 | }; |
||
247 | |||
248 | if (redirectOptions.visibility === "hidden") { |
||
249 | opts.visibility = redirectOptions.visibility; |
||
250 | } |
||
251 | } |
||
252 | |||
253 | Velocity.animate(element, propertyMap, opts); |
||
254 | } |
||
255 | }; |
||
256 | |||
257 | /* Return the Velocity object so that RegisterUI calls can be chained. */ |
||
258 | return Velocity; |
||
259 | }; |
||
260 | |||
261 | /********************* |
||
262 | Packaged Effects |
||
263 | *********************/ |
||
264 | |||
265 | /* Externalize the packagedEffects data so that they can optionally be modified and re-registered. */ |
||
266 | /* Support: <=IE8: Callouts will have no effect, and transitions will simply fade in/out. IE9/Android 2.3: Most effects are fully supported, the rest fade in/out. All other browsers: full support. */ |
||
267 | Velocity.RegisterEffect.packagedEffects = |
||
268 | { |
||
269 | /* Animate.css */ |
||
270 | "callout.bounce": { |
||
271 | defaultDuration: 550, |
||
272 | calls: [ |
||
273 | [{translateY: -30}, 0.25], |
||
274 | [{translateY: 0}, 0.125], |
||
275 | [{translateY: -15}, 0.125], |
||
276 | [{translateY: 0}, 0.25] |
||
277 | ] |
||
278 | }, |
||
279 | /* Animate.css */ |
||
280 | "callout.shake": { |
||
281 | defaultDuration: 800, |
||
282 | calls: [ |
||
283 | [{translateX: -11}], |
||
284 | [{translateX: 11}], |
||
285 | [{translateX: -11}], |
||
286 | [{translateX: 11}], |
||
287 | [{translateX: -11}], |
||
288 | [{translateX: 11}], |
||
289 | [{translateX: -11}], |
||
290 | [{translateX: 0}] |
||
291 | ] |
||
292 | }, |
||
293 | /* Animate.css */ |
||
294 | "callout.flash": { |
||
295 | defaultDuration: 1100, |
||
296 | calls: [ |
||
297 | [{opacity: [0, "easeInOutQuad", 1]}], |
||
298 | [{opacity: [1, "easeInOutQuad"]}], |
||
299 | [{opacity: [0, "easeInOutQuad"]}], |
||
300 | [{opacity: [1, "easeInOutQuad"]}] |
||
301 | ] |
||
302 | }, |
||
303 | /* Animate.css */ |
||
304 | "callout.pulse": { |
||
305 | defaultDuration: 825, |
||
306 | calls: [ |
||
307 | [{scaleX: 1.1, scaleY: 1.1}, 0.50, {easing: "easeInExpo"}], |
||
308 | [{scaleX: 1, scaleY: 1}, 0.50] |
||
309 | ] |
||
310 | }, |
||
311 | /* Animate.css */ |
||
312 | "callout.swing": { |
||
313 | defaultDuration: 950, |
||
314 | calls: [ |
||
315 | [{rotateZ: 15}], |
||
316 | [{rotateZ: -10}], |
||
317 | [{rotateZ: 5}], |
||
318 | [{rotateZ: -5}], |
||
319 | [{rotateZ: 0}] |
||
320 | ] |
||
321 | }, |
||
322 | /* Animate.css */ |
||
323 | "callout.tada": { |
||
324 | defaultDuration: 1000, |
||
325 | calls: [ |
||
326 | [{scaleX: 0.9, scaleY: 0.9, rotateZ: -3}, 0.10], |
||
327 | [{scaleX: 1.1, scaleY: 1.1, rotateZ: 3}, 0.10], |
||
328 | [{scaleX: 1.1, scaleY: 1.1, rotateZ: -3}, 0.10], |
||
329 | ["reverse", 0.125], |
||
330 | ["reverse", 0.125], |
||
331 | ["reverse", 0.125], |
||
332 | ["reverse", 0.125], |
||
333 | ["reverse", 0.125], |
||
334 | [{scaleX: 1, scaleY: 1, rotateZ: 0}, 0.20] |
||
335 | ] |
||
336 | }, |
||
337 | "transition.fadeIn": { |
||
338 | defaultDuration: 500, |
||
339 | calls: [ |
||
340 | [{opacity: [1, 0]}] |
||
341 | ] |
||
342 | }, |
||
343 | "transition.fadeOut": { |
||
344 | defaultDuration: 500, |
||
345 | calls: [ |
||
346 | [{opacity: [0, 1]}] |
||
347 | ] |
||
348 | }, |
||
349 | /* Support: Loses rotation in IE9/Android 2.3 (fades only). */ |
||
350 | "transition.flipXIn": { |
||
351 | defaultDuration: 700, |
||
352 | calls: [ |
||
353 | [{opacity: [1, 0], transformPerspective: [800, 800], rotateY: [0, -55]}] |
||
354 | ], |
||
355 | reset: {transformPerspective: 0} |
||
356 | }, |
||
357 | /* Support: Loses rotation in IE9/Android 2.3 (fades only). */ |
||
358 | "transition.flipXOut": { |
||
359 | defaultDuration: 700, |
||
360 | calls: [ |
||
361 | [{opacity: [0, 1], transformPerspective: [800, 800], rotateY: 55}] |
||
362 | ], |
||
363 | reset: {transformPerspective: 0, rotateY: 0} |
||
364 | }, |
||
365 | /* Support: Loses rotation in IE9/Android 2.3 (fades only). */ |
||
366 | "transition.flipYIn": { |
||
367 | defaultDuration: 800, |
||
368 | calls: [ |
||
369 | [{opacity: [1, 0], transformPerspective: [800, 800], rotateX: [0, -45]}] |
||
370 | ], |
||
371 | reset: {transformPerspective: 0} |
||
372 | }, |
||
373 | /* Support: Loses rotation in IE9/Android 2.3 (fades only). */ |
||
374 | "transition.flipYOut": { |
||
375 | defaultDuration: 800, |
||
376 | calls: [ |
||
377 | [{opacity: [0, 1], transformPerspective: [800, 800], rotateX: 25}] |
||
378 | ], |
||
379 | reset: {transformPerspective: 0, rotateX: 0} |
||
380 | }, |
||
381 | /* Animate.css */ |
||
382 | /* Support: Loses rotation in IE9/Android 2.3 (fades only). */ |
||
383 | "transition.flipBounceXIn": { |
||
384 | defaultDuration: 900, |
||
385 | calls: [ |
||
386 | [{opacity: [0.725, 0], transformPerspective: [400, 400], rotateY: [-10, 90]}, 0.50], |
||
387 | [{opacity: 0.80, rotateY: 10}, 0.25], |
||
388 | [{opacity: 1, rotateY: 0}, 0.25] |
||
389 | ], |
||
390 | reset: {transformPerspective: 0} |
||
391 | }, |
||
392 | /* Animate.css */ |
||
393 | /* Support: Loses rotation in IE9/Android 2.3 (fades only). */ |
||
394 | "transition.flipBounceXOut": { |
||
395 | defaultDuration: 800, |
||
396 | calls: [ |
||
397 | [{opacity: [0.9, 1], transformPerspective: [400, 400], rotateY: -10}], |
||
398 | [{opacity: 0, rotateY: 90}] |
||
399 | ], |
||
400 | reset: {transformPerspective: 0, rotateY: 0} |
||
401 | }, |
||
402 | /* Animate.css */ |
||
403 | /* Support: Loses rotation in IE9/Android 2.3 (fades only). */ |
||
404 | "transition.flipBounceYIn": { |
||
405 | defaultDuration: 850, |
||
406 | calls: [ |
||
407 | [{opacity: [0.725, 0], transformPerspective: [400, 400], rotateX: [-10, 90]}, 0.50], |
||
408 | [{opacity: 0.80, rotateX: 10}, 0.25], |
||
409 | [{opacity: 1, rotateX: 0}, 0.25] |
||
410 | ], |
||
411 | reset: {transformPerspective: 0} |
||
412 | }, |
||
413 | /* Animate.css */ |
||
414 | /* Support: Loses rotation in IE9/Android 2.3 (fades only). */ |
||
415 | "transition.flipBounceYOut": { |
||
416 | defaultDuration: 800, |
||
417 | calls: [ |
||
418 | [{opacity: [0.9, 1], transformPerspective: [400, 400], rotateX: -15}], |
||
419 | [{opacity: 0, rotateX: 90}] |
||
420 | ], |
||
421 | reset: {transformPerspective: 0, rotateX: 0} |
||
422 | }, |
||
423 | /* Magic.css */ |
||
424 | "transition.swoopIn": { |
||
425 | defaultDuration: 850, |
||
426 | calls: [ |
||
427 | [{opacity: [1, 0], transformOriginX: ["100%", "50%"], transformOriginY: ["100%", "100%"], scaleX: [1, 0], scaleY: [1, 0], translateX: [0, -700], translateZ: 0}] |
||
428 | ], |
||
429 | reset: {transformOriginX: "50%", transformOriginY: "50%"} |
||
430 | }, |
||
431 | /* Magic.css */ |
||
432 | "transition.swoopOut": { |
||
433 | defaultDuration: 850, |
||
434 | calls: [ |
||
435 | [{opacity: [0, 1], transformOriginX: ["50%", "100%"], transformOriginY: ["100%", "100%"], scaleX: 0, scaleY: 0, translateX: -700, translateZ: 0}] |
||
436 | ], |
||
437 | reset: {transformOriginX: "50%", transformOriginY: "50%", scaleX: 1, scaleY: 1, translateX: 0} |
||
438 | }, |
||
439 | /* Magic.css */ |
||
440 | /* Support: Loses rotation in IE9/Android 2.3. (Fades and scales only.) */ |
||
441 | "transition.whirlIn": { |
||
442 | defaultDuration: 850, |
||
443 | calls: [ |
||
444 | [{opacity: [1, 0], transformOriginX: ["50%", "50%"], transformOriginY: ["50%", "50%"], scaleX: [1, 0], scaleY: [1, 0], rotateY: [0, 160]}, 1, {easing: "easeInOutSine"}] |
||
445 | ] |
||
446 | }, |
||
447 | /* Magic.css */ |
||
448 | /* Support: Loses rotation in IE9/Android 2.3. (Fades and scales only.) */ |
||
449 | "transition.whirlOut": { |
||
450 | defaultDuration: 750, |
||
451 | calls: [ |
||
452 | [{opacity: [0, "easeInOutQuint", 1], transformOriginX: ["50%", "50%"], transformOriginY: ["50%", "50%"], scaleX: 0, scaleY: 0, rotateY: 160}, 1, {easing: "swing"}] |
||
453 | ], |
||
454 | reset: {scaleX: 1, scaleY: 1, rotateY: 0} |
||
455 | }, |
||
456 | "transition.shrinkIn": { |
||
457 | defaultDuration: 750, |
||
458 | calls: [ |
||
459 | [{opacity: [1, 0], transformOriginX: ["50%", "50%"], transformOriginY: ["50%", "50%"], scaleX: [1, 1.5], scaleY: [1, 1.5], translateZ: 0}] |
||
460 | ] |
||
461 | }, |
||
462 | "transition.shrinkOut": { |
||
463 | defaultDuration: 600, |
||
464 | calls: [ |
||
465 | [{opacity: [0, 1], transformOriginX: ["50%", "50%"], transformOriginY: ["50%", "50%"], scaleX: 1.3, scaleY: 1.3, translateZ: 0}] |
||
466 | ], |
||
467 | reset: {scaleX: 1, scaleY: 1} |
||
468 | }, |
||
469 | "transition.expandIn": { |
||
470 | defaultDuration: 700, |
||
471 | calls: [ |
||
472 | [{opacity: [1, 0], transformOriginX: ["50%", "50%"], transformOriginY: ["50%", "50%"], scaleX: [1, 0.625], scaleY: [1, 0.625], translateZ: 0}] |
||
473 | ] |
||
474 | }, |
||
475 | "transition.expandOut": { |
||
476 | defaultDuration: 700, |
||
477 | calls: [ |
||
478 | [{opacity: [0, 1], transformOriginX: ["50%", "50%"], transformOriginY: ["50%", "50%"], scaleX: 0.5, scaleY: 0.5, translateZ: 0}] |
||
479 | ], |
||
480 | reset: {scaleX: 1, scaleY: 1} |
||
481 | }, |
||
482 | /* Animate.css */ |
||
483 | "transition.bounceIn": { |
||
484 | defaultDuration: 800, |
||
485 | calls: [ |
||
486 | [{opacity: [1, 0], scaleX: [1.05, 0.3], scaleY: [1.05, 0.3]}, 0.35], |
||
487 | [{scaleX: 0.9, scaleY: 0.9, translateZ: 0}, 0.20], |
||
488 | [{scaleX: 1, scaleY: 1}, 0.45] |
||
489 | ] |
||
490 | }, |
||
491 | /* Animate.css */ |
||
492 | "transition.bounceOut": { |
||
493 | defaultDuration: 800, |
||
494 | calls: [ |
||
495 | [{scaleX: 0.95, scaleY: 0.95}, 0.35], |
||
496 | [{scaleX: 1.1, scaleY: 1.1, translateZ: 0}, 0.35], |
||
497 | [{opacity: [0, 1], scaleX: 0.3, scaleY: 0.3}, 0.30] |
||
498 | ], |
||
499 | reset: {scaleX: 1, scaleY: 1} |
||
500 | }, |
||
501 | /* Animate.css */ |
||
502 | "transition.bounceUpIn": { |
||
503 | defaultDuration: 800, |
||
504 | calls: [ |
||
505 | [{opacity: [1, 0], translateY: [-30, 1000]}, 0.60, {easing: "easeOutCirc"}], |
||
506 | [{translateY: 10}, 0.20], |
||
507 | [{translateY: 0}, 0.20] |
||
508 | ] |
||
509 | }, |
||
510 | /* Animate.css */ |
||
511 | "transition.bounceUpOut": { |
||
512 | defaultDuration: 1000, |
||
513 | calls: [ |
||
514 | [{translateY: 20}, 0.20], |
||
515 | [{opacity: [0, "easeInCirc", 1], translateY: -1000}, 0.80] |
||
516 | ], |
||
517 | reset: {translateY: 0} |
||
518 | }, |
||
519 | /* Animate.css */ |
||
520 | "transition.bounceDownIn": { |
||
521 | defaultDuration: 800, |
||
522 | calls: [ |
||
523 | [{opacity: [1, 0], translateY: [30, -1000]}, 0.60, {easing: "easeOutCirc"}], |
||
524 | [{translateY: -10}, 0.20], |
||
525 | [{translateY: 0}, 0.20] |
||
526 | ] |
||
527 | }, |
||
528 | /* Animate.css */ |
||
529 | "transition.bounceDownOut": { |
||
530 | defaultDuration: 1000, |
||
531 | calls: [ |
||
532 | [{translateY: -20}, 0.20], |
||
533 | [{opacity: [0, "easeInCirc", 1], translateY: 1000}, 0.80] |
||
534 | ], |
||
535 | reset: {translateY: 0} |
||
536 | }, |
||
537 | /* Animate.css */ |
||
538 | "transition.bounceLeftIn": { |
||
539 | defaultDuration: 750, |
||
540 | calls: [ |
||
541 | [{opacity: [1, 0], translateX: [30, -1250]}, 0.60, {easing: "easeOutCirc"}], |
||
542 | [{translateX: -10}, 0.20], |
||
543 | [{translateX: 0}, 0.20] |
||
544 | ] |
||
545 | }, |
||
546 | /* Animate.css */ |
||
547 | "transition.bounceLeftOut": { |
||
548 | defaultDuration: 750, |
||
549 | calls: [ |
||
550 | [{translateX: 30}, 0.20], |
||
551 | [{opacity: [0, "easeInCirc", 1], translateX: -1250}, 0.80] |
||
552 | ], |
||
553 | reset: {translateX: 0} |
||
554 | }, |
||
555 | /* Animate.css */ |
||
556 | "transition.bounceRightIn": { |
||
557 | defaultDuration: 750, |
||
558 | calls: [ |
||
559 | [{opacity: [1, 0], translateX: [-30, 1250]}, 0.60, {easing: "easeOutCirc"}], |
||
560 | [{translateX: 10}, 0.20], |
||
561 | [{translateX: 0}, 0.20] |
||
562 | ] |
||
563 | }, |
||
564 | /* Animate.css */ |
||
565 | "transition.bounceRightOut": { |
||
566 | defaultDuration: 750, |
||
567 | calls: [ |
||
568 | [{translateX: -30}, 0.20], |
||
569 | [{opacity: [0, "easeInCirc", 1], translateX: 1250}, 0.80] |
||
570 | ], |
||
571 | reset: {translateX: 0} |
||
572 | }, |
||
573 | "transition.slideUpIn": { |
||
574 | defaultDuration: 900, |
||
575 | calls: [ |
||
576 | [{opacity: [1, 0], translateY: [0, 20], translateZ: 0}] |
||
577 | ] |
||
578 | }, |
||
579 | "transition.slideUpOut": { |
||
580 | defaultDuration: 900, |
||
581 | calls: [ |
||
582 | [{opacity: [0, 1], translateY: -20, translateZ: 0}] |
||
583 | ], |
||
584 | reset: {translateY: 0} |
||
585 | }, |
||
586 | "transition.slideDownIn": { |
||
587 | defaultDuration: 900, |
||
588 | calls: [ |
||
589 | [{opacity: [1, 0], translateY: [0, -20], translateZ: 0}] |
||
590 | ] |
||
591 | }, |
||
592 | "transition.slideDownOut": { |
||
593 | defaultDuration: 900, |
||
594 | calls: [ |
||
595 | [{opacity: [0, 1], translateY: 20, translateZ: 0}] |
||
596 | ], |
||
597 | reset: {translateY: 0} |
||
598 | }, |
||
599 | "transition.slideLeftIn": { |
||
600 | defaultDuration: 1000, |
||
601 | calls: [ |
||
602 | [{opacity: [1, 0], translateX: [0, -20], translateZ: 0}] |
||
603 | ] |
||
604 | }, |
||
605 | "transition.slideLeftOut": { |
||
606 | defaultDuration: 1050, |
||
607 | calls: [ |
||
608 | [{opacity: [0, 1], translateX: -20, translateZ: 0}] |
||
609 | ], |
||
610 | reset: {translateX: 0} |
||
611 | }, |
||
612 | "transition.slideRightIn": { |
||
613 | defaultDuration: 1000, |
||
614 | calls: [ |
||
615 | [{opacity: [1, 0], translateX: [0, 20], translateZ: 0}] |
||
616 | ] |
||
617 | }, |
||
618 | "transition.slideRightOut": { |
||
619 | defaultDuration: 1050, |
||
620 | calls: [ |
||
621 | [{opacity: [0, 1], translateX: 20, translateZ: 0}] |
||
622 | ], |
||
623 | reset: {translateX: 0} |
||
624 | }, |
||
625 | "transition.slideUpBigIn": { |
||
626 | defaultDuration: 850, |
||
627 | calls: [ |
||
628 | [{opacity: [1, 0], translateY: [0, 75], translateZ: 0}] |
||
629 | ] |
||
630 | }, |
||
631 | "transition.slideUpBigOut": { |
||
632 | defaultDuration: 800, |
||
633 | calls: [ |
||
634 | [{opacity: [0, 1], translateY: -75, translateZ: 0}] |
||
635 | ], |
||
636 | reset: {translateY: 0} |
||
637 | }, |
||
638 | "transition.slideDownBigIn": { |
||
639 | defaultDuration: 850, |
||
640 | calls: [ |
||
641 | [{opacity: [1, 0], translateY: [0, -75], translateZ: 0}] |
||
642 | ] |
||
643 | }, |
||
644 | "transition.slideDownBigOut": { |
||
645 | defaultDuration: 800, |
||
646 | calls: [ |
||
647 | [{opacity: [0, 1], translateY: 75, translateZ: 0}] |
||
648 | ], |
||
649 | reset: {translateY: 0} |
||
650 | }, |
||
651 | "transition.slideLeftBigIn": { |
||
652 | defaultDuration: 800, |
||
653 | calls: [ |
||
654 | [{opacity: [1, 0], translateX: [0, -75], translateZ: 0}] |
||
655 | ] |
||
656 | }, |
||
657 | "transition.slideLeftBigOut": { |
||
658 | defaultDuration: 750, |
||
659 | calls: [ |
||
660 | [{opacity: [0, 1], translateX: -75, translateZ: 0}] |
||
661 | ], |
||
662 | reset: {translateX: 0} |
||
663 | }, |
||
664 | "transition.slideRightBigIn": { |
||
665 | defaultDuration: 800, |
||
666 | calls: [ |
||
667 | [{opacity: [1, 0], translateX: [0, 75], translateZ: 0}] |
||
668 | ] |
||
669 | }, |
||
670 | "transition.slideRightBigOut": { |
||
671 | defaultDuration: 750, |
||
672 | calls: [ |
||
673 | [{opacity: [0, 1], translateX: 75, translateZ: 0}] |
||
674 | ], |
||
675 | reset: {translateX: 0} |
||
676 | }, |
||
677 | /* Magic.css */ |
||
678 | "transition.perspectiveUpIn": { |
||
679 | defaultDuration: 800, |
||
680 | calls: [ |
||
681 | [{opacity: [1, 0], transformPerspective: [800, 800], transformOriginX: [0, 0], transformOriginY: ["100%", "100%"], rotateX: [0, -180]}] |
||
682 | ], |
||
683 | reset: {transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%"} |
||
684 | }, |
||
685 | /* Magic.css */ |
||
686 | /* Support: Loses rotation in IE9/Android 2.3 (fades only). */ |
||
687 | "transition.perspectiveUpOut": { |
||
688 | defaultDuration: 850, |
||
689 | calls: [ |
||
690 | [{opacity: [0, 1], transformPerspective: [800, 800], transformOriginX: [0, 0], transformOriginY: ["100%", "100%"], rotateX: -180}] |
||
691 | ], |
||
692 | reset: {transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%", rotateX: 0} |
||
693 | }, |
||
694 | /* Magic.css */ |
||
695 | /* Support: Loses rotation in IE9/Android 2.3 (fades only). */ |
||
696 | "transition.perspectiveDownIn": { |
||
697 | defaultDuration: 800, |
||
698 | calls: [ |
||
699 | [{opacity: [1, 0], transformPerspective: [800, 800], transformOriginX: [0, 0], transformOriginY: [0, 0], rotateX: [0, 180]}] |
||
700 | ], |
||
701 | reset: {transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%"} |
||
702 | }, |
||
703 | /* Magic.css */ |
||
704 | /* Support: Loses rotation in IE9/Android 2.3 (fades only). */ |
||
705 | "transition.perspectiveDownOut": { |
||
706 | defaultDuration: 850, |
||
707 | calls: [ |
||
708 | [{opacity: [0, 1], transformPerspective: [800, 800], transformOriginX: [0, 0], transformOriginY: [0, 0], rotateX: 180}] |
||
709 | ], |
||
710 | reset: {transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%", rotateX: 0} |
||
711 | }, |
||
712 | /* Magic.css */ |
||
713 | /* Support: Loses rotation in IE9/Android 2.3 (fades only). */ |
||
714 | "transition.perspectiveLeftIn": { |
||
715 | defaultDuration: 950, |
||
716 | calls: [ |
||
717 | [{opacity: [1, 0], transformPerspective: [2000, 2000], transformOriginX: [0, 0], transformOriginY: [0, 0], rotateY: [0, -180]}] |
||
718 | ], |
||
719 | reset: {transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%"} |
||
720 | }, |
||
721 | /* Magic.css */ |
||
722 | /* Support: Loses rotation in IE9/Android 2.3 (fades only). */ |
||
723 | "transition.perspectiveLeftOut": { |
||
724 | defaultDuration: 950, |
||
725 | calls: [ |
||
726 | [{opacity: [0, 1], transformPerspective: [2000, 2000], transformOriginX: [0, 0], transformOriginY: [0, 0], rotateY: -180}] |
||
727 | ], |
||
728 | reset: {transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%", rotateY: 0} |
||
729 | }, |
||
730 | /* Magic.css */ |
||
731 | /* Support: Loses rotation in IE9/Android 2.3 (fades only). */ |
||
732 | "transition.perspectiveRightIn": { |
||
733 | defaultDuration: 950, |
||
734 | calls: [ |
||
735 | [{opacity: [1, 0], transformPerspective: [2000, 2000], transformOriginX: ["100%", "100%"], transformOriginY: [0, 0], rotateY: [0, 180]}] |
||
736 | ], |
||
737 | reset: {transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%"} |
||
738 | }, |
||
739 | /* Magic.css */ |
||
740 | /* Support: Loses rotation in IE9/Android 2.3 (fades only). */ |
||
741 | "transition.perspectiveRightOut": { |
||
742 | defaultDuration: 950, |
||
743 | calls: [ |
||
744 | [{opacity: [0, 1], transformPerspective: [2000, 2000], transformOriginX: ["100%", "100%"], transformOriginY: [0, 0], rotateY: 180}] |
||
745 | ], |
||
746 | reset: {transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%", rotateY: 0} |
||
747 | } |
||
748 | }; |
||
749 | |||
750 | /* Register the packaged effects. */ |
||
751 | for (var effectName in Velocity.RegisterEffect.packagedEffects) { |
||
752 | if (Velocity.RegisterEffect.packagedEffects.hasOwnProperty(effectName)) { |
||
753 | Velocity.RegisterEffect(effectName, Velocity.RegisterEffect.packagedEffects[effectName]); |
||
754 | } |
||
755 | } |
||
756 | |||
757 | /********************* |
||
758 | Sequence Running |
||
759 | **********************/ |
||
760 | |||
761 | /* Note: Sequence calls must use Velocity's single-object arguments syntax. */ |
||
762 | Velocity.RunSequence = function(originalSequence) { |
||
763 | var sequence = $.extend(true, [], originalSequence); |
||
764 | |||
765 | if (sequence.length > 1) { |
||
766 | $.each(sequence.reverse(), function(i, currentCall) { |
||
767 | var nextCall = sequence[i + 1]; |
||
768 | |||
769 | if (nextCall) { |
||
770 | /* Parallel sequence calls (indicated via sequenceQueue:false) are triggered |
||
771 | in the previous call's begin callback. Otherwise, chained calls are normally triggered |
||
772 | in the previous call's complete callback. */ |
||
773 | var currentCallOptions = currentCall.o || currentCall.options, |
||
774 | nextCallOptions = nextCall.o || nextCall.options; |
||
775 | |||
776 | var timing = (currentCallOptions && currentCallOptions.sequenceQueue === false) ? "begin" : "complete", |
||
777 | callbackOriginal = nextCallOptions && nextCallOptions[timing], |
||
778 | options = {}; |
||
779 | |||
780 | options[timing] = function() { |
||
781 | var nextCallElements = nextCall.e || nextCall.elements; |
||
782 | var elements = nextCallElements.nodeType ? [nextCallElements] : nextCallElements; |
||
783 | |||
784 | if (callbackOriginal) { |
||
785 | callbackOriginal.call(elements, elements); |
||
786 | } |
||
787 | Velocity(currentCall); |
||
788 | }; |
||
789 | |||
790 | if (nextCall.o) { |
||
791 | nextCall.o = $.extend({}, nextCallOptions, options); |
||
792 | } else { |
||
793 | nextCall.options = $.extend({}, nextCallOptions, options); |
||
794 | } |
||
795 | } |
||
796 | }); |
||
797 | |||
798 | sequence.reverse(); |
||
799 | } |
||
800 | |||
801 | Velocity(sequence[0]); |
||
802 | }; |
||
803 | }((window.jQuery || window.Zepto || window), window, (window ? window.document : undefined)); |
||
804 | })); |