{"version":3,"file":"Examples_1.Bq4AvIbF.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/ycPl3Y0RvhhbZZb0VeHC/9RslyVDDfKvmhqpnd48B/Examples_1.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useEffect,useState}from\"react\";const BG={mx:6,my:4,amp:2,period:8e3,delay:0};const MID={mx:12,my:8,amp:2.5,period:7e3,delay:1400};const FG={mx:18,my:12,amp:3,period:6e3,delay:2600};function AmbientWrapper({cfg,Component,props}){const[tr,setTr]=useState(\"none\");useEffect(()=>{const reduced=window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;if(reduced)return;let curX=0,curY=0,tgtX=0,tgtY=0,raf=0;const t0=performance.now()-cfg.delay;const onMove=e=>{tgtX=(e.clientX/window.innerWidth-.5)*2*cfg.mx;tgtY=(e.clientY/window.innerHeight-.5)*2*cfg.my;};const tick=now=>{curX+=(tgtX-curX)*.05;curY+=(tgtY-curY)*.05;const drift=Math.sin((now-t0)/cfg.period*Math.PI*2)*cfg.amp;setTr(`translate(${curX.toFixed(2)}px,${(curY+drift).toFixed(2)}px)`);raf=requestAnimationFrame(tick);};window.addEventListener(\"mousemove\",onMove,{passive:true});raf=requestAnimationFrame(tick);return()=>{window.removeEventListener(\"mousemove\",onMove);cancelAnimationFrame(raf);};},[]);return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",transform:tr,willChange:\"transform\"},children:/*#__PURE__*/_jsx(Component,{...props})});}export function withAmbientBg(Component){return /*#__PURE__*/forwardRef((props,_ref)=>/*#__PURE__*/_jsx(AmbientWrapper,{cfg:BG,Component:Component,props:props}));}export function withAmbientMid(Component){return /*#__PURE__*/forwardRef((props,_ref)=>/*#__PURE__*/_jsx(AmbientWrapper,{cfg:MID,Component:Component,props:props}));}export function withAmbientFg(Component){return /*#__PURE__*/forwardRef((props,_ref)=>/*#__PURE__*/_jsx(AmbientWrapper,{cfg:FG,Component:Component,props:props}));}\nexport const __FramerMetadata__ = {\"exports\":{\"withAmbientMid\":{\"type\":\"reactHoc\",\"name\":\"withAmbientMid\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAmbientBg\":{\"type\":\"reactHoc\",\"name\":\"withAmbientBg\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAmbientFg\":{\"type\":\"reactHoc\",\"name\":\"withAmbientFg\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Examples_1.map"],"mappings":"8IAAkP,SAAS,EAAe,CAAC,MAAI,YAAU,SAAO,CAAC,GAAK,CAAC,EAAG,GAAOA,EAAS,MAAM,EAAosB,OAAlsB,MAAc,CAA6E,GAA9D,EAAO,WAAW,kCAAkC,CAAC,CAAC,QAAmB,OAAO,IAAI,EAAK,EAAE,EAAK,EAAE,EAAK,EAAE,EAAK,EAAE,EAAI,EAAQ,EAAG,YAAY,IAAI,EAAE,EAAI,MAAY,EAAO,GAAG,CAAC,GAAM,EAAE,QAAQ,EAAO,WAAW,IAAI,EAAE,EAAI,GAAG,GAAM,EAAE,QAAQ,EAAO,YAAY,IAAI,EAAE,EAAI,EAAG,EAAQ,EAAK,GAAK,CAAC,IAAO,EAAK,GAAM,IAAI,IAAO,EAAK,GAAM,IAAI,IAAM,EAAM,KAAK,KAAK,EAAI,GAAI,EAAI,OAAO,KAAK,GAAG,CAAC,EAAE,EAAI,IAAI,EAAM,aAAa,EAAK,QAAQ,CAAC,EAAE,MAAM,EAAK,EAAA,CAAO,QAAQ,CAAC,EAAE,IAAI,EAAE,EAAI,sBAAsB,CAAI,CAAE,EAA6F,OAA3F,EAAO,iBAAiB,YAAY,EAAO,CAAC,QAAQ,EAAI,CAAC,EAAE,EAAI,sBAAsB,CAAI,MAAY,CAAC,EAAO,oBAAoB,YAAY,CAAM,EAAE,qBAAqB,CAAG,CAAE,CAAE,EAAE,CAAC,CAAC,EAAsB,EAAK,MAAM,CAAC,MAAM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