diff --git a/.gitignore b/.gitignore index a94a5be1..8602f4de 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,5 @@ node_modules test min README.md -Gruntfile.js -velocity.js -velocity.min.js +Gruntfile.js.bak velocity.jquery-shim.js \ No newline at end of file diff --git a/bower.json b/bower.json index 6439828e..b5e6f617 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "velocity", - "version": "0.9.0", + "version": "0.10.0", "homepage": "http://velocityjs.org", "authors": [ { "name" : "Julian Shapiro", diff --git a/component.json b/component.json index 6f219737..06ff2aa0 100644 --- a/component.json +++ b/component.json @@ -1,7 +1,7 @@ { "name": "velocity", "repository": "julianshapiro/velocity", - "version": "0.9.0", + "version": "0.10.0", "description": "Accelerated JavaScript animation.", "keywords": [ "animation", diff --git a/jquery.velocity.js b/jquery.velocity.js index 1362a5ff..00f98e79 100644 --- a/jquery.velocity.js +++ b/jquery.velocity.js @@ -4,7 +4,7 @@ /*! * Velocity.js: Accelerated JavaScript animation. -* @version 0.9.0 +* @version 0.10.0 * @docs http://velocityjs.org * @license Copyright 2014 Julian Shapiro. MIT License: http://en.wikipedia.org/wiki/MIT_License */ @@ -25,8 +25,6 @@ Velocity's structure: - completeCall(): Handles the cleanup process for each Velocity call. */ -/* NOTICE: Despite the ensuing code indicating that Velocity works *without* jQuery and *with* Zepto, this support has not yet landed. */ - /****************** Velocity.js ******************/ @@ -134,6 +132,16 @@ Velocity's structure: isSVG: function (variable) { return window.SVGElement && (variable instanceof SVGElement); + }, + + isEmptyObject: function (variable) { + var name; + + for (name in variable) { + return false; + } + + return true; } }; @@ -188,7 +196,7 @@ Velocity's structure: DOM elements and stand alone for targeting raw DOM elements. */ /* Note: The global object also doubles as a publicly-accessible data store for the purposes of unit testing. */ /* Note: Alias the lowercase and uppercase variants of "velocity" to minimize user confusion due to the lowercase nature of the $.fn extension. */ - var Velocity = global.Velocity = global.velocity = { + var Velocity = global.Velocity = global.velocity = $.extend({ /* Container for page-wide Velocity state data. */ State: { /* Detect mobile devices to determine if mobileHA should be turned on. */ @@ -244,10 +252,10 @@ Velocity's structure: animate: function () { /* Defined below. */ }, /* Set to true to force a duration of 1ms for all animations so that UI testing can be performed without waiting on animations to complete. */ mock: false, - version: { major: 0, minor: 9, patch: 0 }, + version: { major: 0, minor: 10, patch: 0 }, /* Set to 1 or 2 (most verbose) to output debug info to console. */ debug: false - }; + }, window.Velocity); /* Retrieve the appropriate scroll anchor and property name for the browser: https://developer.mozilla.org/en-US/docs/Web/API/Window.scrollY */ if (window.pageYOffset !== undefined) { @@ -1676,7 +1684,7 @@ Velocity's structure: regardless of the element's current queue state. */ $.each(Velocity.State.calls, function(i, activeCall) { /* Inactive calls are set to false by the logic inside completeCall(). Skip them. */ - if (activeCall !== false) { + if (activeCall) { /* If we're operating on a single element, wrap it in an array so that $.each() can iterate over it. */ $.each(Type.isNode(activeCall[1]) ? [ activeCall[1] ] : activeCall[1], function(k, activeElement) { $.each(Type.isNode(elements) ? [ elements ] : elements, function(l, element) { @@ -1732,7 +1740,7 @@ Velocity's structure: default: /* Treat a non-empty plain object as a literal properties map. */ - if ($.isPlainObject(propertiesMap) && !$.isEmptyObject(propertiesMap)) { + if ($.isPlainObject(propertiesMap) && !Type.isEmptyObject(propertiesMap)) { action = "start"; /**************** @@ -2141,7 +2149,7 @@ Velocity's structure: /* Easing is the only option that embeds into the individual tween data (since it can be defined on a per-property basis). Accordingly, every property's easing value must be updated when an options object is passed in with a reverse call. The side effect of this extensibility is that all per-property easing values are forcefully reset to the new value. */ - if (!$.isEmptyObject(options)) { + if (!Type.isEmptyObject(options)) { lastTweensContainer[lastTween].easing = opts.easing; } @@ -2849,7 +2857,9 @@ Velocity's structure: /* If a complete callback was passed into this call, transfer it to the loop sequence's final "reverse" call so that it's triggered when the entire sequence is complete (and not when the very first animation is complete). */ - if (opts.complete && (x === reverseCallsCount - 1)) { + if (x === reverseCallsCount - 1) { + reverseOptions.display = opts.display; + reverseOptions.visibility = opts.visibility; reverseOptions.complete = opts.complete; } @@ -3116,7 +3126,7 @@ Velocity's structure: /* If the user set display to "none" (intending to hide the element), set it now that the animation has completed. */ /* Note: display:none isn't set when calls are manually stopped (via Velocity.animate("stop"). */ - /* Note: Display is ignored with "reverse" calls, which is what loops are composed of, since this behavior would be undesirable. */ + /* Note: Display gets ignored with "reverse" calls and infinite loops, since this behavior would be undesirable. */ if (!isStopped && !opts.loop) { if (opts.display === "none") { CSS.setPropertyValue(element, "display", opts.display); @@ -3173,7 +3183,6 @@ Velocity's structure: /* Complete is fired once per call (not once per element) and is passed the full raw DOM element set as both its context and its first argument. */ /* Note: Callbacks aren't fired when calls are manually stopped (via Velocity.animate("stop"). */ - /* Note: If this is a loop, complete callback firing is only triggered on the loop's final reverse call. */ if (!isStopped && opts.complete && !opts.loop && (i === callLength - 1)) { /* We throw callbacks in a setTimeout so that thrown errors don't halt the execution of Velocity itself. */ try { @@ -3189,10 +3198,19 @@ Velocity's structure: Promise Resolving **********************/ - if (resolver) { + /* Note: Infinite loops don't return promises. */ + if (resolver && opts.loop !== true) { resolver(elements); } + /**************************** + Option: Loop (Infinite) + ****************************/ + + if (opts.loop === true && !isStopped) { + Velocity.animate(element, "reverse", { loop: true, delay: opts.delay }); + } + /*************** Dequeueing ***************/ @@ -3262,7 +3280,7 @@ Velocity's structure: /* slideUp, slideDown */ $.each([ "Down", "Up" ], function(i, direction) { - Velocity.Sequences["slide" + direction] = function (element, options) { + Velocity.Sequences["slide" + direction] = function (element, options, elementsIndex, elementsSize, elements, promiseData) { var opts = $.extend({}, options), originalValues = { height: null, @@ -3384,6 +3402,8 @@ Velocity's structure: if (complete) { complete.call(element, element); } + + promiseData && promiseData.resolver(elements || element); }; /* Animation triggering. */ @@ -3393,7 +3413,7 @@ Velocity's structure: /* fadeIn, fadeOut */ $.each([ "In", "Out" ], function(i, direction) { - Velocity.Sequences["fade" + direction] = function (element, options, elementsIndex, elementsSize) { + Velocity.Sequences["fade" + direction] = function (element, options, elementsIndex, elementsSize, elements, promiseData) { var opts = $.extend({}, options), propertiesMap = { opacity: (direction === "In") ? 1 : 0 @@ -3403,6 +3423,16 @@ Velocity's structure: callbacks by firing them only when the final element has been reached. */ if (elementsIndex !== elementsSize - 1) { opts.complete = opts.begin = null; + } else { + var originalComplete = opts.complete; + + opts.complete = function() { + if (originalComplete) { + originalComplete.call(element, element); + } + + promiseData && promiseData.resolver(elements || element); + } } /* If a display was passed in, use it. Otherwise, default to "none" for fadeOut or the element-specific default for fadeIn. */ diff --git a/jquery.velocity.min.js b/jquery.velocity.min.js index 1e8299d6..a7536f10 100644 --- a/jquery.velocity.min.js +++ b/jquery.velocity.min.js @@ -1,7 +1,7 @@ /*! * Velocity.js: Accelerated JavaScript animation. -* @version 0.9.0 +* @version 0.10.0 * @docs http://velocityjs.org * @license Copyright 2014 Julian Shapiro. MIT License: http://en.wikipedia.org/wiki/MIT_License */ -!function(a,b,c,d){function e(a){for(var b=-1,c=a?a.length:0,d=[];++bc;c++)if(s.State.calls[c]){var g=s.State.calls[c],h=g[0],k=g[2],l=g[3];l||(l=s.State.calls[c][3]=b-16);for(var m=Math.min((b-l)/k.duration,1),n=0,o=h.length;o>n;n++){var r=h[n],t=r.element;if(f(t)){var u=!1;k.display&&"none"!==k.display&&v.setPropertyValue(t,"display",k.display),k.visibility&&"hidden"!==k.visibility&&v.setPropertyValue(t,"visibility",k.visibility);for(var w in r)if("element"!==w){var x,y=r[w],z=q.isString(y.easing)?s.Easings[y.easing]:y.easing;if(x=1===m?y.endValue:y.startValue+(y.endValue-y.startValue)*z(m),y.currentValue=x,v.Hooks.registered[w]){var A=v.Hooks.getRoot(w),B=f(t).rootPropertyValueCache[A];B&&(y.rootPropertyValue=B)}var C=v.setPropertyValue(t,w,y.currentValue+(0===parseFloat(x)?"":y.unitType),y.rootPropertyValue,y.scrollData);v.Hooks.registered[w]&&(f(t).rootPropertyValueCache[A]=v.Normalizations.registered[A]?v.Normalizations.registered[A]("extract",null,C[1]):C[1]),"transform"===C[0]&&(u=!0)}k.mobileHA&&f(t).transformCache.translate3d===d&&(f(t).transformCache.translate3d="(0px, 0px, 0px)",u=!0),u&&v.flushTransformCache(t)}}k.display&&"none"!==k.display&&(s.State.calls[c][2].display=!1),k.visibility&&"hidden"!==k.visibility&&(s.State.calls[c][2].visibility=!1),k.progress&&k.progress.call(g[1],g[1],m,Math.max(0,l+k.duration-b),l),1===m&&j(c)}s.State.isTicking&&p(i)}function j(a,b){if(!s.State.calls[a])return!1;for(var c=s.State.calls[a][0],e=s.State.calls[a][1],g=s.State.calls[a][2],h=s.State.calls[a][4],i=!1,j=0,k=c.length;k>j;j++){var l=c[j].element;if(b||g.loop||("none"===g.display&&v.setPropertyValue(l,"display",g.display),"hidden"===g.visibility&&v.setPropertyValue(l,"visibility",g.visibility)),(r.queue(l)[1]===d||!/\.velocityQueueEntryFlag/i.test(r.queue(l)[1]))&&f(l)){f(l).isAnimating=!1,f(l).rootPropertyValueCache={};var m=!1;r.each(f(l).transformCache,function(a,b){var c=/^scale/.test(a)?1:0;new RegExp("^\\("+c+"[^.]").test(b)&&(m=!0,delete f(l).transformCache[a])}),g.mobileHA&&(m=!0,delete f(l).transformCache.translate3d),m&&v.flushTransformCache(l),v.Values.removeClass(l,"velocity-animating")}if(!b&&g.complete&&!g.loop&&j===k-1)try{g.complete.call(e,e)}catch(n){setTimeout(function(){throw n},1)}h&&h(e),g.queue!==!1&&r.dequeue(l,g.queue)}s.State.calls[a]=!1;for(var o=0,p=s.State.calls.length;p>o;o++)if(s.State.calls[o]!==!1){i=!0;break}i===!1&&(s.State.isTicking=!1,delete s.State.calls,s.State.calls=[])}var k="velocity",l=400,m="swing",n=function(){if(c.documentMode)return c.documentMode;for(var a=7;a>4;a--){var b=c.createElement("div");if(b.innerHTML="",b.getElementsByTagName("span").length)return b=null,a}return d}(),o=function(){var a=0;return b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame||function(b){var c,d=(new Date).getTime();return c=Math.max(0,16-(d-a)),a=d+c,setTimeout(function(){b(d+c)},c)}}(),p=b.requestAnimationFrame||o,q={isString:function(a){return"string"==typeof a},isArray:Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)},isFunction:function(a){return"[object Function]"===Object.prototype.toString.call(a)},isNode:function(a){return a&&a.nodeType},isNodeList:function(a){return"object"==typeof a&&/^\[object (HTMLCollection|NodeList|Object)\]$/.test(Object.prototype.toString.call(a))&&a.length!==d&&(0===a.length||"object"==typeof a[0]&&a[0].nodeType>0)},isWrapped:function(a){return a&&(a.jquery||b.Zepto&&b.Zepto.zepto.isZ(a))},isSVG:function(a){return b.SVGElement&&a instanceof SVGElement}},r=b.jQuery||a.Velocity&&a.Velocity.Utilities;if(!r)throw new Error("Velocity: Either jQuery or Velocity's jQuery shim must first be loaded.");if(a.Velocity!==d&&!a.Velocity.Utilities)throw new Error("Velocity: Namespace is occupied.");if(7>=n){if(b.jQuery)return void(b.jQuery.fn.velocity=b.jQuery.fn.animate);throw new Error("Velocity: For IE<=7, Velocity falls back to jQuery, which must first be loaded.")}if(8===n&&!b.jQuery)throw new Error("Velocity: For IE8, Velocity requires jQuery to be loaded. (Velocity's jQuery shim does not work with IE8.)");var s=a.Velocity=a.velocity={State:{isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),isAndroid:/Android/i.test(navigator.userAgent),isGingerbread:/Android 2\.3\.[3-7]/i.test(navigator.userAgent),isChrome:b.chrome,isFirefox:/Firefox/i.test(navigator.userAgent),prefixElement:c.createElement("div"),prefixMatches:{},scrollAnchor:null,scrollPropertyLeft:null,scrollPropertyTop:null,isTicking:!1,calls:[]},CSS:{},Utilities:b.jQuery,Sequences:{},Easings:{},Promise:b.Promise,defaults:{queue:"",duration:l,easing:m,begin:null,complete:null,progress:null,display:null,loop:!1,delay:!1,mobileHA:!0,_cacheValues:!0},animate:function(){},mock:!1,version:{major:0,minor:9,patch:0},debug:!1};b.pageYOffset!==d?(s.State.scrollAnchor=b,s.State.scrollPropertyLeft="pageXOffset",s.State.scrollPropertyTop="pageYOffset"):(s.State.scrollAnchor=c.documentElement||c.body.parentNode||c.body,s.State.scrollPropertyLeft="scrollLeft",s.State.scrollPropertyTop="scrollTop"),s.State.isMobile||c.hidden===d||c.addEventListener("visibilitychange",function(){c.hidden?(p=function(a){return setTimeout(function(){a(!0)},16)},i()):p=b.requestAnimationFrame||o});var t=function(){function a(a,b){return 1-3*b+3*a}function b(a,b){return 3*b-6*a}function c(a){return 3*a}function d(d,e,f){return((a(e,f)*d+b(e,f))*d+c(e))*d}function e(d,e,f){return 3*a(e,f)*d*d+2*b(e,f)*d+c(e)}return function(a,b,c,f){function g(b){for(var f=b,g=0;8>g;++g){var h=e(f,a,c);if(0===h)return f;var i=d(f,a,c)-b;f-=i/h}return f}if(4!==arguments.length)return!1;for(var h=0;4>h;++h)if("number"!=typeof arguments[h]||isNaN(arguments[h])||!isFinite(arguments[h]))return!1;return a=Math.min(a,1),c=Math.min(c,1),a=Math.max(a,0),c=Math.max(c,0),function(e){return a===b&&c===f?e:d(g(e),b,f)}}}(),u=function(){function a(a){return-a.tension*a.x-a.friction*a.v}function b(b,c,d){var e={x:b.x+d.dx*c,v:b.v+d.dv*c,tension:b.tension,friction:b.friction};return{dx:e.v,dv:a(e)}}function c(c,d){var e={dx:c.v,dv:a(c)},f=b(c,.5*d,e),g=b(c,.5*d,f),h=b(c,d,g),i=1/6*(e.dx+2*(f.dx+g.dx)+h.dx),j=1/6*(e.dv+2*(f.dv+g.dv)+h.dv);return c.x=c.x+i*d,c.v=c.v+j*d,c}return function d(a,b,e){var f,g,h,i={x:-1,v:0,tension:null,friction:null},j=[0],k=0,l=1e-4,m=.016;for(a=parseFloat(a)||500,b=parseFloat(b)||20,e=e||null,i.tension=a,i.friction=b,f=null!==e,f?(k=d(a,b),g=k/e*m):g=m;;)if(h=c(h||i,g),j.push(1+h.x),k+=16,!(Math.abs(h.x)>l&&Math.abs(h.v)>l))break;return f?function(a){return j[a*(j.length-1)|0]}:k}}();!function(){s.Easings.linear=function(a){return a},s.Easings.swing=function(a){return.5-Math.cos(a*Math.PI)/2},s.Easings.spring=function(a){return 1-Math.cos(4.5*a*Math.PI)*Math.exp(6*-a)},s.Easings.ease=t(.25,.1,.25,1),s.Easings["ease-in"]=t(.42,0,1,1),s.Easings["ease-out"]=t(0,0,.58,1),s.Easings["ease-in-out"]=t(.42,0,.58,1);var a={};r.each(["Quad","Cubic","Quart","Quint","Expo"],function(b,c){a[c]=function(a){return Math.pow(a,b+2)}}),r.extend(a,{Sine:function(a){return 1-Math.cos(a*Math.PI/2)},Circ:function(a){return 1-Math.sqrt(1-a*a)},Elastic:function(a){return 0===a||1===a?a:-Math.pow(2,8*(a-1))*Math.sin((80*(a-1)-7.5)*Math.PI/15)},Back:function(a){return a*a*(3*a-2)},Bounce:function(a){for(var b,c=4;a<((b=Math.pow(2,--c))-1)/11;);return 1/Math.pow(4,3-c)-7.5625*Math.pow((3*b-2)/22-a,2)}}),r.each(a,function(a,b){s.Easings["easeIn"+a]=b,s.Easings["easeOut"+a]=function(a){return 1-b(1-a)},s.Easings["easeInOut"+a]=function(a){return.5>a?b(2*a)/2:1-b(-2*a+2)/2}})}();var v=s.CSS={RegEx:{isHex:/^#([A-f\d]{3}){1,2}$/i,valueUnwrap:/^[A-z]+\((.*)\)$/i,wrappedValueAlreadyExtracted:/[0-9.]+ [0-9.]+ [0-9.]+( [0-9.]+)?/,valueSplit:/([A-z]+\(.+\))|(([A-z0-9#-.]+?)(?=\s|$))/gi},Lists:{colors:["fill","stroke","stopColor","color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],transformsBase:["translateX","translateY","scale","scaleX","scaleY","skewX","skewY","rotateZ"],transforms3D:["transformPerspective","translateZ","scaleZ","rotateX","rotateY"]},Hooks:{templates:{textShadow:["Color X Y Blur","black 0px 0px 0px"],boxShadow:["Color X Y Blur Spread","black 0px 0px 0px 0px"],clip:["Top Right Bottom Left","0px 0px 0px 0px"],backgroundPosition:["X Y","0% 0%"],transformOrigin:["X Y Z","50% 50% 0px"],perspectiveOrigin:["X Y","50% 50%"]},registered:{},register:function(){for(var a=0;a=n)switch(a){case"name":return"filter";case"extract":var d=c.toString().match(/alpha\(opacity=(.*)\)/i);return c=d?d[1]/100:1;case"inject":return b.style.zoom=1,parseFloat(c)>=1?"":"alpha(opacity="+parseInt(100*parseFloat(c),10)+")"}else switch(a){case"name":return"opacity";case"extract":return c;case"inject":return c}}},register:function(){9>=n||s.State.isGingerbread||(v.Lists.transformsBase=v.Lists.transformsBase.concat(v.Lists.transforms3D));for(var a=0;ae&&(e=1),g=!/(\d)$/i.test(e);break;case"skew":g=!/(deg|\d)$/i.test(e);break;case"rotate":g=!/(deg|\d)$/i.test(e)}return g||(f(c).transformCache[b]="("+e+")"),f(c).transformCache[b]}}}();for(var a=0;a=n||3!==f.split(" ").length||(f+=" 1"),f;case"inject":return 8>=n?4===e.split(" ").length&&(e=e.split(/\s+/).slice(0,3).join(" ")):3===e.split(" ").length&&(e+=" 1"),(8>=n?"rgb":"rgba")+"("+e.replace(/\s+/g,",").replace(/\.(\d)+(?=,)/g,"")+")"}}}()}},Names:{camelCase:function(a){return a.replace(/-(\w)/g,function(a,b){return b.toUpperCase()})},SVGAttribute:function(a){var b="width|height|x|y|cx|cy|r|rx|ry|x1|x2|y1|y2";return(n||s.State.isAndroid&&!s.State.isChrome)&&(b+="|transform"),new RegExp("^("+b+")$","i").test(a)},prefixCheck:function(a){if(s.State.prefixMatches[a])return[s.State.prefixMatches[a],!0];for(var b=["","Webkit","Moz","ms","O"],c=0,d=b.length;d>c;c++){var e;if(e=0===c?a:b[c]+a.replace(/^\w/,function(a){return a.toUpperCase()}),q.isString(s.State.prefixElement.style[e]))return s.State.prefixMatches[a]=e,[e,!0]}return[a,!1]}},Values:{hexToRgb:function(a){var b,c=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,d=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i;return a=a.replace(c,function(a,b,c,d){return b+b+c+c+d+d}),b=d.exec(a),b?[parseInt(b[1],16),parseInt(b[2],16),parseInt(b[3],16)]:[0,0,0]},isCSSNullValue:function(a){return 0==a||/^(none|auto|transparent|(rgba\(0, ?0, ?0, ?0\)))$/i.test(a)},getUnitType:function(a){return/^(rotate|skew)/i.test(a)?"deg":/(^(scale|scaleX|scaleY|scaleZ|alpha|flexGrow|flexHeight|zIndex|fontWeight)$)|((opacity|red|green|blue|alpha)$)/i.test(a)?"":"px"},getDisplayType:function(a){var b=a.tagName.toString().toLowerCase();return/^(b|big|i|small|tt|abbr|acronym|cite|code|dfn|em|kbd|strong|samp|var|a|bdo|br|img|map|object|q|script|span|sub|sup|button|input|label|select|textarea)$/i.test(b)?"inline":/^(li)$/i.test(b)?"list-item":/^(tr)$/i.test(b)?"table-row":"block"},addClass:function(a,b){a.classList?a.classList.add(b):a.className+=(a.className.length?" ":"")+b},removeClass:function(a,b){a.classList?a.classList.remove(b):a.className=a.className.toString().replace(new RegExp("(^|\\s)"+b.split(" ").join("|")+"(\\s|$)","gi")," ")}},getPropertyValue:function(a,c,e,g){function h(a,c){function e(){j&&v.setPropertyValue(a,"display","none")}var i=0;if(8>=n)i=r.css(a,c);else{var j=!1;if(/^(width|height)$/.test(c)&&0===v.getPropertyValue(a,"display")&&(j=!0,v.setPropertyValue(a,"display",v.Values.getDisplayType(a))),!g){if("height"===c&&"border-box"!==v.getPropertyValue(a,"boxSizing").toString().toLowerCase()){var k=a.offsetHeight-(parseFloat(v.getPropertyValue(a,"borderTopWidth"))||0)-(parseFloat(v.getPropertyValue(a,"borderBottomWidth"))||0)-(parseFloat(v.getPropertyValue(a,"paddingTop"))||0)-(parseFloat(v.getPropertyValue(a,"paddingBottom"))||0);return e(),k}if("width"===c&&"border-box"!==v.getPropertyValue(a,"boxSizing").toString().toLowerCase()){var l=a.offsetWidth-(parseFloat(v.getPropertyValue(a,"borderLeftWidth"))||0)-(parseFloat(v.getPropertyValue(a,"borderRightWidth"))||0)-(parseFloat(v.getPropertyValue(a,"paddingLeft"))||0)-(parseFloat(v.getPropertyValue(a,"paddingRight"))||0);return e(),l}}var m;m=f(a)===d?b.getComputedStyle(a,null):f(a).computedStyle?f(a).computedStyle:f(a).computedStyle=b.getComputedStyle(a,null),(n||s.State.isFirefox)&&"borderColor"===c&&(c="borderTopColor"),i=9===n&&"filter"===c?m.getPropertyValue(c):m[c],(""===i||null===i)&&(i=a.style[c]),e()}if("auto"===i&&/^(top|right|bottom|left)$/i.test(c)){var o=h(a,"position");("fixed"===o||"absolute"===o&&/top|left/i.test(c))&&(i=r(a).position()[c]+"px")}return i}var i;if(v.Hooks.registered[c]){var j=c,k=v.Hooks.getRoot(j);e===d&&(e=v.getPropertyValue(a,v.Names.prefixCheck(k)[0])),v.Normalizations.registered[k]&&(e=v.Normalizations.registered[k]("extract",a,e)),i=v.Hooks.extractValue(j,e)}else if(v.Normalizations.registered[c]){var l,m;l=v.Normalizations.registered[c]("name",a),"transform"!==l&&(m=h(a,v.Names.prefixCheck(l)[0]),v.Values.isCSSNullValue(m)&&v.Hooks.templates[c]&&(m=v.Hooks.templates[c][1])),i=v.Normalizations.registered[c]("extract",a,m)}return/^[\d-]/.test(i)||(i=f(a)&&f(a).isSVG&&v.Names.SVGAttribute(c)?/^(height|width)$/i.test(c)?a.getBBox()[c]:a.getAttribute(c):h(a,v.Names.prefixCheck(c)[0])),v.Values.isCSSNullValue(i)&&(i=0),s.debug>=2&&console.log("Get "+c+": "+i),i},setPropertyValue:function(a,c,d,e,g){var h=c;if("scroll"===c)g.container?g.container["scroll"+g.direction]=d:"Left"===g.direction?b.scrollTo(d,g.alternateValue):b.scrollTo(g.alternateValue,d);else if(v.Normalizations.registered[c]&&"transform"===v.Normalizations.registered[c]("name",a))v.Normalizations.registered[c]("inject",a,d),h="transform",d=f(a).transformCache[c];else{if(v.Hooks.registered[c]){var i=c,j=v.Hooks.getRoot(c);e=e||v.getPropertyValue(a,j),d=v.Hooks.injectValue(i,d,e),c=j}if(v.Normalizations.registered[c]&&(d=v.Normalizations.registered[c]("inject",a,d),c=v.Normalizations.registered[c]("name",a)),h=v.Names.prefixCheck(c)[0],8>=n)try{a.style[h]=d}catch(k){s.debug&&console.log("Browser does not support ["+d+"] for ["+h+"]")}else f(a)&&f(a).isSVG&&v.Names.SVGAttribute(c)?a.setAttribute(c,d):a.style[h]=d;s.debug>=2&&console.log("Set "+c+" ("+h+"): "+d)}return[h,d]},flushTransformCache:function(a){function b(b){return parseFloat(v.getPropertyValue(a,b))}var c="";if((n||s.State.isAndroid&&!s.State.isChrome)&&f(a).isSVG){var d={translate:[b("translateX"),b("translateY")],skewX:[b("skewX")],skewY:[b("skewY")],scale:1!==b("scale")?[b("scale"),b("scale")]:[b("scaleX"),b("scaleY")],rotate:[b("rotateZ"),0,0]};r.each(f(a).transformCache,function(a){/^translate/i.test(a)?a="translate":/^scale/i.test(a)?a="scale":/^rotate/i.test(a)&&(a="rotate"),d[a]&&(c+=a+"("+d[a].join(" ")+") ",delete d[a])})}else{var e,g;r.each(f(a).transformCache,function(b){return e=f(a).transformCache[b],"transformPerspective"===b?(g=e,!0):(9===n&&"rotateZ"===b&&(b="rotate"),void(c+=b+e+" "))}),g&&(c="perspective"+g+" "+c)}v.setPropertyValue(a,"transform",c)}};v.Hooks.register(),v.Normalizations.register(),s.animate=function(){function a(){return m?C.promise||null:o}function g(){function a(){function a(a,b){var c=d,e=d,f=d;return q.isArray(a)?(c=a[0],!q.isArray(a[1])&&/^[\d-]/.test(a[1])||q.isFunction(a[1])||v.RegEx.isHex.test(a[1])?f=a[1]:(q.isString(a[1])&&!v.RegEx.isHex.test(a[1])||q.isArray(a[1]))&&(e=b?a[1]:h(a[1],j.duration),a[2]!==d&&(f=a[2]))):c=a,e=e||j.easing,q.isFunction(c)&&(c=c.call(g,z,y)),q.isFunction(f)&&(f=f.call(g,z,y)),[c||0,e,f]}function k(a,b){var c,d;return d=(b||0).toString().toLowerCase().replace(/[%A-z]+$/,function(a){return c=a,""}),c||(c=v.Values.getUnitType(a)),[d,c]}function l(){var a={parent:g.parentNode,position:v.getPropertyValue(g,"position"),fontSize:v.getPropertyValue(g,"fontSize")},d=a.position===I.lastPosition&&a.parent===I.lastParent,e=a.fontSize===I.lastFontSize&&a.parent===I.lastParent;I.lastParent=a.parent,I.lastPosition=a.position,I.lastFontSize=a.fontSize,null===I.remToPx&&(I.remToPx=parseFloat(v.getPropertyValue(c.body,"fontSize"))||16),null===I.vwToPx&&(I.vwToPx=parseFloat(b.innerWidth)/100,I.vhToPx=parseFloat(b.innerHeight)/100);var h={overflowX:null,overflowY:null,boxSizing:null,width:null,minWidth:null,maxWidth:null,height:null,minHeight:null,maxHeight:null,paddingLeft:null},i={},j=10;if(i.remToPx=I.remToPx,i.vwToPx=I.vwToPx,i.vhToPx=I.vhToPx,n&&!f(g).isSVG)var k=/^auto$/i.test(g.currentStyle.width),l=/^auto$/i.test(g.currentStyle.height);d&&e||(f(g).isSVG||(h.overflowX=v.getPropertyValue(g,"overflowX"),h.overflowY=v.getPropertyValue(g,"overflowY"),h.boxSizing=v.getPropertyValue(g,"boxSizing"),h.minWidth=v.getPropertyValue(g,"minWidth"),h.maxWidth=v.getPropertyValue(g,"maxWidth")||"none",h.minHeight=v.getPropertyValue(g,"minHeight"),h.maxHeight=v.getPropertyValue(g,"maxHeight")||"none",h.paddingLeft=v.getPropertyValue(g,"paddingLeft")),h.width=v.getPropertyValue(g,"width",null,!0),h.height=v.getPropertyValue(g,"height",null,!0)),d?(i.percentToPxRatioWidth=I.lastPercentToPxWidth,i.percentToPxRatioHeight=I.lastPercentToPxHeight):(f(g).isSVG||(v.setPropertyValue(g,"overflowX","hidden"),v.setPropertyValue(g,"overflowY","hidden"),v.setPropertyValue(g,"boxSizing","content-box"),v.setPropertyValue(g,"minWidth",j+"%"),v.setPropertyValue(g,"maxWidth",j+"%"),v.setPropertyValue(g,"minHeight",j+"%"),v.setPropertyValue(g,"maxHeight",j+"%")),v.setPropertyValue(g,"width",j+"%"),v.setPropertyValue(g,"height",j+"%")),e?i.emToPx=I.lastEmToPx:f(g).isSVG||v.setPropertyValue(g,"paddingLeft",j+"em"),d||(i.percentToPxRatioWidth=I.lastPercentToPxWidth=(parseFloat(v.getPropertyValue(g,"width",null,!0))||1)/j,i.percentToPxRatioHeight=I.lastPercentToPxHeight=(parseFloat(v.getPropertyValue(g,"height",null,!0))||1)/j),e||(i.emToPx=I.lastEmToPx=(parseFloat(v.getPropertyValue(g,"paddingLeft"))||1)/j);for(var m in h)null!==h[m]&&v.setPropertyValue(g,m,h[m]);return f(g).isSVG||(n?(k&&v.setPropertyValue(g,"width","auto"),l&&v.setPropertyValue(g,"height","auto")):(v.setPropertyValue(g,"height","auto"),h.height!==v.getPropertyValue(g,"height",null,!0)&&v.setPropertyValue(g,"height",h.height),v.setPropertyValue(g,"width","auto"),h.width!==v.getPropertyValue(g,"width",null,!0)&&v.setPropertyValue(g,"width",h.width))),s.debug>=1&&console.log("Unit ratios: "+JSON.stringify(i),g),i}if(j.begin&&0===z)try{j.begin.call(t,t)}catch(o){setTimeout(function(){throw o},1)}if("scroll"===D){var p,x,A,B=/^x$/i.test(j.axis)?"Left":"Top",E=parseFloat(j.offset)||0;j.container?j.container.jquery||q.isNode(j.container)?(j.container=j.container[0]||j.container,p=j.container["scroll"+B],A=p+r(g).position()[B.toLowerCase()]+E):j.container=null:(p=s.State.scrollAnchor[s.State["scrollProperty"+B]],x=s.State.scrollAnchor[s.State["scrollProperty"+("Left"===B?"Top":"Left")]],A=r(g).offset()[B.toLowerCase()]+E),m={scroll:{rootPropertyValue:!1,startValue:p,currentValue:p,endValue:A,unitType:"",easing:j.easing,scrollData:{container:j.container,direction:B,alternateValue:x}},element:g},s.debug&&console.log("tweensContainer (scroll): ",m.scroll,g)}else if("reverse"===D){if(!f(g).tweensContainer)return void r.dequeue(g,j.queue);"none"===f(g).opts.display&&(f(g).opts.display="block"),"hidden"===f(g).opts.visibility&&(f(g).opts.visibility="visible"),f(g).opts.loop=!1,f(g).opts.begin=null,f(g).opts.complete=null,w.easing||delete j.easing,w.duration||delete j.duration,j=r.extend({},f(g).opts,j);var F=r.extend(!0,{},f(g).tweensContainer);for(var G in F)if("element"!==G){var H=F[G].startValue;F[G].startValue=F[G].currentValue=F[G].endValue,F[G].endValue=H,r.isEmptyObject(w)||(F[G].easing=j.easing),s.debug&&console.log("reverse tweensContainer ("+G+"): "+JSON.stringify(F[G]),g)}m=F}else if("start"===D){var F;f(g).tweensContainer&&f(g).isAnimating===!0&&(F=f(g).tweensContainer),r.each(u,function(b,c){var e=a(c,!0),f=e[0],g=e[1],h=e[2];if(RegExp(v.Lists.colors.join("|")).test(b)&&v.RegEx.isHex.test(f)){for(var i=["Red","Green","Blue"],j=v.Values.hexToRgb(f),k=h?v.Values.hexToRgb(h):d,l=0;l1e4&&(s.State.calls=e(s.State.calls)),s.State.calls.push([J,t,j,null,C.resolver]),s.State.isTicking===!1&&(s.State.isTicking=!0,i())):z++)}var g=this,j=r.extend({},s.defaults,w),m={};if(f(g)===d&&r.data(g,k,{isSVG:q.isSVG(g),isAnimating:!1,computedStyle:null,tweensContainer:null,rootPropertyValueCache:{},transformCache:{}}),parseFloat(j.delay)&&j.queue!==!1&&r.queue(g,j.queue,function(a){s.velocityQueueEntryFlag=!0,f(g).delayTimer={setTimeout:setTimeout(a,parseFloat(j.delay)),next:a}}),s.mock===!0)j.duration=1;else switch(j.duration.toString().toLowerCase()){case"fast":j.duration=200;break;case"normal":j.duration=l;break;case"slow":j.duration=600;break;default:j.duration=parseFloat(j.duration)||1}j.easing=h(j.easing,j.duration),j.begin&&!q.isFunction(j.begin)&&(j.begin=null),j.progress&&!q.isFunction(j.progress)&&(j.progress=null),j.complete&&!q.isFunction(j.complete)&&(j.complete=null),j.display&&(j.display=j.display.toString().toLowerCase(),"auto"===j.display&&(j.display=s.CSS.Values.getDisplayType(g))),j.visibility&&(j.visibility=j.visibility.toString().toLowerCase()),j.mobileHA=j.mobileHA&&s.State.isMobile&&!s.State.isGingerbread,j.queue===!1?j.delay?setTimeout(a,j.delay):a():r.queue(g,j.queue,function(b,c){return c===!0?(C.promise&&C.resolver(t),!0):(s.velocityQueueEntryFlag=!0,void a(b))}),""!==j.queue&&"fx"!==j.queue||"inprogress"===r.queue(g)[0]||r.dequeue(g)}var m,o,p,t,u,w,x=arguments[0]&&(r.isPlainObject(arguments[0].properties)&&!arguments[0].properties.names||q.isString(arguments[0].properties));if(q.isWrapped(this)?(m=!1,p=0,t=this,o=this):(m=!0,p=1,t=x?arguments[0].elements:arguments[0]),t=q.isWrapped(t)?[].slice.call(t):t){x?(u=arguments[0].properties,w=arguments[0].options):(u=arguments[p],w=arguments[p+1]);var y=q.isArray(t)||q.isNodeList(t)?t.length:1,z=0;if("stop"!==u&&!r.isPlainObject(w)){var A=p+1;w={};for(var B=A;BM;M++){var N={delay:L.delay};L.complete&&M===K-1&&(N.complete=L.complete),s.animate(t,"reverse",N)}return a()}};var w=b.jQuery||b.Zepto;w&&(w.fn.velocity=s.animate,w.fn.velocity.defaults=s.defaults),"undefined"!=typeof define&&define.amd?define(function(){return s}):"undefined"!=typeof module&&module.exports&&(module.exports=s),r.each(["Down","Up"],function(a,b){s.Sequences["slide"+b]=function(a,c){var d=r.extend({},c),e={height:null,marginTop:null,marginBottom:null,paddingTop:null,paddingBottom:null,overflow:null,overflowX:null,overflowY:null},f=d.begin,g=d.complete,h=!1;null!==d.display&&(d.display="Down"===b?d.display||"auto":d.display||"none"),d.begin=function(){function c(){e.height=parseFloat(s.CSS.getPropertyValue(a,"height")),a.style.height="auto",parseFloat(s.CSS.getPropertyValue(a,"height"))===e.height&&(h=!0),s.CSS.setPropertyValue(a,"height",e.height+"px")}if("Down"===b){e.overflow=[s.CSS.getPropertyValue(a,"overflow"),0],e.overflowX=[s.CSS.getPropertyValue(a,"overflowX"),0],e.overflowY=[s.CSS.getPropertyValue(a,"overflowY"),0],a.style.overflow="hidden",a.style.overflowX="visible",a.style.overflowY="hidden",c();for(var d in e)if(!/^overflow/.test(d)){var g=s.CSS.getPropertyValue(a,d);"height"===d&&(g=parseFloat(g)),e[d]=[g,0]}}else{c();for(var d in e){var g=s.CSS.getPropertyValue(a,d);"height"===d&&(g=parseFloat(g)),e[d]=[0,g]}a.style.overflow="hidden",a.style.overflowX="visible",a.style.overflowY="hidden"}f&&f.call(a,a)},d.complete=function(a){var c="Down"===b?0:1;h===!0?e.height[c]="auto":e.height[c]+="px";for(var d in e)a.style[d]=e[d][c];g&&g.call(a,a)},s.animate(a,e,d)}}),r.each(["In","Out"],function(a,b){s.Sequences["fade"+b]=function(a,c,d,e){var f=r.extend({},c),g={opacity:"In"===b?1:0};d!==e-1&&(f.complete=f.begin=null),null!==f.display&&(f.display=f.display||("In"===b?"auto":"none")),s.animate(this,g,f)}})}(window.jQuery||window.Zepto||window,window,document); \ No newline at end of file +!function(e,t,r,a){function o(e){for(var t=-1,r=e?e.length:0,a=[];++tr;r++)if(y.State.calls[r]){var n=y.State.calls[r],s=n[0],c=n[2],p=n[3];p||(p=y.State.calls[r][3]=t-16);for(var g=Math.min((t-p)/c.duration,1),d=0,f=s.length;f>d;d++){var v=s[d],x=v.element;if(i(x)){var S=!1;c.display&&"none"!==c.display&&b.setPropertyValue(x,"display",c.display),c.visibility&&"hidden"!==c.visibility&&b.setPropertyValue(x,"visibility",c.visibility);for(var V in v)if("element"!==V){var P=v[V],w,T=m.isString(P.easing)?y.Easings[P.easing]:P.easing;if(w=1===g?P.endValue:P.startValue+(P.endValue-P.startValue)*T(g),P.currentValue=w,b.Hooks.registered[V]){var C=b.Hooks.getRoot(V),k=i(x).rootPropertyValueCache[C];k&&(P.rootPropertyValue=k)}var E=b.setPropertyValue(x,V,P.currentValue+(0===parseFloat(w)?"":P.unitType),P.rootPropertyValue,P.scrollData);b.Hooks.registered[V]&&(i(x).rootPropertyValueCache[C]=b.Normalizations.registered[C]?b.Normalizations.registered[C]("extract",null,E[1]):E[1]),"transform"===E[0]&&(S=!0)}c.mobileHA&&i(x).transformCache.translate3d===a&&(i(x).transformCache.translate3d="(0px, 0px, 0px)",S=!0),S&&b.flushTransformCache(x)}}c.display&&"none"!==c.display&&(y.State.calls[r][2].display=!1),c.visibility&&"hidden"!==c.visibility&&(y.State.calls[r][2].visibility=!1),c.progress&&c.progress.call(n[1],n[1],g,Math.max(0,p+c.duration-t),p),1===g&&u(r)}y.State.isTicking&&h(l)}function u(e,t){if(!y.State.calls[e])return!1;for(var r=y.State.calls[e][0],o=y.State.calls[e][1],n=y.State.calls[e][2],s=y.State.calls[e][4],l=!1,u=0,c=r.length;c>u;u++){var p=r[u].element;if(t||n.loop||("none"===n.display&&b.setPropertyValue(p,"display",n.display),"hidden"===n.visibility&&b.setPropertyValue(p,"visibility",n.visibility)),($.queue(p)[1]===a||!/\.velocityQueueEntryFlag/i.test($.queue(p)[1]))&&i(p)){i(p).isAnimating=!1,i(p).rootPropertyValueCache={};var g=!1;$.each(i(p).transformCache,function(e,t){var r=/^scale/.test(e)?1:0;new RegExp("^\\("+r+"[^.]").test(t)&&(g=!0,delete i(p).transformCache[e])}),n.mobileHA&&(g=!0,delete i(p).transformCache.translate3d),g&&b.flushTransformCache(p),b.Values.removeClass(p,"velocity-animating")}if(!t&&n.complete&&!n.loop&&u===c-1)try{n.complete.call(o,o)}catch(d){setTimeout(function(){throw d},1)}s&&n.loop!==!0&&s(o),n.loop!==!0||t||y.animate(p,"reverse",{loop:!0,delay:n.delay}),n.queue!==!1&&$.dequeue(p,n.queue)}y.State.calls[e]=!1;for(var f=0,h=y.State.calls.length;h>f;f++)if(y.State.calls[f]!==!1){l=!0;break}l===!1&&(y.State.isTicking=!1,delete y.State.calls,y.State.calls=[])}var c="velocity",p=400,g="swing",d=function(){if(r.documentMode)return r.documentMode;for(var e=7;e>4;e--){var t=r.createElement("div");if(t.innerHTML="",t.getElementsByTagName("span").length)return t=null,e}return a}(),f=function(){var e=0;return t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||function(t){var r=(new Date).getTime(),a;return a=Math.max(0,16-(r-e)),e=r+a,setTimeout(function(){t(r+a)},a)}}(),h=t.requestAnimationFrame||f,m={isString:function(e){return"string"==typeof e},isArray:Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},isFunction:function(e){return"[object Function]"===Object.prototype.toString.call(e)},isNode:function(e){return e&&e.nodeType},isNodeList:function(e){return"object"==typeof e&&/^\[object (HTMLCollection|NodeList|Object)\]$/.test(Object.prototype.toString.call(e))&&e.length!==a&&(0===e.length||"object"==typeof e[0]&&e[0].nodeType>0)},isWrapped:function(e){return e&&(e.jquery||t.Zepto&&t.Zepto.zepto.isZ(e))},isSVG:function(e){return t.SVGElement&&e instanceof SVGElement},isEmptyObject:function(e){var t;for(t in e)return!1;return!0}},$=t.jQuery||e.Velocity&&e.Velocity.Utilities;if(!$)throw new Error("Velocity: Either jQuery or Velocity's jQuery shim must first be loaded.");if(e.Velocity!==a&&!e.Velocity.Utilities)throw new Error("Velocity: Namespace is occupied.");if(7>=d){if(t.jQuery)return void(t.jQuery.fn.velocity=t.jQuery.fn.animate);throw new Error("Velocity: For IE<=7, Velocity falls back to jQuery, which must first be loaded.")}if(8===d&&!t.jQuery)throw new Error("Velocity: For IE8, Velocity requires jQuery to be loaded. (Velocity's jQuery shim does not work with IE8.)");var y=e.Velocity=e.velocity=$.extend({State:{isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),isAndroid:/Android/i.test(navigator.userAgent),isGingerbread:/Android 2\.3\.[3-7]/i.test(navigator.userAgent),isChrome:t.chrome,isFirefox:/Firefox/i.test(navigator.userAgent),prefixElement:r.createElement("div"),prefixMatches:{},scrollAnchor:null,scrollPropertyLeft:null,scrollPropertyTop:null,isTicking:!1,calls:[]},CSS:{},Utilities:t.jQuery,Sequences:{},Easings:{},Promise:t.Promise,defaults:{queue:"",duration:p,easing:g,begin:null,complete:null,progress:null,display:null,loop:!1,delay:!1,mobileHA:!0,_cacheValues:!0},animate:function(){},mock:!1,version:{major:0,minor:10,patch:0},debug:!1},t.Velocity);t.pageYOffset!==a?(y.State.scrollAnchor=t,y.State.scrollPropertyLeft="pageXOffset",y.State.scrollPropertyTop="pageYOffset"):(y.State.scrollAnchor=r.documentElement||r.body.parentNode||r.body,y.State.scrollPropertyLeft="scrollLeft",y.State.scrollPropertyTop="scrollTop"),y.State.isMobile||r.hidden===a||r.addEventListener("visibilitychange",function(){r.hidden?(h=function(e){return setTimeout(function(){e(!0)},16)},l()):h=t.requestAnimationFrame||f});var v=function(){function e(e,t){return 1-3*t+3*e}function t(e,t){return 3*t-6*e}function r(e){return 3*e}function a(a,o,i){return((e(o,i)*a+t(o,i))*a+r(o))*a}function o(a,o,i){return 3*e(o,i)*a*a+2*t(o,i)*a+r(o)}return function(e,t,r,i){function n(t){for(var i=t,n=0;8>n;++n){var s=o(i,e,r);if(0===s)return i;var l=a(i,e,r)-t;i-=l/s}return i}if(4!==arguments.length)return!1;for(var s=0;4>s;++s)if("number"!=typeof arguments[s]||isNaN(arguments[s])||!isFinite(arguments[s]))return!1;return e=Math.min(e,1),r=Math.min(r,1),e=Math.max(e,0),r=Math.max(r,0),function(o){return e===t&&r===i?o:a(n(o),t,i)}}}(),x=function(){function e(e){return-e.tension*e.x-e.friction*e.v}function t(t,r,a){var o={x:t.x+a.dx*r,v:t.v+a.dv*r,tension:t.tension,friction:t.friction};return{dx:o.v,dv:e(o)}}function r(r,a){var o={dx:r.v,dv:e(r)},i=t(r,.5*a,o),n=t(r,.5*a,i),s=t(r,a,n),l=1/6*(o.dx+2*(i.dx+n.dx)+s.dx),u=1/6*(o.dv+2*(i.dv+n.dv)+s.dv);return r.x=r.x+l*a,r.v=r.v+u*a,r}return function a(e,t,o){var i={x:-1,v:0,tension:null,friction:null},n=[0],s=0,l=1e-4,u=.016,c,p,g;for(e=parseFloat(e)||500,t=parseFloat(t)||20,o=o||null,i.tension=e,i.friction=t,c=null!==o,c?(s=a(e,t),p=s/o*u):p=u;;)if(g=r(g||i,p),n.push(1+g.x),s+=16,!(Math.abs(g.x)>l&&Math.abs(g.v)>l))break;return c?function(e){return n[e*(n.length-1)|0]}:s}}();!function(){y.Easings.linear=function(e){return e},y.Easings.swing=function(e){return.5-Math.cos(e*Math.PI)/2},y.Easings.spring=function(e){return 1-Math.cos(4.5*e*Math.PI)*Math.exp(6*-e)},y.Easings.ease=v(.25,.1,.25,1),y.Easings["ease-in"]=v(.42,0,1,1),y.Easings["ease-out"]=v(0,0,.58,1),y.Easings["ease-in-out"]=v(.42,0,.58,1);var e={};$.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,r){e[r]=function(e){return Math.pow(e,t+2)}}),$.extend(e,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return 0===e||1===e?e:-Math.pow(2,8*(e-1))*Math.sin((80*(e-1)-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){for(var t,r=4;e<((t=Math.pow(2,--r))-1)/11;);return 1/Math.pow(4,3-r)-7.5625*Math.pow((3*t-2)/22-e,2)}}),$.each(e,function(e,t){y.Easings["easeIn"+e]=t,y.Easings["easeOut"+e]=function(e){return 1-t(1-e)},y.Easings["easeInOut"+e]=function(e){return.5>e?t(2*e)/2:1-t(-2*e+2)/2}})}();var b=y.CSS={RegEx:{isHex:/^#([A-f\d]{3}){1,2}$/i,valueUnwrap:/^[A-z]+\((.*)\)$/i,wrappedValueAlreadyExtracted:/[0-9.]+ [0-9.]+ [0-9.]+( [0-9.]+)?/,valueSplit:/([A-z]+\(.+\))|(([A-z0-9#-.]+?)(?=\s|$))/gi},Lists:{colors:["fill","stroke","stopColor","color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],transformsBase:["translateX","translateY","scale","scaleX","scaleY","skewX","skewY","rotateZ"],transforms3D:["transformPerspective","translateZ","scaleZ","rotateX","rotateY"]},Hooks:{templates:{textShadow:["Color X Y Blur","black 0px 0px 0px"],boxShadow:["Color X Y Blur Spread","black 0px 0px 0px 0px"],clip:["Top Right Bottom Left","0px 0px 0px 0px"],backgroundPosition:["X Y","0% 0%"],transformOrigin:["X Y Z","50% 50% 0px"],perspectiveOrigin:["X Y","50% 50%"]},registered:{},register:function(){for(var e=0;e=d)switch(e){case"name":return"filter";case"extract":var a=r.toString().match(/alpha\(opacity=(.*)\)/i);return r=a?a[1]/100:1;case"inject":return t.style.zoom=1,parseFloat(r)>=1?"":"alpha(opacity="+parseInt(100*parseFloat(r),10)+")"}else switch(e){case"name":return"opacity";case"extract":return r;case"inject":return r}}},register:function(){9>=d||y.State.isGingerbread||(b.Lists.transformsBase=b.Lists.transformsBase.concat(b.Lists.transforms3D));for(var e=0;eo&&(o=1),n=!/(\d)$/i.test(o);break;case"skew":n=!/(deg|\d)$/i.test(o);break;case"rotate":n=!/(deg|\d)$/i.test(o)}return n||(i(r).transformCache[t]="("+o+")"),i(r).transformCache[t]}}}();for(var e=0;e=d||3!==i.split(" ").length||(i+=" 1"),i;case"inject":return 8>=d?4===o.split(" ").length&&(o=o.split(/\s+/).slice(0,3).join(" ")):3===o.split(" ").length&&(o+=" 1"),(8>=d?"rgb":"rgba")+"("+o.replace(/\s+/g,",").replace(/\.(\d)+(?=,)/g,"")+")"}}}()}},Names:{camelCase:function(e){return e.replace(/-(\w)/g,function(e,t){return t.toUpperCase()})},SVGAttribute:function(e){var t="width|height|x|y|cx|cy|r|rx|ry|x1|x2|y1|y2";return(d||y.State.isAndroid&&!y.State.isChrome)&&(t+="|transform"),new RegExp("^("+t+")$","i").test(e)},prefixCheck:function(e){if(y.State.prefixMatches[e])return[y.State.prefixMatches[e],!0];for(var t=["","Webkit","Moz","ms","O"],r=0,a=t.length;a>r;r++){var o;if(o=0===r?e:t[r]+e.replace(/^\w/,function(e){return e.toUpperCase()}),m.isString(y.State.prefixElement.style[o]))return y.State.prefixMatches[e]=o,[o,!0]}return[e,!1]}},Values:{hexToRgb:function(e){var t=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,a;return e=e.replace(t,function(e,t,r,a){return t+t+r+r+a+a}),a=r.exec(e),a?[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16)]:[0,0,0]},isCSSNullValue:function(e){return 0==e||/^(none|auto|transparent|(rgba\(0, ?0, ?0, ?0\)))$/i.test(e)},getUnitType:function(e){return/^(rotate|skew)/i.test(e)?"deg":/(^(scale|scaleX|scaleY|scaleZ|alpha|flexGrow|flexHeight|zIndex|fontWeight)$)|((opacity|red|green|blue|alpha)$)/i.test(e)?"":"px"},getDisplayType:function(e){var t=e.tagName.toString().toLowerCase();return/^(b|big|i|small|tt|abbr|acronym|cite|code|dfn|em|kbd|strong|samp|var|a|bdo|br|img|map|object|q|script|span|sub|sup|button|input|label|select|textarea)$/i.test(t)?"inline":/^(li)$/i.test(t)?"list-item":/^(tr)$/i.test(t)?"table-row":"block"},addClass:function(e,t){e.classList?e.classList.add(t):e.className+=(e.className.length?" ":"")+t},removeClass:function(e,t){e.classList?e.classList.remove(t):e.className=e.className.toString().replace(new RegExp("(^|\\s)"+t.split(" ").join("|")+"(\\s|$)","gi")," ")}},getPropertyValue:function(e,r,o,n){function s(e,r){function o(){u&&b.setPropertyValue(e,"display","none")}var l=0;if(8>=d)l=$.css(e,r);else{var u=!1;if(/^(width|height)$/.test(r)&&0===b.getPropertyValue(e,"display")&&(u=!0,b.setPropertyValue(e,"display",b.Values.getDisplayType(e))),!n){if("height"===r&&"border-box"!==b.getPropertyValue(e,"boxSizing").toString().toLowerCase()){var c=e.offsetHeight-(parseFloat(b.getPropertyValue(e,"borderTopWidth"))||0)-(parseFloat(b.getPropertyValue(e,"borderBottomWidth"))||0)-(parseFloat(b.getPropertyValue(e,"paddingTop"))||0)-(parseFloat(b.getPropertyValue(e,"paddingBottom"))||0);return o(),c}if("width"===r&&"border-box"!==b.getPropertyValue(e,"boxSizing").toString().toLowerCase()){var p=e.offsetWidth-(parseFloat(b.getPropertyValue(e,"borderLeftWidth"))||0)-(parseFloat(b.getPropertyValue(e,"borderRightWidth"))||0)-(parseFloat(b.getPropertyValue(e,"paddingLeft"))||0)-(parseFloat(b.getPropertyValue(e,"paddingRight"))||0);return o(),p}}var g;g=i(e)===a?t.getComputedStyle(e,null):i(e).computedStyle?i(e).computedStyle:i(e).computedStyle=t.getComputedStyle(e,null),(d||y.State.isFirefox)&&"borderColor"===r&&(r="borderTopColor"),l=9===d&&"filter"===r?g.getPropertyValue(r):g[r],(""===l||null===l)&&(l=e.style[r]),o()}if("auto"===l&&/^(top|right|bottom|left)$/i.test(r)){var f=s(e,"position");("fixed"===f||"absolute"===f&&/top|left/i.test(r))&&(l=$(e).position()[r]+"px")}return l}var l;if(b.Hooks.registered[r]){var u=r,c=b.Hooks.getRoot(u);o===a&&(o=b.getPropertyValue(e,b.Names.prefixCheck(c)[0])),b.Normalizations.registered[c]&&(o=b.Normalizations.registered[c]("extract",e,o)),l=b.Hooks.extractValue(u,o)}else if(b.Normalizations.registered[r]){var p,g;p=b.Normalizations.registered[r]("name",e),"transform"!==p&&(g=s(e,b.Names.prefixCheck(p)[0]),b.Values.isCSSNullValue(g)&&b.Hooks.templates[r]&&(g=b.Hooks.templates[r][1])),l=b.Normalizations.registered[r]("extract",e,g)}return/^[\d-]/.test(l)||(l=i(e)&&i(e).isSVG&&b.Names.SVGAttribute(r)?/^(height|width)$/i.test(r)?e.getBBox()[r]:e.getAttribute(r):s(e,b.Names.prefixCheck(r)[0])),b.Values.isCSSNullValue(l)&&(l=0),y.debug>=2&&console.log("Get "+r+": "+l),l},setPropertyValue:function(e,r,a,o,n){var s=r;if("scroll"===r)n.container?n.container["scroll"+n.direction]=a:"Left"===n.direction?t.scrollTo(a,n.alternateValue):t.scrollTo(n.alternateValue,a);else if(b.Normalizations.registered[r]&&"transform"===b.Normalizations.registered[r]("name",e))b.Normalizations.registered[r]("inject",e,a),s="transform",a=i(e).transformCache[r];else{if(b.Hooks.registered[r]){var l=r,u=b.Hooks.getRoot(r);o=o||b.getPropertyValue(e,u),a=b.Hooks.injectValue(l,a,o),r=u}if(b.Normalizations.registered[r]&&(a=b.Normalizations.registered[r]("inject",e,a),r=b.Normalizations.registered[r]("name",e)),s=b.Names.prefixCheck(r)[0],8>=d)try{e.style[s]=a}catch(c){y.debug&&console.log("Browser does not support ["+a+"] for ["+s+"]")}else i(e)&&i(e).isSVG&&b.Names.SVGAttribute(r)?e.setAttribute(r,a):e.style[s]=a;y.debug>=2&&console.log("Set "+r+" ("+s+"): "+a)}return[s,a]},flushTransformCache:function(e){function t(t){return parseFloat(b.getPropertyValue(e,t))}var r="";if((d||y.State.isAndroid&&!y.State.isChrome)&&i(e).isSVG){var a={translate:[t("translateX"),t("translateY")],skewX:[t("skewX")],skewY:[t("skewY")],scale:1!==t("scale")?[t("scale"),t("scale")]:[t("scaleX"),t("scaleY")],rotate:[t("rotateZ"),0,0]};$.each(i(e).transformCache,function(e){/^translate/i.test(e)?e="translate":/^scale/i.test(e)?e="scale":/^rotate/i.test(e)&&(e="rotate"),a[e]&&(r+=e+"("+a[e].join(" ")+") ",delete a[e])})}else{var o,n;$.each(i(e).transformCache,function(t){return o=i(e).transformCache[t],"transformPerspective"===t?(n=o,!0):(9===d&&"rotateZ"===t&&(t="rotate"),void(r+=t+o+" "))}),n&&(r="perspective"+n+" "+r)}b.setPropertyValue(e,"transform",r)}};b.Hooks.register(),b.Normalizations.register(),y.animate=function(){function e(){return f?k.promise||null:h}function n(){function e(e){function c(e,t){var r=a,o=a,i=a;return m.isArray(e)?(r=e[0],!m.isArray(e[1])&&/^[\d-]/.test(e[1])||m.isFunction(e[1])||b.RegEx.isHex.test(e[1])?i=e[1]:(m.isString(e[1])&&!b.RegEx.isHex.test(e[1])||m.isArray(e[1]))&&(o=t?e[1]:s(e[1],u.duration),e[2]!==a&&(i=e[2]))):r=e,o=o||u.easing,m.isFunction(r)&&(r=r.call(n,w,P)),m.isFunction(i)&&(i=i.call(n,w,P)),[r||0,o,i]}function p(e,t){var r,a;return a=(t||0).toString().toLowerCase().replace(/[%A-z]+$/,function(e){return r=e,""}),r||(r=b.Values.getUnitType(e)),[a,r]}function f(){var e={parent:n.parentNode,position:b.getPropertyValue(n,"position"),fontSize:b.getPropertyValue(n,"fontSize")},a=e.position===j.lastPosition&&e.parent===j.lastParent,o=e.fontSize===j.lastFontSize&&e.parent===j.lastParent;j.lastParent=e.parent,j.lastPosition=e.position,j.lastFontSize=e.fontSize,null===j.remToPx&&(j.remToPx=parseFloat(b.getPropertyValue(r.body,"fontSize"))||16),null===j.vwToPx&&(j.vwToPx=parseFloat(t.innerWidth)/100,j.vhToPx=parseFloat(t.innerHeight)/100);var s={overflowX:null,overflowY:null,boxSizing:null,width:null,minWidth:null,maxWidth:null,height:null,minHeight:null,maxHeight:null,paddingLeft:null},l={},u=10;if(l.remToPx=j.remToPx,l.vwToPx=j.vwToPx,l.vhToPx=j.vhToPx,d&&!i(n).isSVG)var c=/^auto$/i.test(n.currentStyle.width),p=/^auto$/i.test(n.currentStyle.height);a&&o||(i(n).isSVG||(s.overflowX=b.getPropertyValue(n,"overflowX"),s.overflowY=b.getPropertyValue(n,"overflowY"),s.boxSizing=b.getPropertyValue(n,"boxSizing"),s.minWidth=b.getPropertyValue(n,"minWidth"),s.maxWidth=b.getPropertyValue(n,"maxWidth")||"none",s.minHeight=b.getPropertyValue(n,"minHeight"),s.maxHeight=b.getPropertyValue(n,"maxHeight")||"none",s.paddingLeft=b.getPropertyValue(n,"paddingLeft")),s.width=b.getPropertyValue(n,"width",null,!0),s.height=b.getPropertyValue(n,"height",null,!0)),a?(l.percentToPxRatioWidth=j.lastPercentToPxWidth,l.percentToPxRatioHeight=j.lastPercentToPxHeight):(i(n).isSVG||(b.setPropertyValue(n,"overflowX","hidden"),b.setPropertyValue(n,"overflowY","hidden"),b.setPropertyValue(n,"boxSizing","content-box"),b.setPropertyValue(n,"minWidth",u+"%"),b.setPropertyValue(n,"maxWidth",u+"%"),b.setPropertyValue(n,"minHeight",u+"%"),b.setPropertyValue(n,"maxHeight",u+"%")),b.setPropertyValue(n,"width",u+"%"),b.setPropertyValue(n,"height",u+"%")),o?l.emToPx=j.lastEmToPx:i(n).isSVG||b.setPropertyValue(n,"paddingLeft",u+"em"),a||(l.percentToPxRatioWidth=j.lastPercentToPxWidth=(parseFloat(b.getPropertyValue(n,"width",null,!0))||1)/u,l.percentToPxRatioHeight=j.lastPercentToPxHeight=(parseFloat(b.getPropertyValue(n,"height",null,!0))||1)/u),o||(l.emToPx=j.lastEmToPx=(parseFloat(b.getPropertyValue(n,"paddingLeft"))||1)/u);for(var g in s)null!==s[g]&&b.setPropertyValue(n,g,s[g]);return i(n).isSVG||(d?(c&&b.setPropertyValue(n,"width","auto"),p&&b.setPropertyValue(n,"height","auto")):(b.setPropertyValue(n,"height","auto"),s.height!==b.getPropertyValue(n,"height",null,!0)&&b.setPropertyValue(n,"height",s.height),b.setPropertyValue(n,"width","auto"),s.width!==b.getPropertyValue(n,"width",null,!0)&&b.setPropertyValue(n,"width",s.width))),y.debug>=1&&console.log("Unit ratios: "+JSON.stringify(l),n),l}if(u.begin&&0===w)try{u.begin.call(x,x)}catch(h){setTimeout(function(){throw h},1)}if("scroll"===E){var v=/^x$/i.test(u.axis)?"Left":"Top",T=parseFloat(u.offset)||0,C,F,H;u.container?u.container.jquery||m.isNode(u.container)?(u.container=u.container[0]||u.container,C=u.container["scroll"+v],H=C+$(n).position()[v.toLowerCase()]+T):u.container=null:(C=y.State.scrollAnchor[y.State["scrollProperty"+v]],F=y.State.scrollAnchor[y.State["scrollProperty"+("Left"===v?"Top":"Left")]],H=$(n).offset()[v.toLowerCase()]+T),g={scroll:{rootPropertyValue:!1,startValue:C,currentValue:C,endValue:H,unitType:"",easing:u.easing,scrollData:{container:u.container,direction:v,alternateValue:F}},element:n},y.debug&&console.log("tweensContainer (scroll): ",g.scroll,n)}else if("reverse"===E){if(!i(n).tweensContainer)return void $.dequeue(n,u.queue);"none"===i(n).opts.display&&(i(n).opts.display="block"),"hidden"===i(n).opts.visibility&&(i(n).opts.visibility="visible"),i(n).opts.loop=!1,i(n).opts.begin=null,i(n).opts.complete=null,V.easing||delete u.easing,V.duration||delete u.duration,u=$.extend({},i(n).opts,u);var A=$.extend(!0,{},i(n).tweensContainer);for(var N in A)if("element"!==N){var R=A[N].startValue;A[N].startValue=A[N].currentValue=A[N].endValue,A[N].endValue=R,m.isEmptyObject(V)||(A[N].easing=u.easing),y.debug&&console.log("reverse tweensContainer ("+N+"): "+JSON.stringify(A[N]),n)}g=A}else if("start"===E){var A;i(n).tweensContainer&&i(n).isAnimating===!0&&(A=i(n).tweensContainer),$.each(S,function(e,t){var r=c(t,!0),o=r[0],i=r[1],n=r[2];if(RegExp(b.Lists.colors.join("|")).test(e)&&b.RegEx.isHex.test(o)){for(var s=["Red","Green","Blue"],l=b.Values.hexToRgb(o),u=n?b.Values.hexToRgb(n):a,p=0;p1e4&&(y.State.calls=o(y.State.calls)),y.State.calls.push([L,x,u,null,k.resolver]),y.State.isTicking===!1&&(y.State.isTicking=!0,l())):w++)}var n=this,u=$.extend({},y.defaults,V),g={};if(i(n)===a&&$.data(n,c,{isSVG:m.isSVG(n),isAnimating:!1,computedStyle:null,tweensContainer:null,rootPropertyValueCache:{},transformCache:{}}),parseFloat(u.delay)&&u.queue!==!1&&$.queue(n,u.queue,function(e){y.velocityQueueEntryFlag=!0,i(n).delayTimer={setTimeout:setTimeout(e,parseFloat(u.delay)),next:e}}),y.mock===!0)u.duration=1;else switch(u.duration.toString().toLowerCase()){case"fast":u.duration=200;break;case"normal":u.duration=p;break;case"slow":u.duration=600;break;default:u.duration=parseFloat(u.duration)||1}u.easing=s(u.easing,u.duration),u.begin&&!m.isFunction(u.begin)&&(u.begin=null),u.progress&&!m.isFunction(u.progress)&&(u.progress=null),u.complete&&!m.isFunction(u.complete)&&(u.complete=null),u.display&&(u.display=u.display.toString().toLowerCase(),"auto"===u.display&&(u.display=y.CSS.Values.getDisplayType(n))),u.visibility&&(u.visibility=u.visibility.toString().toLowerCase()),u.mobileHA=u.mobileHA&&y.State.isMobile&&!y.State.isGingerbread,u.queue===!1?u.delay?setTimeout(e,u.delay):e():$.queue(n,u.queue,function(t,r){return r===!0?(k.promise&&k.resolver(x),!0):(y.velocityQueueEntryFlag=!0,void e(t))}),""!==u.queue&&"fx"!==u.queue||"inprogress"===$.queue(n)[0]||$.dequeue(n)}var g=arguments[0]&&($.isPlainObject(arguments[0].properties)&&!arguments[0].properties.names||m.isString(arguments[0].properties)),f,h,v,x,S,V;if(m.isWrapped(this)?(f=!1,v=0,x=this,h=this):(f=!0,v=1,x=g?arguments[0].elements:arguments[0]),x=m.isWrapped(x)?[].slice.call(x):x){g?(S=arguments[0].properties,V=arguments[0].options):(S=arguments[v],V=arguments[v+1]);var P=m.isArray(x)||m.isNodeList(x)?x.length:1,w=0;if("stop"!==S&&!$.isPlainObject(V)){var T=v+1;V={};for(var C=T;CM;M++){var q={delay:R.delay};M===z-1&&(q.display=R.display,q.visibility=R.visibility,q.complete=R.complete),y.animate(x,"reverse",q)}return e()}};var S=t.jQuery||t.Zepto;S&&(S.fn.velocity=y.animate,S.fn.velocity.defaults=y.defaults),"undefined"!=typeof define&&define.amd?define(function(){return y}):"undefined"!=typeof module&&module.exports&&(module.exports=y),$.each(["Down","Up"],function(e,t){y.Sequences["slide"+t]=function(e,r,a,o,i,n){var s=$.extend({},r),l={height:null,marginTop:null,marginBottom:null,paddingTop:null,paddingBottom:null,overflow:null,overflowX:null,overflowY:null},u=s.begin,c=s.complete,p=!1;null!==s.display&&(s.display="Down"===t?s.display||"auto":s.display||"none"),s.begin=function(){function r(){l.height=parseFloat(y.CSS.getPropertyValue(e,"height")),e.style.height="auto",parseFloat(y.CSS.getPropertyValue(e,"height"))===l.height&&(p=!0),y.CSS.setPropertyValue(e,"height",l.height+"px")}if("Down"===t){l.overflow=[y.CSS.getPropertyValue(e,"overflow"),0],l.overflowX=[y.CSS.getPropertyValue(e,"overflowX"),0],l.overflowY=[y.CSS.getPropertyValue(e,"overflowY"),0],e.style.overflow="hidden",e.style.overflowX="visible",e.style.overflowY="hidden",r();for(var a in l)if(!/^overflow/.test(a)){var o=y.CSS.getPropertyValue(e,a);"height"===a&&(o=parseFloat(o)),l[a]=[o,0]}}else{r();for(var a in l){var o=y.CSS.getPropertyValue(e,a);"height"===a&&(o=parseFloat(o)),l[a]=[0,o]}e.style.overflow="hidden",e.style.overflowX="visible",e.style.overflowY="hidden"}u&&u.call(e,e)},s.complete=function(e){var r="Down"===t?0:1;p===!0?l.height[r]="auto":l.height[r]+="px";for(var a in l)e.style[a]=l[a][r];c&&c.call(e,e),n&&n.resolver(i||e)},y.animate(e,l,s)}}),$.each(["In","Out"],function(e,t){y.Sequences["fade"+t]=function(e,r,a,o,i,n){var s=$.extend({},r),l={opacity:"In"===t?1:0};if(a!==o-1)s.complete=s.begin=null;else{var u=s.complete;s.complete=function(){u&&u.call(e,e),n&&n.resolver(i||e)}}null!==s.display&&(s.display=s.display||("In"===t?"auto":"none")),y.animate(this,l,s)}})}(window.jQuery||window.Zepto||window,window,document); \ No newline at end of file diff --git a/package.json b/package.json index 47b5c19e..9108baea 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "velocity-animate", - "version": "0.9.0", + "version": "0.10.0", "description": "Accelerated JavaScript animation.", "keywords": [ "velocity", diff --git a/velocity.ui.js b/velocity.ui.js index aff658ad..a5214a09 100644 --- a/velocity.ui.js +++ b/velocity.ui.js @@ -4,7 +4,7 @@ /*! * velocity.ui.js: UI effects pack for Velocity. Load this file after jquery.velocity.js. -* @version 4.0.6 +* @version 4.1.0 * @docs http://velocityjs.org/#uiPack * @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. * @license Copyright Julian Shapiro. MIT License: http://en.wikipedia.org/wiki/MIT_License @@ -170,6 +170,9 @@ Container.Velocity.animate(element, propertyMap, opts); } }; + + /* Return the Velocity object so that RegisterUI calls can be chained. */ + return Container.Velocity; }; /********************* diff --git a/velocity.ui.min.js b/velocity.ui.min.js index 94696255..3f1c61f7 100644 --- a/velocity.ui.min.js +++ b/velocity.ui.min.js @@ -1,10 +1,10 @@ /*! * velocity.ui.js: UI effects pack for Velocity. Load this file after jquery.velocity.js. -* @version 4.0.6 +* @version 4.1.0 * @docs http://velocityjs.org/#uiPack * @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. * @license Copyright Julian Shapiro. MIT License: http://en.wikipedia.org/wiki/MIT_License * @license Indicated portions adapted from Animate.css, copyright Daniel Eden. MIT License: http://en.wikipedia.org/wiki/MIT_License * @license Indicated portions adapted from Magic.css, copyright Christian Pucci. MIT License: http://en.wikipedia.org/wiki/MIT_License */ -!function(){var t=window.jQuery||window.Zepto||window;if(!t.Velocity||!t.Velocity.Utilities)return void console.log("Velocity UI Pack: Velocity must be loaded first. Aborting.");if(!t.Velocity.version||t.Velocity.version.major<=0&&t.Velocity.version.minor<=5&&t.Velocity.version.patch<=2){var a="Velocity UI Pack: You need to update Velocity (jquery.velocity.js) to a newer version. Visit http://github.com/julianshapiro/velocity.";throw alert(a),new Error(a)}t.Velocity.RegisterUI=function(a,e){function r(a,e,r,i){var n=0,s;t.Velocity.Utilities.each(a,function(a,e){i&&(r+=a*i),s=e.parentNode,t.Velocity.Utilities.each(["height","paddingTop","paddingBottom","marginTop","marginBottom"],function(a,r){n+=parseFloat(t.Velocity.CSS.getPropertyValue(e,r))})}),t.Velocity.animate(s,{height:("In"===e?"+":"-")+"="+n},{queue:!1,easing:"ease-in-out",duration:r*("In"===e?.6:1)})}t.Velocity.Sequences[a]=function(i,n,s,l,o,c){function u(){void 0!==n.display&&"none"!==n.display||!/Out$/.test(a)||t.Velocity.Utilities.each(o,function(a,e){t.Velocity.CSS.setPropertyValue(e,"display","none")}),n.complete&&n.complete.call(o,o),c&&c.resolver(o||i)}for(var f=s===l-1,p=0;p