'); $(blockScrollId + ' .t396').css('overflow','hidden'); },50); setTimeout(()=>clearInterval(initWrap),8000); const fixSafariFixedPos=setInterval(()=>{ const targetNode = document.querySelector(blockScrollId + ' .t396__artboard'); if(!targetNode){return;} clearInterval(fixSafariFixedPos); if(window.isSafari){ const config = { attributes: true, attributeFilter: ['class'] }; $(targetNode).removeClass('t396__artboard-fixed-no-bg'); const callback = function(mutationsList) { for (let mutation of mutationsList) { if (mutation.type === 'attributes' && mutation.attributeName === 'class') { let element = mutation.target; if ($(element).hasClass('t396__artboard-fixed-no-bg')) { $(element).removeClass('t396__artboard-fixed-no-bg'); } } }; }; const observer = new MutationObserver(callback); observer.observe(targetNode, config); } },100); setTimeout(()=>clearInterval(fixSafariFixedPos),5000); function n_ready(t) { "loading" != document.readyState ? t() : document.addEventListener ? document.addEventListener("DOMContentLoaded", t) : document.attachEvent("onreadystatechange", function() { "loading" != document.readyState && t() }) } const fixAutoscale=setInterval(function() { if (window.t396_scale__getElementsToScale != undefined) { clearInterval(fixAutoscale); window.t396_scale__getElementsToScale = function(artBoard) { if (!artBoard) return []; let container=artBoard; const divNlm127=artBoard.querySelector(".scrollbooster-content"); if (divNlm127) { container=divNlm127; } return Array.prototype.slice.call(container.children).filter(function (element) { return element && (element.classList.contains('t396__elem') || element.classList.contains('t396__group')); }); } } },50); setTimeout(()=>clearInterval(fixAutoscale),8000); n_ready(function() { let shiftSize; $(window).on('load resize', function(){ if (window.matchMedia('(max-width: 480px)').matches) { shiftSize = '320px'; } else if (window.matchMedia('(max-width: 640px)').matches) { shiftSize = '320px'; } else if (window.matchMedia('(max-width: 960px)').matches) { shiftSize = '320px'; } else if (window.matchMedia('(max-width: 1200px)').matches) { shiftSize = '320px'; } else { shiftSize = '320px'; } }); function onMouseDown(){ let content = $(blockScrollId + ' .scrollbooster-content')[0]; if (content) { const iframeElems=content.querySelectorAll('iframe'); if(iframeElems.length > 0){ iframeElems.forEach(function(iframeElem){ iframeElem.style.pointerEvents = 'none'; }) } } } function onMouseUp(){ let content = $(blockScrollId + ' .scrollbooster-content')[0]; if(content) { const iframeElems=content.querySelectorAll('iframe'); if(iframeElems.length > 0){ iframeElems.forEach(function(iframeElem){ iframeElem.style.pointerEvents = 'auto'; }) } } } function initScrollBooster() { let viewport = $(blockScrollId + ' .scrollbooster-viewport')[0]; let content = $(blockScrollId + ' .scrollbooster-content')[0]; const booster = new ScrollBooster({ viewport, content, scrollMode: 'native', pointerMode: 'mouse', direction: 'horizontal', bounce: false, onPointerDown: function() { $(blockScrollId + ' *:focus').blur() }, }); } window.removeEventListener("mousedown", onMouseDown); window.removeEventListener("mouseup", onMouseUp); window.addEventListener('mousedown',onMouseDown); window.addEventListener('mouseup',onMouseUp); if(1) { function listenerForResize () { setTimeout(() => { initScrollBooster(); const scrollbooster=document.querySelector(blockScrollId+' .scrollbooster-content'); scrollbooster.style.opacity = '1'; },500); } window.addEventListener('resize', listenerForResize); setTimeout(()=>window.dispatchEvent(new Event('resize')),0); if(window.isMobile) { setTimeout(() => { window.removeEventListener('resize', listenerForResize); }); } }else{ const viewBlock=setInterval(()=>{ const scrollbooster=document.querySelector(blockScrollId+' .scrollbooster-content'); if(scrollbooster){ scrollbooster.style.opacity = '1'; } },100); setTimeout(()=>clearInterval(viewBlock),5000); } function getDistance() { let shape = document.querySelector('.shape1'); if(!shape) { console.error("No element with the class '.shape1' found."); return; } var style = window.getComputedStyle(shape); let transformScale = 1; if(style.transform !== "none") { transformScale = parseFloat(style.transform.split('(')[1].split(')')[0].split(',')[0]); } let zoom = parseFloat(style.zoom); if (isNaN(zoom)) { zoom = 1; } const shapeSize=style.width.replace(/[^0-9.]+/g, ""); let distance = shapeSize*zoom*transformScale ; return distance + 'px'; } if(1) { $(document).on('click', '.leftArrow', function(e) { e.preventDefault(); $(blockScrollId + ' .t396__artboard').animate( { scrollLeft: '-=' + getDistance() }, 300); }); $(document).on('click', '.rightArrow' ,function(e) { e.preventDefault(); $(blockScrollId + ' .t396__artboard').animate( { scrollLeft: '+=' + getDistance() }, 300); }); } }); })();