1class CustomCursor extends HTMLElement{constructor(){super(),this.cursorElement=document.createElement("div"),this.cursorTextElement=document.createElement("div"),this.cursorTextElement.classList.add("cursor-text"),this.cursorDotElement=document.createElement("div"),this.cursorDotElement.classList.add("cursor-dot"),this.cursorDotElement.setAttribute("part","cursor-dot"),this.attachShadow({mode:"open"}),this.cursorElement.appendChild(this.cursorDotElement),this.cursorElement.appendChild(this.cursorTextElement),this.shadowRoot.appendChild(this.cursorElement),this.cursorElement.classList.add("cursor"),this.posX=0,this.posY=0,this.clicked=!1,this.hidden=!1,this.cursorText="See more",this._onMouseMove=this._onMouseMove.bind(this),this._onMouseDown=this._onMouseDown.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._onMouseEnter=this._onMouseEnter.bind(this),this._onMouseLeave=this._onMouseLeave.bind(this),this._onMouseOver=this._onMouseOver.bind(this),this._onMouseOut=this._onMouseOut.bind(this),this._onMouseScroll=this._onMouseScroll.bind(this)}connectedCallback(){this._applyStyles(),window.addEventListener("mousemove",this._onMouseMove),window.addEventListener("mousedown",this._onMouseDown),window.addEventListener("mouseup",this._onMouseUp),window.addEventListener("mouseenter",this._onMouseEnter),window.addEventListener("mouseleave",this._onMouseLeave),window.addEventListener("mouseover",this._onMouseOver),window.addEventListener("mouseout",this._onMouseOut),window.addEventListener("scroll",this._onMouseScroll)}disconnectedCallback(){window.removeEventListener("mousemove",this._onMouseMove),window.removeEventListener("mousedown",this._onMouseDown),window.removeEventListener("mouseup",this._onMouseUp),window.removeEventListener("mouseenter",this._onMouseEnter),window.removeEventListener("mouseleave",this._onMouseLeave),window.removeEventListener("mouseover",this._onMouseOver),window.removeEventListener("mouseout",this._onMouseOut),window.removeEventListener("scroll",this._onMouseScroll)}_applyStyles(){const styles=` 2 :host { 3 position: fixed; 4 top: 0; 5 left: 0; 6 width: 100vw; 7 height: 100vh; 8 pointer-events: none; 9 z-index: 999999; 10 mix-blend-mode: difference; 11 } 12 13 :host(.no-blend-mode) { 14 mix-blend-mode: normal; 15 } 16 17 .cursor { 18 display: flex; 19 align-items: center; 20 justify-content: center; 21 position: absolute; 22 margin-top: 30px; 23 margin-left: 30px; 24 border-radius: 50%; 25 transform: translate(-50%, -50%); 26 transition: transform 0.05s, opacity 0.3s, background-color 0.2s; 27 will-change: transform, background-color; 28 opacity: 0; 29 } 30 31 .cursor-dot { 32 position: absolute; 33 width: 28px; 34 height: 28px; 35 background-color: white; 36 border-radius: 50%; 37 transition: transform .3s, background-color 0.2s; 38 } 39 40 .cursor-text { 41 position: absolute; 42 top: calc(50% + 30px); 43 left: -19px; 44 right: 0; 45 margin: 0 auto; 46 transform: translateY(-50%); 47 font-size: 10px; 48 width: 58px; 49 height: 58px; 50 display: flex; 51 align-items: center; 52 justify-content: center; 53 color: transparent; 54 font-family: Scto Grotesk B, sans-serif; 55 font-size: 12px; 56 font-weight: 400; 57 text-transform: uppercase; 58 line-height: 1.2; 59 transition: .3s; 60 } 61 62 .hidden { 63 opacity: 0; 64 } 65 66 .hovering-link .cursor-dot { 67 transform: translate(10px, 30px) scale(3); 68 background-color: #DEFC52; 69 } 70 71 .hovering-link .cursor-text { 72 color: #000; 73 } 74 75 /* Enable mix-blend-mode styling via ::part */ 76 ::part(cursor-dot) { 77 mix-blend-mode: difference; 78 } 79 80 ${navigator.maxTouchPoints>1&&` 81 .cursor { 82 display: none; 83 } 84 `} 85 `,styleElement=document.createElement("style");styleElement.textContent=styles,this.shadowRoot.appendChild(styleElement)}_onMouseMove(e){this.posX=e.clientX,this.posY=e.clientY;const offsetX=-40,offsetY=-20,hoverX=e.clientX-offsetX,hoverY=e.clientY-offsetY,isImage=document.elementsFromPoint(hoverX,hoverY).some(el=>el.tagName==="IMG"),isA=document.elementsFromPoint(hoverX,hoverY).some(el=>el.tagName==="A"),isButton=document.elementsFromPoint(hoverX,hoverY).some(el=>el.tagName==="BUTTON"),isH1=document.elementsFromPoint(hoverX,hoverY).some(el=>el.tagName==="H1"),isH2=document.elementsFromPoint(hoverX,hoverY).some(el=>el.tagName==="H2"),isH3=document.elementsFromPoint(hoverX,hoverY).some(el=>el.tagName==="H3"),isH4=document.elementsFromPoint(hoverX,hoverY).some(el=>el.tagName==="H4"),isH5=document.elementsFromPoint(hoverX,hoverY).some(el=>el.tagName==="H5"),isP=document.elementsFromPoint(hoverX,hoverY).some(el=>el.tagName==="P"),isUL=document.elementsFromPoint(hoverX,hoverY).some(el=>el.tagName==="UL"),isOL=document.elementsFromPoint(hoverX,hoverY).some(el=>el.tagName==="OL"),isLI=document.elementsFromPoint(hoverX,hoverY).some(el=>el.tagName==="LI");setTimeout(()=>{this.cursorElement.style.opacity=1},50),this.cursorElement.style.transform=`translate(${this.posX}px, ${this.posY}px)`;const cursorTextEl=e.target.hasAttribute("data-cursor-html"),link=e.target.closest("a");cursorTextEl&&link&&!link.hasAttribute("disable-hover")&&(this.cursorText=e.target.hasAttribute("data-cursor-html")?e.target.getAttribute("data-cursor-html"):"See more",this.cursorTextElement.innerHTML=clean
85HTML(this.cursorText)),isA||isButton?link&&!link.hasAttribute("disable-hover")&&this.classList.add("no-blend-mode"):this.classList.remove("no-blend-mode"),this.cursorElement.classList.contains("hovering-link")&&link&&!link.hasAttribute("disable-hover")&&this.classList.add("no-blend-mode")}_onMouseDown(e){const link=e.target.closest("a");this.cursorElement.classList.add("clicked"),e.target.hasAttribute("data-cursor-html")&&link&&!link.hasAttribute("disable-hover")&&setTimeout(()=>{this.cursorText=e.target.hasAttribute("data-cursor-html")?e.target.getAttribute("data-cursor-html"):"See more",this.cursorTextElement.innerHTML=cleanHTML(this.cursorText)},50)}_onMouseUp(e){this.cursorElement.classList.remove("clicked")}_onMouseEnter(){this.cursorElement.classList.remove("hidden")}_onMouseLeave(){this.cursorElement.classList.add("hidden")}_onMouseOver(e){const link=e.target.closest("a"),cursorTextEl=e.target.hasAttribute("data-cursor-html"),submitButton=e.target.type==="submit",submitButtonContent=e.target.closest("[type='submit']");(e.target.tagName==="A"||cursorTextEl||link||submitButton||submitButtonContent)&&link&&!link.hasAttribute("disable-hover")&&(this.cursorText=e.target.hasAttribute("data-cursor-html")?e.target.getAttribute("data-cursor-html"):"See more",this.cursorElement.classList.add("hovering-link"),this.cursorTextElement.innerHTML=cleanHTML(this.cursorText)),this.cursorElement.classList.contains("hovering-link")&&link&&!link.hasAttribute("disable-hover")&&this.classList.add("no-blend-mode"),link&&!link.hasAttribute("disable-hover")&&this.classList.remove("no-blend-mode")}_onMouseOut(e){const link=e.target.closest("a"),cursorTextEl=e.target.hasAttribute("data-cursor-html"),submitButton=e.target.type==="submit",submitButtonContent=e.target.closest("[type='submit']");(e.target.tagName==="A"||cursorTextEl||link||submitButton||submitButtonContent)&&(this.cursorText="",this.cursorElement.classList.remove("hovering-link")),this.cursorTextElement.innerHTML=cleanHTML(this.cursorText)}_onMouseScroll(e){this.classList.add("no-blend-mode")}setCursorText(text){this.cursorElement.classList.add("hovering-link"),this.cursorText=text,this.cursorTextElement.innerHTML=cleanHTML(text)}}window.customElements.get("custom-cursor")||customElements.define("custom-cursor",CustomCursor); 86//# sourceMappingURL=/cdn/shop/t/3/assets/custom-cursor.js.map?v=89633935508391242951741364840
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.