(function($){var smoothScroll=null;const math={lerp:(a,b,n)=>{return(1-n)*a+n*b},norm:(value,min,max)=>{return(value-min)/(max-min)}} const config={height:window.innerHeight,width:window.innerWidth} class Smooth{constructor(){this.bindMethods();this.data={ease:coefSpeed_inertiaScroll||0.05,current:0,last:0} this.dom={el:main,content:mainWrap} this.rAF=null;this.init()} bindMethods(){['scroll','run','resize'].forEach((fn)=>this[fn]=this[fn].bind(this))} setStyles(){Object.assign(this.dom.el.style,{position:'fixed',top:0,left:0,height:'100%',width:'100%',overflow:'hidden'})} setWidth(){heightAadminBar=0;if($('body').is('.admin-bar')&&!elementorFrontend.isEditMode()){heightAadminBar=45} var larghezza=window.innerWidth;var altezza=this.dom.el.offsetHeight+heightAadminBar;var larghezzaTotale=(this.dom.el.offsetHeight)+(larghezza*(sectionsAvailable.length));var altezza=larghezzaTotale-this.dom.el.offsetWidth;sizeTotalScroll=altezza;document.body.style.height=`${altezza}px`;var l=larghezza*(sectionsAvailable.length);wrapperSezioni.width(`${l}px`);sectionsAvailable.each(function(i,el){$(this).width(larghezza)})} setHeight(){heightAadminBar=0;if($('body').is('.admin-bar')&&!elementorFrontend.isEditMode()){heightAadminBar=45} var altezza=this.dom.content.offsetHeight-heightAadminBar;sizeTotalScroll=altezza;document.body.style.height=`${altezza}px`} resize(){if(directionScroll=='vertical'){this.setHeight()}else if(directionScroll=='horizontal'){this.setWidth()} this.scroll()} preload(){imagesLoaded(this.dom.content,(instance)=>{if(directionScroll=='vertical'){this.setHeight()}else if(directionScroll=='horizontal'){this.setWidth()}})} scroll(){this.data.current=window.scrollY} run(){this.data.last=math.lerp(this.data.last,this.data.current,this.data.ease);this.data.last=Math.floor(this.data.last*100)/100;if(this.data.last<.1){this.data.last=0} const skewVal=skew_inertiaScroll;const scaleVal=bounce_inertiaScroll;const diff=this.data.current-this.data.last;const acc=diff/config.width;const velo=+acc;const bounce=1-Math.abs(velo*scaleVal) const skew=velo*(skewVal);var percentOfScroll=(this.data.current/sizeTotalScroll)*100;if(directionScroll=='vertical'){var verticalmovement=this.data.last;this.dom.content.style.transform=`translate3d(0, -${verticalmovement}px, 0) skewY(${skew}deg) scaleY(${bounce})`;this.dom.content.style.transformOrigin=`50% ${percentOfScroll}% 0`}else if(directionScroll=='horizontal'){var horizontalmovement=this.data.last;this.dom.content.style.transform=`translate3d(-${horizontalmovement}px, 0, 0) skewX(${skew}deg) scaleY(${bounce})`;this.dom.content.style.transformOrigin=`${percentOfScroll}% 50% 0`} this.requestAnimationFrame()} on(){this.setStyles();if(directionScroll=='vertical'){this.setHeight()}else if(directionScroll=='horizontal'){this.setWidth()} this.addEvents();this.requestAnimationFrame()} off(){this.cancelAnimationFrame();this.removeEvents()} requestAnimationFrame(){this.rAF=requestAnimationFrame(this.run)} cancelAnimationFrame(){cancelAnimationFrame(this.rAF)} destroy(){document.body.style.height='';this.data=null;this.removeEvents();this.cancelAnimationFrame()} resize(){if(directionScroll=='vertical'){this.setHeight()}else if(directionScroll=='horizontal'){this.setWidth()}} addEvents(){window.addEventListener('resize',this.resize,{passive:!0});window.addEventListener('scroll',this.scroll,{passive:!0})} removeEvents(){window.removeEventListener('resize',this.resize,{passive:!0});window.removeEventListener('scroll',this.scroll,{passive:!0})} init(){this.preload();this.on()}} var settings_page={};var sectionsAvailable=[];var sezioni='';var wrapperSezioni=null;var heightAadminBar=0;var sizeTotalScroll=0;is_pageScroll=!1;var is_scrollify=!1,titleStyle='',navStyle='default';var is_scrollEffects=!1;var currentPostId;var is_enable_dceScrolling,is_enable_scrollify,is_enable_scrollEffects,is_enable_inertiaScroll;var datalax=['data-lax-opacity','data-lax-translate','data-lax-translate-x','data-lax-translate-y','data-lax-scale','data-lax-scale-x','data-lax-scale-y','data-lax-skew','data-lax-skew-x','data-lax-skew-y','data-lax-rotate','data-lax-rotate-x','data-lax-rotate-y','data-lax-brightness','data-lax-contrast','data-lax-hue-rotate','data-lax-blur','data-lax-invert','data-lax-saturate','data-lax-grayscale','data-lax-bg-pos','data-lax-bg-pos-x','data-lax-bg-pos-y','data-lax-anchor'] var is_inertiaScroll=!1;var directionScroll='vertical';var coefSpeed_inertiaScroll=0.05;var html=document.documentElement;var scroller={};const body=document.body;var main={};var mainWrap={};var skew_inertiaScroll=20;var bounce_inertiaScroll=0;let sx=0;let sy=0;let dx=sx;let dy=sy;var requestId;var init_Scrollify=function(){$('body').addClass('dce-scrollify dce-scrolling');if(settings_page.custom_class_section_sfy){$customClass=settings_page.custom_class_section_sfy}else{$customClass='elementor-section'} $target_sections='.elementor-'+currentPostId;if(!$target_sections) $target_sections='';sezioni=$target_sections+'.elementor > .elementor-inner > .elementor-section-wrap > .'+$customClass;wrapperSezioni=$($target_sections+'.elementor > .elementor-inner > .elementor-section-wrap');$($target_sections).addClass('scroll-direction-'+settings_page.directionScroll);$.scrollify({section:sezioni,sectionName:'id',interstitialSection:settings_page.interstitialSection,easing:"easeOutExpo",scrollSpeed:Number(settings_page.scrollSpeed.size)||1100,offset:Number(settings_page.offset.size)||0,scrollbars:Boolean(settings_page.scrollBars),setHeights:Boolean(settings_page.setHeights),overflowScroll:Boolean(settings_page.overflowScroll),updateHash:Boolean(settings_page.updateHash),touchScroll:Boolean(settings_page.touchScroll),before:function(i,panels){var ref=panels[i].attr("data-id");$(".dce-scrollify-pagination .nav__item--current").removeClass("nav__item--current");$(".dce-scrollify-pagination").find("a[href=\"#"+ref+"\"]").addClass("nav__item--current")},afterRender:function(){is_scrollify=!0;if(settings_page.enable_scrollify_nav||elementorFrontend.isEditMode()){var scrollify_pagination='';createNavigation(settings_page.snapscroll_nav_style);$("body").on("click",".dce-scrollify-pagination a",function(){$.scrollify.move($(this).attr("href"));return!1});if(!Boolean(settings_page.enable_scrollify_nav)){handleScrollify_enablenavigation('')} if(Boolean(settings_page.enable_scrollEffects)){handleScrollEffects(settings_page.enable_scrollEffects)}}}});$.scrollify.update()} var createNavigationTitles=function($style,$reload=!1){titleStyle=$style;if($reload){createNavigation(settings_page.snapscroll_nav_style)}} var createNavigation=function($style){navStyle=$style;if($('.dce-scrollify-pagination').length>0) $('.dce-scrollify-pagination').remove();var newPagination='';var activeClass;var titleString;createNavigationTitles(settings_page.snapscroll_nav_title_style);newPagination='