{"version":3,"file":"ScrollFX.BTr5Bgdk.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/Cjh1lW6pQJMEe0WTrgwT/9kHm6JVVKMwjHTxGOYsF/ScrollFX.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useRef}from\"react\";import{useScroll,useTransform,useMotionValue,useSpring,useMotionTemplate}from\"framer-motion\";// Scroll-driven motion for AVENIQ. Apply these overrides to canvas layers.\n// They only run in Preview and on the published site.\nconst vh=()=>typeof window!==\"undefined\"?window.innerHeight:800;const vw=()=>typeof window!==\"undefined\"?window.innerWidth:1200;const clamp=v=>Math.min(1,Math.max(0,v));function merge(ref,local){return node=>{local.current=node;if(typeof ref===\"function\")ref(node);else if(ref)ref.current=node;};}// Hero film: full screen, then shrinks into a rounded card as you scroll.\nexport function withHeroShrink(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const{scrollY}=useScroll();const p=useTransform(scrollY,y=>clamp(y/(vh()*1.05)));const scale=useTransform(p,t=>{const end=vw()<810?.66:.34;return 1.06+(end-1.06)*t;});const radius=useTransform(p,t=>`${Math.round(t*70)}px`);return /*#__PURE__*/_jsx(Component,{...props,ref:ref,style:{...props.style,scale,borderRadius:radius}});});}// Hero copy: drifts up and fades as the film shrinks.\nexport function withHeroFade(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const{scrollY}=useScroll();const opacity=useTransform(scrollY,y=>1-clamp(y/(vh()*.32)));const y=useTransform(scrollY,v=>-clamp(v/(vh()*.32))*80);return /*#__PURE__*/_jsx(Component,{...props,ref:ref,style:{...props.style,opacity,y}});});}// Hero copy that appears on the small card once the film has shrunk.\nexport function withHeroAfter(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const{scrollY}=useScroll();const opacity=useTransform(scrollY,y=>clamp((y-vh()*.75)/(vh()*.3)));const y=useTransform(scrollY,v=>(1-clamp((v-vh()*.75)/(vh()*.3)))*40);return /*#__PURE__*/_jsx(Component,{...props,ref:ref,style:{...props.style,opacity,y}});});}// Scattered photos that rise past the shrinking film at different speeds.\nfunction rise(Component,from,to){return /*#__PURE__*/forwardRef((props,ref)=>{const{scrollY}=useScroll();const opacity=useTransform(scrollY,y=>clamp((y-vh()*.2)/(vh()*.3)));const y=useTransform(scrollY,v=>{const t=clamp(v/(vh()*2.2));return(from+(to-from)*t)*(vh()/900);});return /*#__PURE__*/_jsx(Component,{...props,ref:ref,style:{...props.style,opacity,y}});});}export function withRiseSlow(Component){return rise(Component,420,-220);}export function withRiseMid(Component){return rise(Component,520,-380);}export function withRiseFast(Component){return rise(Component,640,-520);}export function withRiseFaster(Component){return rise(Component,760,-680);}// Full-bleed media that pulls in to a rounded card as it enters the screen.\nexport function withBleedToCard(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const local=useRef(null);const{scrollYProgress}=useScroll({target:local,offset:[\"start end\",\"start 20%\"]});const inset=useTransform(scrollYProgress,t=>t*(vw()<810?12:24));const r=useTransform(scrollYProgress,t=>t*28);const clipPath=useMotionTemplate`inset(0px ${inset}px round ${r}px)`;return /*#__PURE__*/_jsx(Component,{...props,ref:merge(ref,local),style:{...props.style,clipPath}});});}// Media inside a clipped frame: slow zoom-out while it passes through the screen.\nexport function withZoomOut(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const local=useRef(null);const{scrollYProgress}=useScroll({target:local,offset:[\"start end\",\"end start\"]});const scale=useTransform(scrollYProgress,[0,1],[1.22,1.02]);const y=useTransform(scrollYProgress,[0,1],[\"-6%\",\"5%\"]);return /*#__PURE__*/_jsx(Component,{...props,ref:merge(ref,local),style:{...props.style,scale,y}});});}// Section that settles into place: scales up slightly from 0.94 as it arrives.\nexport function withSettle(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const local=useRef(null);const{scrollYProgress}=useScroll({target:local,offset:[\"start end\",\"start 35%\"]});const scale=useTransform(scrollYProgress,[0,1],[.92,1]);const y=useTransform(scrollYProgress,[0,1],[80,0]);return /*#__PURE__*/_jsx(Component,{...props,ref:merge(ref,local),style:{...props.style,scale,y}});});}// Buttons follow the cursor a little, then spring back.\nexport function withMagnetic(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const mx=useMotionValue(0);const my=useMotionValue(0);const x=useSpring(mx,{stiffness:220,damping:16,mass:.4});const y=useSpring(my,{stiffness:220,damping:16,mass:.4});const local=useRef(null);return /*#__PURE__*/_jsx(Component,{...props,ref:merge(ref,local),style:{...props.style,x,y},onMouseMove:e=>{const el=local.current;if(!el)return;const b=el.getBoundingClientRect();mx.set((e.clientX-b.left-b.width/2)*.22);my.set((e.clientY-b.top-b.height/2)*.3);props.onMouseMove?.(e);},onMouseLeave:e=>{mx.set(0);my.set(0);props.onMouseLeave?.(e);}});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withMagnetic\":{\"type\":\"reactHoc\",\"name\":\"withMagnetic\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRiseSlow\":{\"type\":\"reactHoc\",\"name\":\"withRiseSlow\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRiseFaster\":{\"type\":\"reactHoc\",\"name\":\"withRiseFaster\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRiseMid\":{\"type\":\"reactHoc\",\"name\":\"withRiseMid\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withZoomOut\":{\"type\":\"reactHoc\",\"name\":\"withZoomOut\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withSettle\":{\"type\":\"reactHoc\",\"name\":\"withSettle\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHeroShrink\":{\"type\":\"reactHoc\",\"name\":\"withHeroShrink\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withBleedToCard\":{\"type\":\"reactHoc\",\"name\":\"withBleedToCard\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHeroAfter\":{\"type\":\"reactHoc\",\"name\":\"withHeroAfter\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHeroFade\":{\"type\":\"reactHoc\",\"name\":\"withHeroFade\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRiseFast\":{\"type\":\"reactHoc\",\"name\":\"withRiseFast\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ScrollFX.map"],"mappings":"uNAEyK,SAAS,EAAM,EAAI,EAAM,CAAC,MAAO,IAAM,CAAC,EAAM,QAAQ,EAAQ,OAAO,GAAM,WAAW,EAAI,CAAI,EAAU,IAAI,EAAI,QAAQ,EAAK,CAAE,CACxS,SAAgB,EAAe,EAAU,CAAC,OAAoB,GAAY,EAAM,IAAM,CAAC,GAAK,CAAC,WAAS,EAAU,EAAQ,EAAE,EAAa,EAAQ,GAAG,EAAM,GAAG,EAAG,EAAE,KAAK,CAAC,EAAQ,EAAM,EAAa,EAAE,GAAsC,OAAxB,EAAG,EAAE,IAAI,IAAI,KAAqB,MAAM,CAAG,EAAQ,EAAO,EAAa,EAAE,GAAG,GAAG,KAAK,MAAM,EAAE,EAAE,EAAE,GAAG,EAAE,OAAoB,EAAK,EAAU,CAAC,GAAG,EAAU,MAAI,MAAM,CAAC,GAAG,EAAM,MAAM,QAAM,aAAa,CAAM,CAAC,CAAC,CAAE,CAAC,CAAE,CACja,SAAgB,EAAa,EAAU,CAAC,OAAoB,GAAY,EAAM,IAAM,CAAC,GAAK,CAAC,WAAS,EAAU,EAAQ,EAAQ,EAAa,EAAQ,GAAG,EAAE,EAAM,GAAG,EAAG,EAAE,IAAI,CAAC,EAAQ,EAAE,EAAa,EAAQ,GAAG,CAAC,EAAM,GAAG,EAAG,EAAE,IAAI,EAAE,EAAE,EAAE,OAAoB,EAAK,EAAU,CAAC,GAAG,EAAU,MAAI,MAAM,CAAC,GAAG,EAAM,MAAM,UAAQ,GAAC,CAAC,CAAC,CAAE,CAAC,CAAE,CACjU,SAAgB,EAAc,EAAU,CAAC,OAAoB,GAAY,EAAM,IAAM,CAAC,GAAK,CAAC,WAAS,EAAU,EAAQ,EA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