diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ff5b12..f20c58f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ + +### 1.1.7 (2014-10-31) + + +### 1.1.6 (2014-10-31) + ### 1.1.5 (2014-05-27) diff --git a/animateCSS.jquery.json b/animateCSS.jquery.json index 781ff1c..da7cfb8 100644 --- a/animateCSS.jquery.json +++ b/animateCSS.jquery.json @@ -2,15 +2,15 @@ "name": "animateCSS", "title": "Animate CSS jQuery Plugin", "description": "A jQuery plugin to dynamically apply animate.css animations with callbacks", - "version": "1.1.5", - "homepage": "https://github.com/craigmdennis/animateCSS.git", + "version": "1.1.7", + "homepage": "https://github.com/goosens/animateCSS.git", "author": { "name": "Craig Dennis", "url": "https://github.com/craigmdennis" }, "repository": { "type": "git", - "url": "https://github.com/craigmdennis/animateCSS.git" + "url": "https://github.com/goosens/animateCSS.git" }, "bugs": "https://github.com/craigmdennis/animateCSS/issues", "licenses": [ diff --git a/bower.json b/bower.json index e18288a..e479fa3 100644 --- a/bower.json +++ b/bower.json @@ -2,14 +2,14 @@ "name": "animateCSS", "description": "A jQuery plugin to dynamically apply animate.css animations with callbacks", "main": "dist/jquery.animatecss.js", - "version": "1.1.5", + "version": "1.1.7", "dependencies": { "animate.css": "~3.1.1" }, "devDependencies": { "jquery": "~1.11.0" }, - "homepage": "https://github.com/craigmdennis/animateCSS", + "homepage": "https://github.com/goosens/animateCSS", "authors": [ "Craig Dennis " ], diff --git a/dist/jquery.animatecss.js b/dist/jquery.animatecss.js index 7844104..902ccee 100644 --- a/dist/jquery.animatecss.js +++ b/dist/jquery.animatecss.js @@ -1,4 +1,4 @@ -/*! animateCSS - v1.1.5 - 2014-05-27 +/*! animateCSS - v1.1.5 - 2014-10-31 * https://github.com/craigmdennis/animateCSS * Copyright (c) 2014 Craig Dennis; Licensed MIT */ @@ -10,14 +10,15 @@ $.fn.extend({ animateCSS: function(effect, options) { - var addClass, animate, callback, complete, init, removeClass, settings, transitionEnd, unhide; + var addClass, animate, callback, complete, init, removeClass, setDuration, settings, transitionEnd, unhide; settings = { effect: effect, delay: 0, animationClass: 'animated', infinite: false, callback: options, - debug: false + debug: false, + duration: 1 }; transitionEnd = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend'; settings = $.extend(settings, options); @@ -29,11 +30,18 @@ settings.animationClass += ' infinite'; } return setTimeout(function() { + setDuration(element); unhide(element); addClass(element); return complete(element); }, settings.delay); }; + setDuration = function(element) { + return element.css({ + 'webkit-animation-duration': settings.duration + 's', + 'animation-duration': settings.duration + 's' + }); + }; addClass = function(element) { return element.addClass(settings.effect + ' ' + settings.animationClass + ' '); }; diff --git a/dist/jquery.animatecss.min.js b/dist/jquery.animatecss.min.js index ee50a6c..eb334fe 100644 --- a/dist/jquery.animatecss.min.js +++ b/dist/jquery.animatecss.min.js @@ -1,5 +1,5 @@ -/*! animateCSS - v1.1.5 - 2014-05-27 +/*! animateCSS - v1.1.5 - 2014-10-31 * https://github.com/craigmdennis/animateCSS * Copyright (c) 2014 Craig Dennis; Licensed MIT */ -(function(){"use strict";var a;a=jQuery,a.fn.extend({animateCSS:function(b,c){var d,e,f,g,h,i,j,k,l;return j={effect:b,delay:0,animationClass:"animated",infinite:!1,callback:c,debug:!1},k="webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",j=a.extend(j,c),h=function(a){return e(a)},e=function(a){return j.infinite===!0&&(j.animationClass+=" infinite"),setTimeout(function(){return l(a),d(a),g(a)},j.delay)},d=function(a){return a.addClass(j.effect+" "+j.animationClass+" ")},l=function(a){return"hidden"===a.css("visibility")&&a.css("visibility","visible"),a.is(":hidden")?a.show():void 0},i=function(a){return a.removeClass(j.effect+" "+j.animationClass)},f=function(a){return j.infinite===!1&&i(a),"function"==typeof j.callback?j.callback.call(a):void 0},g=function(a){return a.one(k,function(){return f(a)})},this.each(function(){return h(a(this))})}})}).call(this); \ No newline at end of file +(function(){"use strict";var a;a=jQuery,a.fn.extend({animateCSS:function(b,c){var d,e,f,g,h,i,j,k,l,m;return k={effect:b,delay:0,animationClass:"animated",infinite:!1,callback:c,debug:!1,duration:1},l="webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",k=a.extend(k,c),h=function(a){return e(a)},e=function(a){return k.infinite===!0&&(k.animationClass+=" infinite"),setTimeout(function(){return j(a),m(a),d(a),g(a)},k.delay)},j=function(a){return a.css({"webkit-animation-duration":k.duration+"s","animation-duration":k.duration+"s"})},d=function(a){return a.addClass(k.effect+" "+k.animationClass+" ")},m=function(a){return"hidden"===a.css("visibility")&&a.css("visibility","visible"),a.is(":hidden")?a.show():void 0},i=function(a){return a.removeClass(k.effect+" "+k.animationClass)},f=function(a){return k.infinite===!1&&i(a),"function"==typeof k.callback?k.callback.call(a):void 0},g=function(a){return a.one(l,function(){return f(a)})},this.each(function(){return h(a(this))})}})}).call(this); \ No newline at end of file diff --git a/package.json b/package.json index 3458ffd..8e0bba9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "animateCSS", - "version": "1.1.5", + "version": "1.1.7", "description": "Animate CSS jQuery Plugin", "keywords": [ "jquery-plugin", @@ -8,7 +8,7 @@ "animation", "callbacks" ], - "homepage": "https://github.com/craigmdennis/animateCSS", + "homepage": "https://github.com/goosens/animateCSS", "bugs": "https://github.com/craigmdennis/animateCSS/issues", "author": { "name": "Craig Dennis", @@ -17,7 +17,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/craigmdennis/animateCSS.git" + "url": "https://github.com/goosens/animateCSS.git" }, "licenses": [ { diff --git a/src/animatecss.coffee b/src/animatecss.coffee index 46316a6..d5d8e22 100644 --- a/src/animatecss.coffee +++ b/src/animatecss.coffee @@ -17,6 +17,7 @@ $.fn.extend infinite: false callback: options debug: false + duration: 1 # Vendor prefixed transition callbacks transitionEnd = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend' @@ -35,11 +36,19 @@ $.fn.extend # Run a timer regardless of delay (as 0 will fire instantly anyway) setTimeout -> + setDuration( element ) unhide( element ) addClass( element ) complete( element ) , settings.delay + # Add custom duration to element + setDuration = (element) -> + element.css( + 'webkit-animation-duration' : settings.duration + 's' + 'animation-duration' : settings.duration + 's' + ) + # Add the animation ad effect classes to kick everything off addClass = ( element ) -> element.addClass( settings.effect + ' ' + settings.animationClass + ' ')