/******************************************** * revolution 5.1.4 extension - parallax * @version: 1.1.1 (25.11.2015) * @requires jquery.themepunch.revolution.js * @author themepunch *********************************************/ !function(e){var r=jquery.fn.revolution,a=r.is_mobile();jquery.extend(!0,r,{checkforparallax:function(e,t){var o=t.parallax;return a&&"on"==o.disable_onmobile?!1:(("3d"==o.type||"3d"==o.type)&&(punchgs.tweenlite.set(t.c,{overflow:o.ddd_overflow}),punchgs.tweenlite.set(t.ul,{overflow:o.ddd_overflow}),"carousel"!=t.slidertype&&"on"==o.ddd_shadow&&(t.c.prepend('
'),punchgs.tweenlite.set(t.c.find(".dddwrappershadow"),{force3d:"auto",transformperspective:1600,transformorigin:"50% 50%",width:"100%",height:"100%",position:"absolute",top:0,left:0,zindex:0}))),t.li.each(function(){var e=jquery(this);if("3d"==o.type||"3d"==o.type){e.find(".slotholder").wrapall(''),e.find(".tp-parallax-wrap").wrapall(''),e.find(".rs-parallaxlevel-tobggroup").closest(".tp-parallax-wrap").wrapall('');var r=e.find(".dddwrapper"),a=e.find(".dddwrapper-layer"),l=e.find(".dddwrapper-layertobggroup");l.appendto(r),"carousel"==t.slidertype&&("on"==o.ddd_shadow&&r.addclass("dddwrappershadow"),punchgs.tweenlite.set(r,{borderradius:t.carousel.border_radius})),punchgs.tweenlite.set(e,{overflow:"visible",transformstyle:"preserve-3d",perspective:1600}),punchgs.tweenlite.set(r,{force3d:"auto",transformorigin:"50% 50%"}),punchgs.tweenlite.set(a,{force3d:"auto",transformorigin:"50% 50%",zindex:5}),punchgs.tweenlite.set(t.ul,{transformstyle:"preserve-3d",transformperspective:1600})}for(var s=1;s<=o.levels.length;s++)e.find(".rs-parallaxlevel-"+s).each(function(){var e=jquery(this),r=e.closest(".tp-parallax-wrap");r.data("parallaxlevel",o.levels[s-1]),r.addclass("tp-parallax-container")})}),("mouse"==o.type||"scroll+mouse"==o.type||"mouse+scroll"==o.type||"3d"==o.type||"3d"==o.type)&&(e.mouseenter(function(r){var a=e.find(".active-revslide"),t=e.offset().top,o=e.offset().left,l=r.pagex-o,s=r.pagey-t;a.data("enterx",l),a.data("entery",s)}),e.on("mousemove.hoverdir, mouseleave.hoverdir, trigger3dpath",function(r,a){var l=a&&a.li?a.li:e.find(".active-revslide");if("enterpoint"==o.origo){var s=e.offset().top,i=e.offset().left;void 0==l.data("enterx")&&l.data("enterx",r.pagex-i),void 0==l.data("entery")&&l.data("entery",r.pagey-s);var d=l.data("enterx")||r.pagex-i,n=l.data("entery")||r.pagey-s,p=d-(r.pagex-i),c=n-(r.pagey-s),u=o.speed/1e3||.4}else var s=e.offset().top,i=e.offset().left,p=t.conw/2-(r.pagex-i),c=t.conh/2-(r.pagey-s),u=o.speed/1e3||3;if("mouseleave"==r.type&&(p=o.ddd_lasth||0,c=o.ddd_lastv||0,u=1.5),l.find(".tp-parallax-container").each(function(){var e=jquery(this),r=parseint(e.data("parallaxlevel"),0),a="3d"==o.type||"3d"==o.type?r/200:r/100,t=p*a,l=c*a;"scroll+mouse"==o.type||"mouse+scroll"==o.type?punchgs.tweenlite.to(e,u,{force3d:"auto",x:t,ease:punchgs.power3.easeout,overwrite:"all"}):punchgs.tweenlite.to(e,u,{force3d:"auto",x:t,y:l,ease:punchgs.power3.easeout,overwrite:"all"})}),"3d"==o.type||"3d"==o.type){var h=".tp-revslider-slidesli .dddwrapper, .dddwrappershadow, .tp-revslider-slidesli .dddwrapper-layer";"carousel"===t.slidertype&&(h=".tp-revslider-slidesli .dddwrapper, .tp-revslider-slidesli .dddwrapper-layer"),t.c.find(h).each(function(){var e=jquery(this),a=o.levels[o.levels.length-1]/200,l=p*a,s=c*a,i=0==t.conw?0:math.round(p/t.conw*a*100)||0,d=0==t.conh?0:math.round(c/t.conh*a*100)||0,n=e.closest("li"),h=0,w=!1;e.hasclass("dddwrapper-layer")&&(h=o.ddd_z_correction||65,w=!0),e.hasclass("dddwrapper-layer")&&(l=0,s=0),n.hasclass("active-revslide")||"carousel"!=t.slidertype?"on"!=o.ddd_bgfreeze||w?punchgs.tweenlite.to(e,u,{rotationx:d,rotationy:-i,x:l,z:h,y:s,ease:punchgs.power3.easeout,overwrite:"all"}):punchgs.tweenlite.to(e,.5,{force3d:"auto",rotationy:0,rotationx:0,z:0,ease:punchgs.power3.easeout,overwrite:"all"}):punchgs.tweenlite.to(e,.5,{force3d:"auto",rotationy:0,z:0,x:0,y:0,rotationx:0,z:0,ease:punchgs.power3.easeout,overwrite:"all"}),"mouseleave"==r.type&&punchgs.tweenlite.to(jquery(this),3.8,{z:0,ease:punchgs.power3.easeout})})}}),a&&(window.ondeviceorientation=function(r){var a=math.round(r.beta||0)-70,l=math.round(r.gamma||0),s=e.find(".active-revslide");if(jquery(window).width()>jquery(window).height()){var i=l;l=a,a=i}var d=e.width(),n=e.height(),p=360/d*l,c=180/n*a,u=o.speed/1e3||3;if(s.find(".tp-parallax-container").each(function(){var e=jquery(this),r=parseint(e.data("parallaxlevel"),0),a=r/100,t=p*a*2,o=c*a*4;punchgs.tweenlite.to(e,u,{force3d:"auto",x:t,y:o,ease:punchgs.power3.easeout,overwrite:"all"})}),"3d"==o.type||"3d"==o.type){var h=".tp-revslider-slidesli .dddwrapper, .dddwrappershadow, .tp-revslider-slidesli .dddwrapper-layer";"carousel"===t.slidertype&&(h=".tp-revslider-slidesli .dddwrapper, .tp-revslider-slidesli .dddwrapper-layer"),t.c.find(h).each(function(){var e=jquery(this),a=o.levels[o.levels.length-1]/200;offsh=p*a,offsv=c*a*3,offrv=0==t.conw?0:math.round(p/t.conw*a*500)||0,offrh=0==t.conh?0:math.round(c/t.conh*a*700)||0,li=e.closest("li"),zz=0,itslayer=!1,e.hasclass("dddwrapper-layer")&&(zz=o.ddd_z_correction||65,itslayer=!0),e.hasclass("dddwrapper-layer")&&(offsh=0,offsv=0),li.hasclass("active-revslide")||"carousel"!=t.slidertype?"on"!=o.ddd_bgfreeze||itslayer?punchgs.tweenlite.to(e,u,{rotationx:offrh,rotationy:-offrv,x:offsh,z:zz,y:offsv,ease:punchgs.power3.easeout,overwrite:"all"}):punchgs.tweenlite.to(e,.5,{force3d:"auto",rotationy:0,rotationx:0,z:0,ease:punchgs.power3.easeout,overwrite:"all"}):punchgs.tweenlite.to(e,.5,{force3d:"auto",rotationy:0,z:0,x:0,y:0,rotationx:0,z:0,ease:punchgs.power3.easeout,overwrite:"all"}),"mouseleave"==r.type&&punchgs.tweenlite.to(jquery(this),3.8,{z:0,ease:punchgs.power3.easeout})})}})),void r.scrollticker(t,e))},scrollticker:function(e,a){1!=e.scrollticker&&(e.scrollticker=!0,punchgs.tweenlite.ticker.fps(150),punchgs.tweenlite.ticker.addeventlistener("tick",function(){r.scrollhandling(e)},a,!1,1))},scrollhandling:function(e){function t(e,r){e.lastscrolltop=r}e.lastwindowheight=e.lastwindowheight||jquery(window).height();var o=e.c.offset().top,l=jquery(window).scrolltop(),s=new object,i=e.viewport,d=e.parallax;if(e.lastscrolltop==l&&!e.duringslidechange)return!1;punchgs.tweenlite.delayedcall(.2,t,[e,l]),s.top=o-l,s.h=0==e.conh?e.c.height():e.conh,s.bottom=o-l+s.h;var n=s.top<0?s.top/s.h:s.bottom>e.lastwindowheight?(s.bottom-e.lastwindowheight)/s.h:0;e.scrollproc=n,r.callbackhandling&&r.callbackhandling(e,"parallax","start");var p=1-math.abs(n);if(p=0>p?0:p,i.enable&&(1-i.visible_area<=p?e.inviewport||(e.inviewport=!0,r.enterinviewport(e)):e.inviewport&&(e.inviewport=!1,r.leaveviewport(e))),a&&"on"==e.parallax.disable_onmobile)return!1;var c=new punchgs.timelinelite;c.pause(),"3d"!=d.type&&"3d"!=d.type&&(("scroll"==d.type||"scroll+mouse"==d.type||"mouse+scroll"==d.type)&&e.c.find(".tp-parallax-container").each(function(r){var a=jquery(this),t=parseint(a.data("parallaxlevel"),0)/100,o=n*-(t*e.conh);a.data("parallaxoffset",o),c.add(punchgs.tweenlite.set(a,{force3d:"auto",y:o}),0)}),e.c.find(".tp-revslider-slidesli .slotholder, .tp-revslider-slidesli .rs-background-video-layer").each(function(){var r=jquery(this),a=r.data("bgparallax")||e.parallax.bgparallax;if(a="on"==a?1:a,void 0!==a||"off"!==a){var t=e.parallax.levels[parseint(a,0)-1]/100,o=n*-(t*e.conh);jquery.isnumeric(o)&&c.add(punchgs.tweenlite.set(r,{position:"absolute",top:"0px",left:"0px",backfacevisibility:"hidden",force3d:"true",y:o+"px",overwrite:"auto"}),0)}})),r.callbackhandling&&r.callbackhandling(e,"parallax","end"),c.play(0)}})}(jquery);