{"version":3,"file":"ScrollLoop.DF_lmcUj.mjs","names":["useRef","useState","__esmMin","init_npm_react_18_3_1","_e","c","J","init_jsx_runtime","ce","de","useInView","init_framer_motion_DhsWWWsN","useReducedMotion","findClip","p","el","i","makeScrollLoop","local","reduce","dist","setDist","inView","clip","measure","ro","setRef","node","ref","active","Component","props","minDur","pxPerSec","pause","withScrollLoop","withScrollLoopFast","withFloat","seed","withHoverLift","init_ScrollLoop"],"sources":["https:/framerusercontent.com/modules/BVk52morbxnZvld7yJB5/4khe0pfmbQSROimG1jwN/ScrollLoop.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useEffect,useRef,useState}from\"react\";import{useInView,useReducedMotion}from\"framer-motion\";function findClip(el){let p=el?.parentElement??null;for(let i=0;p&&i<4;i++,p=p.parentElement){const o=getComputedStyle(p).overflow;if(o!==\"visible\")return p;}return el?.parentElement??null;}function makeScrollLoop(Component,pxPerSec,minDur,pause){return /*#__PURE__*/forwardRef((props,ref)=>{const local=useRef(null);const reduce=useReducedMotion();const[dist,setDist]=useState(0);const inView=useInView(local,{once:true,amount:.35});useEffect(()=>{const el=local.current;const clip=findClip(el);if(!el||!clip)return;const measure=()=>setDist(Math.max(0,el.offsetHeight-clip.clientHeight));measure();const ro=new ResizeObserver(measure);ro.observe(el);ro.observe(clip);return()=>ro.disconnect();},[]);const setRef=node=>{local.current=node;if(typeof ref===\"function\")ref(node);else if(ref)ref.current=node;};const active=!reduce&&dist>0&&inView;return /*#__PURE__*/_jsx(Component,{ref:setRef,...props,animate:active?{y:[0,-dist]}:undefined,transition:{duration:Math.max(minDur,dist/pxPerSec),ease:\"easeInOut\",repeat:Infinity,repeatType:\"reverse\",repeatDelay:pause,delay:.5}});});}/** Auto-scrolls a tall layer inside its clipped parent, down and back up, forever. */export function withScrollLoop(Component){return makeScrollLoop(Component,45,10,1.4);}/** Same, roughly twice as fast — for case-study screens. */export function withScrollLoopFast(Component){return makeScrollLoop(Component,110,4,1);}/** Very slow vertical drift, each instance with its own tempo. */export function withFloat(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const reduce=useReducedMotion();const[seed]=useState(()=>Math.random());return /*#__PURE__*/_jsx(Component,{ref:ref,...props,animate:reduce?undefined:{y:[0,-6,0]},transition:{duration:6+seed*3,ease:\"easeInOut\",repeat:Infinity,delay:seed*2}});});}/** Gentle lift on hover. */export function withHoverLift(Component){return /*#__PURE__*/forwardRef((props,ref)=>/*#__PURE__*/_jsx(Component,{ref:ref,...props,whileHover:{y:-4},transition:{type:\"spring\",stiffness:260,damping:24}}));}\nexport const __FramerMetadata__ = {\"exports\":{\"withScrollLoopFast\":{\"type\":\"reactHoc\",\"name\":\"withScrollLoopFast\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withFloat\":{\"type\":\"reactHoc\",\"name\":\"withFloat\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withScrollLoop\":{\"type\":\"reactHoc\",\"name\":\"withScrollLoop\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHoverLift\":{\"type\":\"reactHoc\",\"name\":\"withHoverLift\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ScrollLoop.map"],"mappings":"A,+LAAyJ,SAASa,EAAS,EAAG,CAAC,IAAIC,EAAEC,GAAI,eAAe,KAAK,IAAI,IAAIC,EAAE,EAAEF,GAAGE,EAAE,EAAE,IAAI,EAAEF,EAAE,cAAoD,GAA7B,iBAAiBA,CAAC,CAAC,CAAC,WAAgB,UAAU,OAAOA,EAAG,OAAOC,GAAI,eAAe,IAAK,CAAC,SAASE,EAAe,EAAU,EAAS,EAAO,EAAM,CAAC,MAAoB,iBAAY,EAAM,IAAM,CAAC,IAAMC,EAAMlB,EAAO,IAAI,EAAQmB,EAAOP,EAAiB,EAAO,CAACQ,EAAKC,GAASpB,EAAS,CAAC,EAAQqB,EAAOZ,EAAUQ,EAAM,CAAC,KAAK,GAAK,O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