PageSourceSearch

https://zp.edu.ua/wp-content/cache/min/1/wp-content/themes/impulse…/js/components/marquee.js?ver=1790792071

js zp.edu.ua collected 2026-10-01 10:30:24 UTC 4,758 bytes, 7 lines download raw bytes

1document.addEventListener("DOMContentLoaded",()=>{const isMobile={any:()=>navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)};const departmentListArr=document.querySelectorAll('[data-list="marquee"]');if(typeof gsap==="undefined"||departmentListArr.length===0)return;const reducedMotion=window.matchMedia("(prefers-reduced-motion: reduce)");const motionOff=()=>document.documentElement.classList.contains("accessibility-no-anim")||reducedMotion.matches;departmentListArr.forEach((deptList,index)=>{const content=deptList.firstElementChild;if(!content)return;const clone=content.cloneNode(!0);clone.setAttribute('aria-hidden','true');clone.querySelectorAll('a, button, input, textarea, select').forEach(el=>el.setAttribute('tabindex','-1'));deptList.append(clone);const items=deptList.querySelectorAll(".department-list__inner");const isReverse=index%2!==0;deptList.style.cursor='grab';deptList.style.userSelect='none';deptList.style.webkitUserSelect='none';deptList.style.touchAction='pan-y';deptList.querySelectorAll('a, img').forEach(el=>{el.addEventListener('dragstart',e=>e.preventDefault())});let totalWidth=0;let wrap;let xPos=0;const speed=isReverse?-0.35:0.35;let lastWidth=0;const createAnimation=()=>{deptList.classList.remove("_small");if(items[0].getBoundingClientRect().width<document.body.clientWidth){deptList.classList.add("_small")}
2const r1=items[0].getBoundingClientRect();const r2=items[1].getBoundingClientRect();const newTotalWidth=r2.left-r1.left;if(newTotalWidth>0&&Math.abs(newTotalWidth-lastWidth)>=1){totalWidth=newTotalWidth;lastWidth=totalWidth;wrap=gsap.utils.wrap(-totalWidth,0);if(xPos>0||xPos<-totalWidth){xPos=isReverse?0:-totalWidth}}};createAnimation();if(window.ResizeObserver){const resizeObserver=new ResizeObserver(()=>createAnimation());resizeObserver.observe(items[0]);resizeObserver.observe(deptList)}else{let resizeTimeout;window.addEventListener('resize',()=>{clearTimeout(resizeTimeout);resizeTimeout=setTimeout(createAnimation,250)})}
3deptList.querySelectorAll('img').forEach(img=>{if(!img.complete)img.addEventListener('load',createAnimation)});let isDown=!1;let isDragging=!1;let isVerticalScroll=!1;let startX;let startY;let downX;let downY;let isHovered=!1;const onPointerDown=(e)=>{isDown=!0;isDragging=!1;isVerticalScroll=!1;deptList.style.cursor='grabbing';startX=e.pageX||(e.touches&&e.touches[0].pageX);startY=e.pageY||(e.touches&&e.touches[0].pageY);downX=startX;downY=startY};const onPointerUp=()=>{if(!isDown)return;isDown=!1;isVerticalScroll=!1;deptList.style.cursor='grab';setTimeout(()=>{isDragging=!1},50)};const onPointerMove=(e)=>{if(!isDown||isVerticalScroll)return;const x=e.pageX||(e.touches&&e.touches[0].pageX);const y=e.pageY||(e.touches&&e.touches[0].pageY);if(x===undefined||y===undefined)return;if(!isDragging){const dx=Math.abs(x-downX);const dy=Math.abs(y-downY);if(dy>dx&&dy>5){isVerticalScroll=!0;isDown=!1;deptList.style.cursor='grab';return}
4if(dx>3){isDragging=!0}}
5const walk=x-startX;xPos+=walk;startX=x;startY=y};deptList.addEventListener('mousedown',onPointerDown);deptList.addEventListener('touchstart',onPointerDown,{passive:!0});window.addEventListener('mouseup',onPointerUp);window.addEventListener('touchend',onPointerUp);window.addEventListener('mousemove',onPointerMove);window.addEventListener('touchmove',onPointerMove,{passive:!0});deptList.addEventListener('click',(e)=>{if(isDragging){e.preventDefault();e.stopPropagation()}},{capture:!0});if(!isMobile.any()){deptList.addEventListener("mouseenter",()=>{isHovered=!0});deptList.addEventListener("mouseleave",()=>{isHovered=!1})}
6let isFocused=!1;deptList.addEventListener("focusin",(e)=>{if(!e.target.matches(":focus-visible"))return;isFocused=!0;deptList.scrollLeft=0;const box=deptList.getBoundingClientRect();const left=Math.max(box.left,0);const right=Math.min(box.right,document.documentElement.clientWidth);const r=e.target.getBoundingClientRect();if(r.left<left||r.right>right){xPos+=(left+right-r.width)/2-r.left}});deptList.addEventListener("focusout",(e)=>{if(!deptList.contains(e.relatedTarget))isFocused=!1});let lastX=null;const tick=()=>
6{if(totalWidth===0||!wrap)return;if(!isDown&&!isFocused&&(!isHovered||isMobile.any())&&!motionOff()){xPos+=speed*gsap.ticker.deltaRatio()}
7if(!isFocused)xPos=wrap(xPos);if(xPos===lastX)return;lastX=xPos;gsap.set(items,{x:xPos})};if(window.IntersectionObserver){let ticking=!1;const visibilityObserver=new IntersectionObserver((entries)=>{const isVisible=entries[entries.length-1].isIntersecting;if(isVisible&&!ticking)gsap.ticker.add(tick);if(!isVisible&&ticking&&!isDown)gsap.ticker.remove(tick);ticking=isVisible||(ticking&&isDown)},{rootMargin:"100px"});visibilityObserver.observe(deptList)}else{gsap.ticker.add(tick)}})})

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.