{"version":3,"file":"Perlin_Distortion.BFtFCcuc.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/cgrobktIPwptUVNTpk9w/IXg6khLg9BkNIK9lyam5/Perlin_Distortion.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";export default function RefinedThreeCircleReveal(props){const uniqueID=Math.random().toString(36).substr(2,9);const[progress,setProgress]=useState(props.mode===\"hide\"?1:0);const[maxRadius,setMaxRadius]=useState(1e3)// Default to avoid SSR crash\n;const animationRef=useRef(null);useEffect(()=>{if(typeof window!==\"undefined\"){setMaxRadius(Math.min(Math.max(window.innerWidth,window.innerHeight)*1.5,2e3));}},[]);useEffect(()=>{let isMounted=true// Prevents memory leaks\n;const delay=props.startDelay*1e3;const duration=props.duration*1e3;const startAnimation=()=>{const startTime=performance.now();const animate=currentTime=>{if(!isMounted)return;// Stop updates if unmounted\nconst elapsed=currentTime-startTime;const linearProgress=Math.max(0,Math.min(elapsed/duration,1));setProgress(props.mode===\"hide\"?1-linearProgress:linearProgress);if(linearProgress<1){animationRef.current=requestAnimationFrame(animate);}};animationRef.current=requestAnimationFrame(animate);};const timeout=setTimeout(startAnimation,delay);return()=>{isMounted=false;clearTimeout(timeout);cancelAnimationFrame(animationRef.current);};},[props.duration,props.mode,props.startDelay]);return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",overflow:\"hidden\",position:\"relative\",background:props.backgroundColor},children:/*#__PURE__*/_jsxs(\"svg\",{style:{width:\"100%\",height:\"100%\"},children:[/*#__PURE__*/_jsxs(\"defs\",{children:[/*#__PURE__*/_jsxs(\"filter\",{id:`noise_${uniqueID}`,children:[/*#__PURE__*/_jsx(\"feTurbulence\",{type:\"fractalNoise\",baseFrequency:props.noiseFrequency,numOctaves:props.noiseLayers,seed:props.noiseSeed}),/*#__PURE__*/_jsx(\"feDisplacementMap\",{in:\"SourceGraphic\",scale:Math.min(progress*props.noiseScale,100)})]}),/*#__PURE__*/_jsxs(\"radialGradient\",{id:`fade_${uniqueID}`,cx:\"50%\",cy:\"50%\",r:\"50%\",children:[/*#__PURE__*/_jsx(\"stop\",{offset:\"40%\",stopColor:\"white\"}),/*#__PURE__*/_jsx(\"stop\",{offset:\"100%\",stopColor:\"black\"})]}),/*#__PURE__*/_jsx(\"mask\",{id:`mask_${uniqueID}`,maskUnits:\"userSpaceOnUse\",children:/*#__PURE__*/_jsx(\"circle\",{cx:\"50%\",cy:\"50%\",r:progress*maxRadius,fill:`url(#fade_${uniqueID})`,style:{filter:`url(#noise_${uniqueID})`}})})]}),/*#__PURE__*/_jsx(\"foreignObject\",{width:\"100%\",height:\"100%\",style:{mask:`url(#mask_${uniqueID})`,WebkitMask:`url(#mask_${uniqueID})`},children:/*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",background:\"transparent\"},children:props.children||/*#__PURE__*/_jsx(\"div\",{style:{width:\"50%\",height:\"50%\",background:\"blue\",borderRadius:\"50%\"}})})})]})});}// Property Controls\naddPropertyControls(RefinedThreeCircleReveal,{children:{type:ControlType.ComponentInstance,title:\"Content\"},mode:{type:ControlType.Enum,title:\"Mode\",options:[\"reveal\",\"hide\"],optionTitles:[\"Reveal\",\"Hide\"],defaultValue:\"reveal\"},duration:{type:ControlType.Number,title:\"Duration\",defaultValue:5,min:1,max:20,step:.5},startDelay:{type:ControlType.Number,title:\"Start Delay\",defaultValue:0,min:0,max:10,step:.1},noiseFrequency:{type:ControlType.Number,title:\"Noise Frequency\",defaultValue:.02,min:.001,max:.1,step:.001},noiseScale:{type:ControlType.Number,title:\"Noise Scale\",defaultValue:50,min:1,max:200,step:1},noiseLayers:{type:ControlType.Number,title:\"Noise Layers\",defaultValue:3,min:1,max:10,step:1},noiseSeed:{type:ControlType.Number,title:\"Noise Seed\",defaultValue:1,min:1,max:1e3,step:1},backgroundColor:{type:ControlType.Color,title:\"Background Color\",defaultValue:\"#000\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"RefinedThreeCircleReveal\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Perlin_Distortion.map"],"mappings":"iUAA0J,SAAwB,EAAyB,EAAM,CAAC,IAAM,EAAS,KAAK,SAAS,SAAS,IAAI,OAAO,EAAE,GAAQ,CAAC,EAAS,EAAY,CAACA,EAAS,EAAM,OAAO,OAAO,EAAE,GAAQ,CAAC,EAAU,EAAa,CAACA,EAAS,KACtW,EAAaC,EAAO,MAEuc,OAFjc,MAAc,CAAW,IAAS,QAAa,EAAa,KAAK,IAAI,KAAK,IAAI,EAAO,WAAW,EAAO,aAAa,IAAI,KAAQ,EAAC,EAAE,EAAE,MAAc,CAAC,IAAI,EAAU,GAC5L,EAAM,EAAM,WAAW,IAAU,EAAS,EAAM,SAAS,IAAU,MAAmB,CAAC,IAAM,EAAU,YAAY,MAAY,EAAQ,GAAa,CAAC,GAAG,CAAC,EAAU,OAC1K,IAAM,EAAQ,EAAY,EAAgB,EAAe,KAAK,IAAI,EAAE,KAAK,IAAI,EAAQ,EAAS,IAAI,EAAY,EAAM,OAAO,OAAO,EAAE,EAAe,GAAmB,EAAe,IAAG,EAAa,QAAQ,sBAAsB,GAAW,EAAC,EAAa,QAAQ,sBAAsB,EAAU,EAAO,EAAQ,WAAW,EAAe,GAAO,UAAU,CAAC,EAAU,GAAM,aAAa,GAAS,qBAAqB,EAAa,QAAU,CAAE,EAAC,CAAC,EAAM,SAAS,EAAM,KAAK,EAAM,WAAW,EAAsB,EAAK,MAAM,CAAC,MAAM,CAAC,MAAM,OAAO,OAAO,OAAO,SAAS,SAAS,SAAS,WAAW,WAAW,EAAM,gBAAgB,CAAC,SAAsB,EAAM,MAAM,CAAC,MAAM,CAAC,MAAM,OAAO,OAA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