You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
19 KiB

4 years ago
!function(t,i,e){function s(t){var i={};return void 0!=t.touches?(i.x=t.touches[0].pageX,i.y=t.touches[0].pageY):void 0!==t.pageX?(i.x=t.pageX,i.y=t.pageY):(i.x=t.clientX,i.y=t.clientY),i}function o(e,s){this.element=e,this.width=null,this.volume=null,this.current=null,this.clonesContainer=[],this.positionsContainer=[],this.itemsContainer=[],this.maskWrapper=null,this.speed=null,this.verticalSlide=!1,this.activeProp="width",this.clonnedPropVolume=null,this.autoPlayLoop=null,this.touch={},this.isTouch=!1,this.processes={},this.Objs=[],this.resizeHandle=null,t.each(o.Obj,t.proxy(function(i,e){this.Objs.push({type:e.type,update:t.proxy(e.update,this)})},this)),this.initiate(s),this.options.resize&&t(i).on("resize",t.proxy(function(){clearTimeout(this.resizeHandle),this.resizeHandle=setTimeout(t.proxy(this.reset,this),this.options.resizeRefresh)},this))}var n=null;o.Obj=[{type:["items","width","all"],update:function(){this.element.find(".cloned").remove(),this.clonesContainer=[],this.positionsContainer=[]}},{type:["clones"],update:function(){var i,e=this.clonesContainer.length-Math.max(2*this.options.items,4);e=Math.abs(e/2);for(var s=this.getItemCss(),o=0,n=0,r=e;n<r;n++)this.clonesContainer.push(this.clonesContainer.length/2),i=t(this.itemsContainer[this.clonesContainer[this.clonesContainer.length-1]]).clone(),this.maskWrapper.append(i.css(s).addClass("cloned")),o+=this.verticalSlide?i.outerHeight(!0):i.outerWidth(!0),this.clonesContainer.push(this.itemsContainer.length-1-(this.clonesContainer.length-1)/2),i=t(this.itemsContainer[this.clonesContainer[this.clonesContainer.length-1]]).clone(),this.maskWrapper.prepend(i.css(s).addClass("cloned")),o+=this.verticalSlide?i.outerHeight(!0):i.outerWidth(!0);this.clonnedPropVolume=o}},{type:["items","width"],update:function(){var i,e,s,o,n=0;for(o="rtl"==this.options.direction?1:-1,"rtl"==this.options.direction&&this.options.vertical&&(o=-1),s=(this.verticalSlide?this.getHeight()/this.options.items:this.getWidth())/this.options.items,i=0,e=this.clonesContainer.length+this.itemsContainer.length;i<e;i++)this.verticalSlide?n+=(t(this.itemsContainer[this.relativePos(i)]).height()+this.options.margin)*o:n+=this.options.fixWidth?s*o:(t(this.itemsContainer[this.relativePos(i)]).width()+this.options.margin)*o,this.positionsContainer.push(n)}},{type:["items","width","height"],update:function(){var t={};this.volume=this.getVolume(this.activeProp,0,this.itemsContainer.length),t[this.activeProp]=(this.options.circular,Math.abs(this.getPosition(this.positionsContainer.length))),t.overflow="hidden",this.maskWrapper.css(t)}},{type:["items","width","position"],update:function(){var t=this.getPosition(this.normalizePos(this.current))||0;this.animate(t)}},{type:["items","width","position"],update:function(){for(var t="rtl"==this.options.direction?1:-1,i=[],e=this.getPosition(this.current),s=e+this.getWidth("inner")*t,o=0,n=this.positionsContainer.length;o<n;o++){var r=Math.abs(this.positionsContainer[o])*t,h=this.positionsContainer[o-1]||0;(this.compare(h,e,"<=")&&this.compare(h,s,">")||this.compare(r,e,"<")&&this.compare(r,s,">"))&&i.push(o)}this.maskWrapper.children("."+this.options.activeClass).removeClass(this.options.activeClass);var a="("+i.join("), :eq(")+")";if(this.maskWrapper.children(":eq"+a).addClass(this.options.activeClass),!this.options.fixHeight){var p=this.maskWrapper.children("."+this.options.activeClass).height();this.maskWrapper.css("height",p+"px")}}}],o.prototype.getViewPort=function(){return t(i).width()},o.prototype.update=function(){for(var i=0,e=this.Objs.length,s=t.proxy(function(t){return this[t]},this.processes);i<e;)(this.processes.updateAll||t.grep(this.Objs[i].type,s).length)&&this.Objs[i].update(),i++;this.processes={}},o.prototype.queueProcess=function(t){this.processes[t]=!0},o.prototype.initiate=function(i){var e;this.options=t.extend({},o.defaultOptions,i),this.mainOptions=this.options,this.resize=this.options.resize;var s=this.getViewPort(),n=0;this.resize&&(t.each(this.resize,function(t){t<=s&&t>-1&&(n=t)}),this.options=n?t.extend({},this.options,this.resize[n