PageSourceSearch

https://store.frontlinegaming.org/cdn/shop/t/27/assets/sticky-scro…?v=32758325870558658521775516772

js frontlinegaming.org collected 2026-09-24 09:53:22 UTC 3,592 bytes, 2 lines download raw bytes

1function debounce(fn,wait=300){let t;return(...args)=>{clearTimeout(t),t=setTimeout(()=>fn.apply(this,args),wait)}}if(!customElements.get("sticky-scroll-direction")){class StickyScrollDirection extends HTMLElement{connectedCallback(){this.init()}init(){const headerIsSticky=document.querySelector('store-header[data-is-sticky="true"]');this.headerHeight=Number.parseInt(getComputedStyle(this.parentElement).getPropertyValue("--header-height").replace("px",""),10),this.container=this.firstElementChild,this.currentTop=Number.parseInt(document.documentElement.scrollTop+this.getBoundingClientRect().top-this.offsetTop,10),this.defaultTop=headerIsSticky?parseInt(this.headerHeight+30,10):48,this.scrollY=window.scrollY,this.minStickySize=this.dataset.minStickySize,this.toggleListeners(),window.addEventListener("on:breakpoint-change",this.toggleListeners.bind(this))}toggleListeners(){this.minStickySize==="lg"&&theme.mediaMatches.lg||this.minStickySize==="md"&&theme.mediaMatches.md?this.addListeners():this.removeListeners()}addListeners(){this.scrollListener=this.scrollListener||this.handleScroll.bind(this),window.addEventListener("scroll",this.scrollListener),this.scrollListener(),this.parentElement.dataset.stickyHeightElems&&(this.debouncedSetStickyHeights=this.debouncedSetStickyHeights||debounce(this.setStickyHeight.bind(this),500),window.addEventListener("resize",this.debouncedSetStickyHeights),"MutationObserver"in window&&(this.stickyHeightElems=this.parentElement.dataset.stickyHeightElems,this.observer=new MutationObserver(this.debouncedSetStickyHeights),document.querySelectorAll(this.stickyHeightElems).forEach(elem=>{this.observer.observe(elem,{childList:!0,attributes:!0,subtree:!0})})),this.setStickyHeight()),this.disclosures=this.querySelectorAll("details"),this.disclosures&&(this.disclosureChangeHandler=this.disclosureChangeHandler||this.handleDisclosureChange.bind(this),this.disclosures.forEach(disclosure=>{disclosure.addEventListener("transitionend",this.disclosureChangeHandler)}))}handleDisclosureChange(evt){if(evt.target.classList.contains("disclosure__panel")){const summaryElem=evt.target.closest(".disclosure").querySelector("summary");theme.elementUtil.isInViewport(summaryElem)||window.scrollTo({behavior:"smooth",top:summaryElem.getBoundingClientRect().top-document.body.getBoundingClientRect().top-this.headerHeight-20})}}removeListeners(){this.container.style.top="",window.removeEventListener("scroll",this.scrollListener),this.observer&&(this.observer.disconnect(),window.removeEventListener("resize",this.debouncedSetStickyHeights)),this.disclosures&&this.disclosures.forEach(disclosure=>{disclosure.removeEventListener("transitionend",this.disclosureChangeHandler)})}setStickyHeight(){let totalHeight=0;document.querySelectorAll(this.stickyHeightElems).forEach(elem=>{totalHeight+=elem.getBoundingClientRect().height}),this.parentElement.style.setProperty("--sticky-height",`${parseInt(totalHeight,10)}px`)}handleScroll(){const maxTop=this.container.getBoundingClientRect().top+window.scrollY-this.container.offsetTop+this.defaultTop,minTop=this.container.clientHeight-window.innerHeight;window.scrollY<this.scrollY?this.currentTop-=window.scrollY-this.scrollY:this.currentTop+=this.scrollY-window.scrollY,this.currentTop=Math.min(Math.max(this.currentTop,-minTop),maxTop,this.defaultTop),this.scrollY=window.scrollY,this.container.style.top=`${this.currentTop}px`}}customElements.define("sticky-scroll-direction",StickyScrollDirection)}
2//# sourceMappingURL=/cdn/shop/t/27/assets/sticky-scroll-direction.js.map?v=32758325870558658521775516772

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.