PageSourceSearch

https://www.trueclassictees.com/cdn/shop/t/645/assets/main-nav.js?v=177001859306134438981763685037

js trueclassictees.com collected 2026-09-26 15:29:45 UTC 3,127 bytes, 2 lines download raw bytes

1if(!customElements.get("main-nav")){class MainNav extends HTMLElement{constructor(){super(),this.searchOpenButton=this.querySelector("#nav__tab--search"),this.mobileSearchOpenButton=this.querySelector("#mobile-open-search"),this.searchBar=document.querySelector("search-bar"),this.lastScrollY=0,this.isSticky=!1}connectedCallback(){window.addEventListener("scroll",this.handleScroll.bind(this)),this.dataset.isSticky&&(this.isSticky=!0,this.closest(".main-nav__wrapper").classList.add("is-sticky")),this.searchOpenButton.addEventListener("click",this.toggleSearch.bind(this)),this.mobileSearchOpenButton.addEventListener("click",this.toggleSearch.bind(this)),this.querySelectorAll("[data-open-mobile-menu]").forEach(menuToggle=>{menuToggle.addEventListener("click",this.openMobileMenu.bind(this))})}disconnectedCallback(){window.removeEventListener("scroll",this.handleScroll.bind(this))}handleScroll(){const currentScrollY=window.scrollY,isMobile=window.innerWidth<768,navWrapper=this.closest(".main-nav__wrapper"),announcementBar=document.querySelector(".new-announcement-bar__wrapper"),prefersReducedMotion=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(currentScrollY===0?this.classList.remove("scrolled"):this.classList.add("scrolled"),this.isSticky&&isMobile&&!prefersReducedMotion){const scrollDirection=currentScrollY>this.lastScrollY?"down":"up";if(this.searchBar.classList.contains("active")){announcementBar.classList.remove("nav-hidden"),navWrapper.classList.remove("nav-hidden");return}const announcementBarElement=document.querySelector(".new-announcement-bar"),shouldKeepVisible=announcementBarElement&&announcementBarElement.classList.contains("has-dep-selector")&&window.innerWidth<=767;scrollDirection==="down"&&currentScrollY>50?shouldKeepVisible||(announcementBar&&announcementBar.classList.contains("is-sticky")&&announcementBar.classList.add("nav-hidden"),navWrapper.classList.add("nav-hidden")):(scrollDirection==="up"||currentScrollY<=50)&&(announcementBar&&announcementBar.classList.contains("is-sticky")&&announcementBar.classList.remove("nav-hidden"),navWrapper.classList.remove("nav-hidden"))}this.lastScrollY=currentScrollY}toggleSearch(){this.searchBar.getAttribute("aria-hidden")==="true"?this.searchBar.openSearch():this.searchBar.closeSearch()}openMobileMenu(event){event.preventDefault();const hamburger=document.querySelector("#primary-nav-toggle");if(!hamburger)return;hamburger.click();const mobileNavCategories=document.querySelector("mobile-nav-categories"),menuHandle=(event.target.dataset.openMobileMenu?event.target:event.target.closest("[data-open-mobile-menu]")).dataset.openMobileMenu,mobileNavTypeSelector=document.querySelector(`mobile-nav-type-selector [name="type-selector-mobile-nav"][value="${menuHandle}"]`);mobileNavCategories!==null&&mobileNavTypeSelector!==null&&menuHandle&&(mobileNavCategories.setAttribute("data-menu-handle",menuHandle),mobileNavCategories.switchMenu(menuHandle),mobileNavTypeSelector.checked=!0)}}customElements.define("main-nav",MainNav)}
2//# sourceMappingURL=/cdn/shop/t/645/assets/main-nav.js.map?v=177001859306134438981763685037

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.