/* * * @name Animate Slider * @description A jQuery Slider plugin with speacific animations for each element.It uses some predefined animation classes (fadeIn,fadeOut,rotateIn,bounce,slideInRight etc.) and adds them to each element on the slider.It also add classes with delay for each animation (delay1s,delay1-5s,delay2s etc.) * @version 1.0.6 * @copyright 2014 - Vasileios Chouliaras * @license - * */ !function(t){var e=function(e,n){this.element=e,this.$element=t(e),this.options=n};e.prototype={init:function(){if(this.cssAnimations=Modernizr.cssanimations,this.cssTransitions=Modernizr.csstransitions,!this.cssAnimations||!this.cssTransitions)throw new Error("Your broswer does not support CSS3 Animations or Transitions");this.config=t.extend({},this.defaults,this.options),this.slides=this.$element.children(".anim-slide"),this.slidesCount=this.slides.length,this.interval=[],this.current=0;for(var e=t('
'),n=this.slidesCount;n--;)e.append("");e.appendTo(this.$element),this.slides.eq(this.current).addClass("anim-slide-this"),this.$dots=this.$element.find(".anim-dots>span"),this.$navNext=this.$element.find(".anim-arrows-next"),this.$navPrev=this.$element.find(".anim-arrows-prev"),this.loadEvents(),this.navigate(this.current),this.updateDots(),this.autoplay()},navigate:function(e){var n,i,o,a,s,u,d,r="bounce flash pulse rubberBand shake swing tada wobble bounceIn bounceInDown bounceInRight bounceInUp bounceOut bounceOutDown bounceOutLeft bounceOutRight bounceOutUp fadeIn fadeInDown fadeInDownBig fadeInLeft fadeInLeftBig fadeInRight fadeInRightBig fadeInUp fadeInUpBig fadeOut fadeOutDown fadeOutDownBig fadeOutLeft fadeOutLeftBig fadeOutRight fadeOutRightBig fadeOutUp fadeOutUpBig flipInX flipInY flipOutX flipOutY lightSpeedIn lightSpeedOut rotateIn rotateInDownLeft rotateInDownRight rotateInUpLeft rotateInUpRight rotateOut rotateOutDownLeft rotateOutDownRight rotateOutUpLeft rotateOutUpRight slideInDown slideInLeft slideInRight slideOutLeft slideOutRight slideOutUp slideInUp slideOutDown hinge rollIn rollOut fadeInUpLarge fadeInDownLarge fadeInLeftLarge fadeInRightLarge fadeInUpLeft fadeInUpLeftBig fadeInUpLeftLarge fadeInUpRight fadeInUpRightBig fadeInUpRightLarge fadeInDownLeft fadeInDownLeftBig fadeInDownLeftLarge fadeInDownRight fadeInDownRightBig fadeInDownRightLarge fadeOutUpLarge fadeOutDownLarge fadeOutLeftLarge fadeOutRightLarge fadeOutUpLeft fadeOutUpLeftBig fadeOutUpLeftLarge fadeOutUpRight fadeOutUpRightBig fadeOutUpRightLarge fadeOutDownLeft fadeOutDownLeftBig fadeOutDownLeftLarge fadeOutDownRight fadeOutDownRightBig fadeOutDownRightLarge bounceInBig bounceInLarge bounceInUpBig bounceInUpLarge bounceInDownBig bounceInDownLarge bounceInLeft bounceInLeftBig bounceInLeftLarge bounceInRightBig bounceInRightLarge bounceInUpLeft bounceInUpLeftBig bounceInUpLeftLarge bounceInUpRight bounceInUpRightBig bounceInUpRightLarge bounceInDownLeft bounceInDownLeftBig bounceInDownLeftLarge bounceInDownRight bounceInDownRightBig bounceInDownRightLarge bounceOutBig bounceOutLarge bounceOutUpBig bounceOutUpLarge bounceOutDownBig bounceOutDownLarge bounceOutLeftBig bounceOutLeftLarge bounceOutRightBig bounceOutRightLarge bounceOutUpLeft bounceOutUpLeftBig bounceOutUpLeftLarge bounceOutUpRight bounceOutUpRightBig bounceOutUpRightLarge bounceOutDownLeft bounceOutDownLeftBig bounceOutDownLeftLarge bounceOutDownRight bounceOutDownRightBig bounceOutDownRightLarge zoomIn zoomInUp zoomInUpBig zoomInUpLarge zoomInDown zoomInDownBig zoomInDownLarge zoomInLeft zoomInLeftBig zoomInLeftLarge zoomInRight zoomInRightBig zoomInRightLarge zoomInUpLeft zoomInUpLeftBig zoomInUpLeftLarge zoomInUpRight zoomInUpRightBig zoomInUpRightLarge zoomInDownLeft zoomInDownLeftBig zoomInDownLeftLarge zoomInDownRight zoomInDownRightBig zoomInDownRightLarge zoomOut zoomOutUp zoomOutUpBig zoomOutUpLarge zoomOutDown zoomOutDownBig zoomOutDownLarge zoomOutLeft zoomOutLeftBig zoomOutLeftLarge zoomOutRight zoomOutRightBig zoomOutRightLarge zoomOutUpLeft zoomOutUpLeftBig zoomOutUpLeftLarge zoomOutUpRight zoomOutUpRightBig zoomOutUpRightLarge zoomOutDownLeft zoomOutDownLeftBig zoomOutDownLeftLarge zoomOutDownRight zoomOutDownRightBig zoomOutDownRightLarge flipInTopFront flipInTopBack flipInBottomFront flipInBottomBack flipInLeftFront flipInLeftBack flipInRightFront flipInRightBack flipOutTopFront flipOutTopBack flipOutBottomFront flipOutBottomback flipOutLeftFront flipOutLeftBack flipOutRightFront flipOutRightBack strobe shakeX shakeY spin spinReverse slingshot slingshotReverse pulsate heartbeat panic";s=this.slides.eq(this.current),u=this.elemAnimate(this.current,this.config),this.current=e,a=this.slides.eq(this.current),d=this.elemAnimate(this.current,this.config),s.removeClass(" anim-slide-this "+r),s.find("*").removeClass(r),t.each(u,function(t){return t==s.prop("tagName").toLowerCase()?(i=s.data("classHide"),o=s.data("delayShow"),s.removeClass(o),s.addClass(i+" animated"),!1):(i=s.find(t).data("classHide"),o=s.find(t).data("delayShow"),s.find(t).removeClass(o),s.find(t).addClass(i+" animated"),void 0)}),t.each(d,function(t){return t==s.prop("tagName").toLowerCase()?(n=a.data("classShow"),o=a.data("delayShow"),a.removeClass(r),a.addClass(n+" "+o+" animated"),!1):(n=a.find(t).data("classShow"),o=a.find(t).data("delayShow"),a.find(t).removeClass(r),a.find(t).addClass(n+" "+o+" animated "),void 0)}),a.addClass(" anim-slide-this"),this.updateDots()},updateDots:function(){this.$dots.removeClass("anim-dots-this"),this.$dots.eq(this.current).addClass("anim-dots-this")},dots:function(t){return t>=this.slidesCount||0>t?!1:(this.config.autoplay&&(clearTimeout(this.autoplay),this.config.autoplay=!1),void this.navigate(t))},elemAnimate:function(e,n){if("object"==typeof n.animations){if(this.slidesCount!==Object.keys(n.animations).length)throw new SyntaxError("Slides length and animation Object length must be equal.");var i=n.animations[e],o=this.slides.eq(e);return t.each(i,function(t,e){if(t==o.prop("tagName").toLowerCase())return null==o.data("classShow")&&("string"==typeof e.show?o.data("classShow",e.show):o.data("classShow",""),"string"==typeof e.hide?o.data("classHide",e.hide):o.data("classHide",""),"string"==typeof e.delayShow?o.data("delayShow",e.delayShow):o.data("delayShow"," ")),!1;if(!o.find(t)[0])throw new TypeError("The element '"+t+"' does not exist.");null==o.find(t).data("classShow")&&("string"==typeof e.show?o.find(t).data("classShow",e.show):o.find(t).data("classShow"," "),"string"==typeof e.hide?o.find(t).data("classHide",e.hide):o.find(t).data("classHide"," "),"string"==typeof e.delayShow?o.find(t).data("delayShow",e.delayShow):o.find(t).data("delayShow"," "))})}},autoplay:function(){if(this.config.autoplay){var t=this.current,e=this,n=function(){t=t>=e.slidesCount-1||0>t?0:t+1,e.navigate(t),e.autoplay()};if(this.interval.length===this.slidesCount)return void(this.autoplayTime=setTimeout(n,this.interval[t]));this.animDuration(t).done(function(i){i>=e.config.interval?(e.interval[t]=i,e.autoplayTime=setTimeout(n,0)):i=e.slidesCount-1?0:e.current+1;e.navigate(n,"next"),t.preventDefault()}),this.$navPrev.on("click.slide",function(t){e.config.autoplay&&(clearTimeout(e.autoplay),e.config.autoplay=!1);var n=0===e.current?e.slidesCount-1:e.current-1;e.navigate(n,"prev"),t.preventDefault()}),this.$dots.on("click.slide",function(n){var i=t(this).index();e.dots(i),n.preventDefault()})},defaults:{autoplay:!0,interval:5e3}},t.fn.animateSlider=function(n){return this.each(function(){var i=t.data(this,"animateSlider");i||t.data(this,"animateSlider",new e(this,n).init())})}}(jQuery);