PageSourceSearch

https://atibal-optics.com/cdn/shop/t/14/assets/sticky-header.js?v=123133869411551951951735590373

js atibal-optics.com collected 2026-10-07 14:17:03 UTC 3,028 bytes, 2 lines download raw bytes

1customElements.get("sticky-header")||customElements.define("sticky-header",class extends HTMLElement{constructor(){super(),this.stickyType=this.getAttribute("data-sticky-type")||"none",this.stickyType!=="none"&&(this.currentScrollTop=0,this.onScrollHandler=this.onScroll.bind(this),this.preventHide=!1,this.preventReveal=!1,this.hideHeaderOnScrollUp=()=>this.preventReveal=!0)}connectedCallback(){this.header=document.querySelector(".section-header"),this.headerIsAlwaysSticky=this.stickyType==="always"||this.stickyType==="reduce-logo-size",this.headerBounds={},this.setHeaderHeight(),window.matchMedia("(min-width: 750px)").addEventListener("change",this.setHeaderHeight.bind(this)),this.headerIsAlwaysSticky&&this.header.classList.add("shopify-section-header-sticky"),this.predictiveSearch=this.querySelector("predictive-search"),this.addEventListener("preventHeaderReveal",this.hideHeaderOnScrollUp),window.addEventListener("scroll",this.onScrollHandler),this.createObserver()}disconnectedCallback(){window.removeEventListener("scroll",this.onScrollHandler)}setHeaderHeight(){document.documentElement.style.getPropertyValue("--header-height")===""&&document.documentElement.style.setProperty("--header-height",`${this.header.querySelector("header").offsetHeight}px`)}createObserver(){new IntersectionObserver((entries,observer2)=>{this.headerBounds=entries[0].intersectionRect,observer2.disconnect()}).observe(this.header)}onScroll(){const scrollTop=window.pageYOffset||document.documentElement.scrollTop;if(!(document.body.hasAttribute("scroll-y-off")||this.predictiveSearch&&this.predictiveSearch.isOpen)){if(scrollTop>this.currentScrollTop&&scrollTop>this.headerBounds.bottom){if(this.header.classList.add("scrolled-past-header"),this.preventHide)return;this.headerIsAlwaysSticky||requestAnimationFrame(this.hide.bind(this))}else scrollTop<this.currentScrollTop&&scrollTop>this.headerBounds.bottom?(this.header.classList.add("scrolled-past-header"),this.preventReveal?(window.clearTimeout(this.isScrolling),this.isScrolling=setTimeout(()=>{this.preventReveal=!1},60),this.headerIsAlwaysSticky||requestAnimationFrame(this.hide.bind(this))):this.headerIsAlwaysSticky||requestAnimationFrame(this.reveal.bind(this))):scrollTop<=this.headerBounds.top&&(this.header.classList.remove("scrolled-past-header"),this.headerIsAlwaysSticky||requestAnimationFrame(this.reset.bind(this)));this.currentScrollTop=scrollTop}}hide(){this.header.classList.add("shopify-section-header-hidden","shopify-section-header-sticky"),this.closeDropMenus()}reveal(){this.header.classList.add("shopify-section-header-sticky","animate"),this.header.classList.remove("shopify-section-header-hidden")}reset(){this.header.classList.remove("shopify-section-header-hidden","shopify-section-header-sticky","animate")}closeDropMenus(){this.dropMenus=this.dropMenus||this.header.querySelectorAll("drop-menu"),this.dropMenus.forEach(dropMenu=>dropMenu.close())}});
2//# sourceMappingURL=/cdn/shop/t/14/assets/sticky-header.js.map?v=123133869411551951951735590373

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.