PageSourceSearch

https://www.nonasties.shop/cdn/shop/t/22/assets/motion-coordinator.js?v=82212682990186441691779095061

js nonasties.shop collected 2026-10-09 23:06:51 UTC 2,649 bytes, 2 lines download raw bytes

1class MotionCoordinator{constructor(){this.observer=null,this.queue=new Map,this.active=new Set,this.completed=new Set,this.config={maxActiveAnimations:25,maxZoomAnimations:12,maxPerSection:8,threshold:.15,rootMargin:"50px"}}init(){this.observer||(this.observer=new IntersectionObserver(entries=>this.handleIntersections(entries),{threshold:this.config.threshold,rootMargin:this.config.rootMargin}))}registerElement(element,options){return this.observer||this.init(),this.completed.has(element)?()=>{}:(this.queue.set(element,{onActivate:options.onActivate,type:options.type||element.dataset?.motion||"unknown"}),this.observer.observe(element),()=>this.unregister(element))}unregister(element){this.observer&&this.observer.unobserve(element),this.queue.delete(element),this.active.delete(element)}clearCompleted(element){this.completed.delete(element)}handleIntersections(entries){entries.forEach(entry=>{if(entry.isIntersecting){const element=entry.target,data=this.queue.get(element);data&&this.canActivate(element,data.type)&&this.activate(element,data.onActivate)}})}canActivate(element,type){if(this.active.size>=this.config.maxActiveAnimations||(type==="zoom-out"||type==="zoom-in")&&Array.from(this.active).filter(el=>{const data=this.queue.get(el);return data&&(data.type==="zoom-out"||data.type==="zoom-in")}).length>=this.config.maxZoomAnimations)return!1;const section=element.closest("section, [class*='section']");return!(section&&Array.from(this.active).filter(el=>section.contains(el)).length>=this.config.maxPerSection)}async activate(element,callback){this.active.add(element),this.observer.unobserve(element);try{await callback()}catch(error){console.error("[MotionCoordinator] Animation error:",error)}finally{this.active.delete(element),this.queue.delete(element),this.completed.add(element)}}getStats(){const activeByType={};for(const el of this.active){const type=this.queue.get(el)?.type||"unknown";activeByType[type]=(activeByType[type]||0)+1}return{queued:this.queue.size,active:this.active.size,completed:this.completed.size,activeByType,limits:{maxActive:this.config.maxActiveAnimations,maxZoom:this.config.maxZoomAnimations,maxPerSection:this.config.maxPerSection},observer:this.observer?"initialized":"not initialized"}}destroy(){this.observer&&(this.observer.disconnect(),this.observer=null),this.queue.clear(),this.active.clear(),this.completed.clear()}}export const motionCoordinator=new MotionCoordinator;typeof window<"u"&&(window.FoxTheme=window.FoxTheme||{},window.FoxTheme.motionCoordinator=motionCoordinator);
2//# sourceMappingURL=/cdn/shop/t/22/assets/motion-coordinator.js.map?v=82212682990186441691779095061

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.