PageSourceSearch

https://thehiddengrounds.com/cdn/shop/t/41/assets/hg12-motion.js?v=10755052963252795641790251563

js thehiddengrounds.com collected 2026-09-24 20:01:18 UTC 5,714 bytes, 2 lines download raw bytes

1(()=>{"use strict";const start=()=>{const root=document.documentElement;if(root.dataset.hgMotionReady)return;root.dataset.hgMotionReady="true";const reduceMotion=window.matchMedia("(prefers-reduced-motion: reduce)"),finePointer=window.matchMedia("(hover: hover) and (pointer: fine)"),buttons=[...document.querySelectorAll("[data-motion-toggle]")],tiltCards=[...document.querySelectorAll("[data-tilt]")],resetters=new Set,running=new Map,storageKey="hg-motion-paused";let userPaused=!1;try{userPaused=localStorage.getItem(storageKey)==="true"}catch{}const isPaused=()=>reduceMotion.matches||userPaused,permitted=()=>!isPaused()&&!document.hidden,trackEffect=(node,className,duration,cleanup,completed)=>{if(!permitted()){cleanup();return}const tasks=running.get(node)||new Set;running.set(node,tasks);let finished=!1,timer;const finish=event=>{completed(event)&&stop()},stop=()=>{finished||(finished=!0,window.clearTimeout(timer),node.removeEventListener("animationend",finish),node.classList.remove(className),cleanup(),tasks.delete(stop),tasks.size||running.delete(node))};tasks.add(stop),node.addEventListener("animationend",finish),timer=window.setTimeout(stop,duration),node.classList.add(className)},clearAnimations=()=>{[...running.values()].forEach(tasks=>[...tasks].forEach(stop=>stop())),resetters.forEach(reset=>reset())},syncPreference=()=>{const paused=isPaused();root.dataset.motion=paused?"paused":"active",root.classList.toggle("motion-enabled",!paused),buttons.forEach(button=>{button.setAttribute("aria-pressed",String(paused)),button.disabled=reduceMotion.matches;const label=reduceMotion.matches?"Reduced motion on":paused?"Resume motion":"Pause motion";button.setAttribute("aria-label",label),button.title=reduceMotion.matches?"Your device is set to reduce motion.":label;const labelNode=button.querySelector("[data-motion-label]");labelNode?labelNode.textContent=label:button.textContent=label}),paused&&clearAnimations()};buttons.forEach(button=>{button.addEventListener("click",()=>{if(!reduceMotion.matches){userPaused=!userPaused;try{localStorage.setItem(storageKey,String(userPaused))}catch{}syncPreference()}})});const onMediaChange=(query,handler)=>{typeof query.addEventListener=="function"?query.addEventListener("change",handler):typeof query.addListener=="function"&&query.addListener(handler)};onMediaChange(reduceMotion,syncPreference),onMediaChange(finePointer,()=>resetters.forEach(reset=>reset())),syncPreference();const drawOnce=node=>{if(!permitted())return;const shapes=node.matches("path, circle, line, polyline, polygon, rect, ellipse")?[node]:[...node.querySelectorAll("path, circle, line, polyline, polygon, rect, ellipse")],drawing=new Set;let count=0;if(shapes.forEach(shape=>{if(!(typeof shape.getTotalLength!="function"||getComputedStyle(shape).stroke==="none"))try{const length=shape.getTotalLength();if(!Number.isFinite(length)||length<=0)return;shape.style.setProperty("--stroke-length",String(length)),shape.style.setProperty("--stroke-delay",`${Math.min(count*55,220)}ms`),shape.classList.add("motion-stroke"),drawing.add(shape),count+=1}catch{}}),!count)return;const pending=new Set(drawing);trackEffect(node,"is-drawing",1700,()=>{drawing.forEach(shape=>{shape.classList.remove("motion-stroke"),shape.style.removeProperty("--stroke-length"),shape.style.removeProperty("--stroke-delay")})},event=>event.animationName!=="hg-draw"||!pending.has(event.target)?!1:(pending.delete(event.target),pending.size===0))},enter=node=>{node.dataset.motionSeen!=="true"&&(node.dataset.motionSeen="true",permitted()&&(node.hasAttribute("data-reveal")&&trackEffect(node,"is-revealing",1200,()=>{},event=>event.target===node&&event.animationName==="hg-reveal"),node.hasAttribute("data-draw")&&drawOnce(node)))},revealNodes=document.querySelectorAll("[data-reveal], [data-draw]");if("IntersectionObserver"in window){const observer=new IntersectionObserver(entries=>{entries.forEach(entry=>{entry.isIntersecting&&(enter(entry.target),observer.unobserve(entry.target))})},{threshold:.12,rootMargin:"0px 0px -24px 0px"});revealNodes.forEach(node=>observer.observe(node))}tiltCards.forEach(card=>{let frame=0,point=null,glow=null;const reset=()=>{frame&&cancelAnimationFrame(frame),frame=0,point=null,card.classList.remove("is-tilting"),card.style.removeProperty("--tilt-x"),card.style.removeProperty("--tilt-y")};resetters.add(reset),card.addEventListener("pointermove",event=>{!permitted()||!finePointer.matches||event.pointerType==="touch"||(point={x:event.clientX,y:event.clientY},!frame&&(frame=requestAnimationFrame(()=>{if(frame=0,!point||!permitted()||!finePointer.matches)return;const rect=card.getBoundingClientRect();if(!rect.width||!rect.height)return;const x=Math.max(0,Math.min(1,(point.x-rect.left)/rect.width)),y=Math.max(0,Math.min(1,(point.y-rect.top)/rect.height));glow||(glow=document.createElement("span"),glow.className="motion-pointer-glow",glow.setAttribute("aria-hidden","true"),card.appendChild(glow)),card.style.setProperty("--tilt-x",`${((.5-y)*6).toFixed(2)}deg`),card.style.setProperty("--tilt-y",`${((x-.5)*6).toFixed(2)}deg`),card.style.setProperty("--pointer-x",`${(x*100).toFixed(1)}%`),card.style.setProperty("--pointer-y",`${(y*100).toFixed(1)}%`),card.classList.add("is-tilting")})))},{passive:!0}),card.addEventListener("pointerleave",reset,{passive:!0}),card.addEventListener("pointercancel",reset,{passive:!0}),card.addEventListener("focusout",reset)}),document.addEventListener("visibilitychange",()=>{document.hidden&&clearAnimations()})};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",start,{once:!0}):start()})();
2//# sourceMappingURL=/cdn/shop/t/41/assets/hg12-motion.js.map?v=10755052963252795641790251563

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.