/** * author: vinayak rangnathrao jadhav * project: jr3dcarousel * version: 0.0.8 **/ (function(g){"function"===typeof define&&define.amd?define(["jquery"],g):"object"===typeof exports?module.exports=g(require("jquery")):g(jquery)})(function(g){g.fn.jr3dcarousel=function(y){function x(){this.animations={slide:a,slide3d:b,scroll:c,scroll3d:d,fade:e}}function a(a){d.css({perspective:"",overflow:"hidden"});c=f*a;h.css({transform:"translatez("+-e+"px) rotatey("+-c+"deg)"});u()}function b(a){d.css({perspective:k,overflow:"visible"});c=f*a;h.css({transform:"translatez("+-e+"px) rotatey("+ -c+"deg)"});u()}function c(a){d.css({perspective:"",overflow:"hidden"});c=f*a;h.css({transform:"translatez("+-e+"px) rotatex("+-c+"deg)"});u()}function d(a){d.css({perspective:k,overflow:"visible"});c=f*a;h.css({transform:"translatez("+-e+"px) rotatex("+-c+"deg)"});u()}function e(g){h.css({transition:"opacity "+a.animationduration+"ms "+a.animationcurve,opacity:0});d.find(".nav").css({backgroundcolor:"rgba(255, 255, 255, 0.77)"}).eq(m%b).css({backgroundcolor:"rgba(0, 0, 0, 1)"});cleartimeout(k);var k= settimeout(function(){c=f*g;h.css({transform:"translatez("+-e+"px) rotatey("+-c+"deg)",opacity:1});l=(math.round(c/f)-1)%b;a.onslideshow.call(this,h.find("."+a.slideclass).eq((l+1)%b))},a.animationduration)}function u(){d.find(".nav").css({backgroundcolor:"rgba(255, 255, 255, 0.77)"}).eq(m%b).css({backgroundcolor:"rgba(0, 0, 0, 0.77)"});l=(math.round(c/f)-1)%b;a.onslideshow.call(this,h.find("."+a.slideclass).eq((l+1)%b))}function z(){d.width("100%");n=d.width()").css({width:"100%",height:"100%",transition:"transform "+a.animationduration+"ms "+a.animationcurve,transformstyle:"preserve-3d"}).appendto(d),l=0,m=1,w=new x,q,r,v,f,c=0,e,k,p,b=a.slides.length||d.find("."+a.slideclass).length;(function(){function f(){q=g("");r=g("");q.add(r).appendto(d).css({position:"absolute", top:"42%",zindex:1,display:"inline-block",padding:"1.2em",boxshadow:"2px 2px 0 rgba(255,255,255,0.9) inset",cursor:"pointer"}).hide();q.on("click",function(){l=math.round(c/f);m=l-1;w.run(a.animation,m)});r.on("click",function(){l=math.round(c/f);m=l+1;w.run(a.animation,m)});d.on("mouseenter touchstart",function(){q.add(r).fadein()}).on("mouseleave touchcancel",function(){q.add(r).fadeout()});g(document).on("keydown",function(a){var b=d[0].getboundingclientrect();(b=0=h&&(20<=math.abs(g)&&100>=math.abs(c)?d=0>g?"left":"right":20<=math.abs(c)&&100>=math.abs(g)&&(d=0>c?"up":"down"));b(d)})}function x(){for(var f=a.navigation,e=g("");"circles"==f&&e.find(".nav").css({borderradius:"12px"});e.find(".nav").css({display:"inline-block", margin:"5px",cursor:"pointer",backgroundcolor:"rgba(255, 255, 255, 0.77)",width:"12px",height:"12px",transition:"all "+a.animationduration+"ms ease"}).first().css({backgroundcolor:"rgba(0, 0, 0, 1)"});h.after(e);d.on("click",".nav",function(){m=g(this).index();w.run(a.animation,m)})}function y(){v=setinterval(function(){l=math.round(c/f);m=l+1;w.run(a.animation,m)},a.animationinterval+a.animationduration);d.hover(function(){clearinterval(v)},function(){v=setinterval(function(){l=math.round(c/f);m= l+1;w.run(a.animation,m)},a.animationinterval+a.animationduration)})}(function(){-1!=a.animation.indexof("slide")?(e=n/2/math.tan(math.pi/b),k=n/2*math.tan(2*math.pi/b)+"px"):-1!=a.animation.indexof("scroll")?(e=t/2/math.tan(math.pi/b),k=t/2*math.tan(2*math.pi/b)+"px"):"fade"==a.animation&&(e=n/2/math.tan(math.pi/b),k=n/2*math.tan(2*math.pi/b)+"px");f=360/b;if(a.slides.length)for(var c=0;c").append(""+a.slides[c].alt+"");-1!=a.animation.indexof("slide")?p="rotatey("+f*c+"deg) translatez("+e+"px)":-1!=a.animation.indexof("scroll")?p="rotatex("+f*c+"deg) translatez("+e+"px)":"fade"==a.animation&&(p="rotatey("+f*c+"deg) translatez("+e+"px)");l.css({transform:p});h.append(l)}else d.find("."+a.slideclass).each(function(b){var c=g(this).attr("data-index",b);-1!=a.animation.indexof("slide")?p="rotatey("+f*b+"deg) translatez("+e+"px)":-1!=a.animation.indexof("scroll")?p="rotatex("+f*b+"deg) translatez("+ e+"px)":"fade"==a.animation&&(p="rotatey("+f*b+"deg) translatez("+e+"px)");c=c.css({transform:p}).detach();h.append(c)});h.find("."+a.slideclass).css({position:"absolute",left:0,top:0,width:"100%",height:"100%",backfacevisibility:"hidden"}).find("img").css({width:"100%",height:"100%",objectfit:a.slidelayout});k=a.perspective||k;d.css({perspective:k,width:n+"px",height:t+"px",position:"relative",overflow:"visible"})})();a.controls&&f();a.navigation&&x();a.autoplay&&y();addeventlistener("resize",z); z()})();x.prototype.run=function(a,b){this.animations[a](b)};this.showslide=function(a){h.find(".nav").eq((a-1)%b).click()};this.getcurrentslide=function(){return h.find("."+a.slideclass).eq(l)};this.getslidebyindex=function(b){return h.find("."+a.slideclass+"[data-index="+b+"]")};this.showpreviousslide=function(){q.click()};this.shownextslide=function(){r.click()};return this}});