'); $(blockScrollId + ' .t396').css('overflow','hidden'); },50); setTimeout(()=>clearInterval(initWrap),8000); const fixSafariFixedPos=setInterval(()=>{ const targetNode = document.querySelector(blockScrollId + ' .t396__artboard'); const targetNodeAtom = document.querySelector(blockScrollId + ' .t396__artboard .tn-atom'); if (!targetNodeAtom && !window.isSafari) { return; } clearInterval(fixSafariFixedPos); setTimeout(function(){ const blockScroll = document.querySelector(blockScrollId); if(window.t396_allgroups__renderView) { t396_allgroups__renderView(blockScroll); } if(t396_allelems__renderView) { t396_allelems__renderView(blockScroll); } t396_allelems__renderView(blockScroll); t396_doResize('1823823611'); }, 0); setTimeout(function(){ const blockScroll = document.querySelector(blockScrollId); if(window.t396_allgroups__renderView) { t396_allgroups__renderView(blockScroll); } if(window.t396_allelems__renderView) { t396_allelems__renderView(blockScroll); } t396_doResize('1823823611'); }, 500); 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() { const isTouchOnlyDevice =('maxTouchPoints' in navigator && navigator.maxTouchPoints > 0 && matchMedia('(pointer: coarse)').matches && !matchMedia('(hover: hover)').matches); 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'); const videoPlayerList = content.querySelectorAll('.tn-atom__videoiframe'); if(iframeElems.length > 0){ iframeElems.forEach(function(iframeElem){ iframeElem.style.pointerEvents = 'none'; }) } if(videoPlayerList.length > 0){ videoPlayerList.forEach(function(videoPlayer){ videoPlayer.style.pointerEvents = 'none'; }) } } } function onMouseUp(){ let content = $(blockScrollId + ' .scrollbooster-content')[0]; if(content) { const iframeElems=content.querySelectorAll('iframe'); const videoPlayerList = content.querySelectorAll('.tn-atom__videoiframe'); if(iframeElems.length > 0){ iframeElems.forEach(function(iframeElem){ iframeElem.style.pointerEvents = 'auto'; }) } if(videoPlayerList.length > 0){ videoPlayerList.forEach(function(videoPlayer){ videoPlayer.style.pointerEvents = 'auto'; }) } } } */ function initScrollBooster() { let viewport = $(blockScrollId + ' .scrollbooster-viewport')[0]; let content = $(blockScrollId + ' .scrollbooster-content')[0]; if (isTouchOnlyDevice){ const stopPropagationHandler = (event) => { event.stopPropagation(); }; ['pointerdown', 'pointermove', 'pointerup', 'wheel'].forEach((eventName) => { viewport.addEventListener(eventName, stopPropagationHandler, { passive: false }); }); } 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); */ const intForContent = setInterval(() => { const cardContainer = document.querySelector(blockScrollId + ' .scrollbooster-content'); if(!cardContainer) return ; clearInterval(intForContent); let timer; function disablePrinter() { let content = $(blockScrollId + ' .scrollbooster-content')[0]; const iFrameList = content.querySelectorAll('iframe'); iFrameList.forEach((iFrame) => { iFrame.style.pointerEvents = 'none'; }); } function enablePrinter() { let content = $(blockScrollId + ' .scrollbooster-content')[0]; const iFrameList = content.querySelectorAll('iframe'); iFrameList.forEach((iFrame) => { iFrame.style.pointerEvents = 'auto'; }); } function eventForContainer() { disablePrinter(); clearTimeout(timer); timer = setTimeout(enablePrinter, 100); } cardContainer.removeEventListener('mousemove', eventForContainer); cardContainer.addEventListener('mousemove', eventForContainer); disablePrinter(); },300); if(1) { function listenerForResize () { setTimeout(() => { initScrollBooster(); const scrollbooster=document.querySelector(blockScrollId+' .scrollbooster-content'); scrollbooster.style.opacity = '1'; },500); } setTimeout(()=>listenerForResize(),0); }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('.tn-elem__18238236111765801278125000001'); if(!shape) { console.error("No element with the class '.tn-elem__18238236111765801278125000001' 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) { const $artboard = $(blockScrollId + ' .t396__artboard'); const $left = $('.tn-elem__18238236011765792733447000007'); const $right = $('.tn-elem__18238236011765792712529000004'); const isHorizontal = 'scrollLeft' === 'scrollLeft'; const EPS = 1; function getShiftPx() { const raw = getDistance(); if (typeof raw === 'number') return raw; if (typeof raw === 'string') { const n = parseFloat(raw.replace('px', '').trim()); return Number.isFinite(n) ? n : 0; } return 0; } function getScrollPos() { return isHorizontal ? $artboard.scrollLeft() : $artboard.scrollTop(); } function getMaxScroll() { const el = $artboard.get(0); if (!el) return 0; if (isHorizontal) { const max = el.scrollWidth - el.clientWidth; return Math.max(0, max); } else { const max = el.scrollHeight - el.clientHeight; return Math.max(0, max); } } function canScrollStart() { return getScrollPos() > EPS; } function canScrollEnd() { return getScrollPos() { const blockScroll = document.querySelector(blockScrollId); console.log('blockScroll',blockScroll); if(blockScroll) { const elemsInBlockScrollId = blockScroll.querySelectorAll('.tn-elem[data-elem-type="text"]'); if(window.t396_elem_fixLineHeight !== undefined) { elemsInBlockScrollId.forEach((element) => { t396_elem_fixLineHeight(element); }); } } },2000); }); })();