{"version":3,"file":"WaveClickEffect.BEl83ZMu.mjs","names":["useState","useCallback","perpAngle","offsetX","offsetY","_Fragment"],"sources":["https:/framerusercontent.com/modules/VuGdPHVOz98AHYTlIidp/fvMxZY3y42kMFLLRgcSO/WaveClickEffect.js"],"sourcesContent":["// Straight lines click animation effect with customizable color, duration, stroke, size, offset and rotation\nimport{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useEffect,useState,useCallback,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{motion,AnimatePresence}from\"framer-motion\";/**\n * Straight Lines Click Animation Effect\n *\n * @framerIntrinsicWidth 100\n * @framerIntrinsicHeight 100\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function WaveClickEffect(props){const{color=\"#0099FF\",duration=1.5,strokeWidth=2,size=100,offsetX=0,offsetY=0,rotation=0,easing=\"easeOut\",customEase=\"0.4, 0, 0.2, 1\",angleBetween=120,shapeType=\"straight\",innerCircleSize=0,opacityDuration=1.5,style}=props;const[waves,setWaves]=useState([]);const handleClick=useCallback(e=>{const newWave={id:Date.now(),x:e.clientX,y:e.clientY};startTransition(()=>{setWaves(prev=>[...prev,newWave]);});setTimeout(()=>{startTransition(()=>{setWaves(prev=>prev.filter(wave=>wave.id!==newWave.id));});},duration*1e3);},[duration]);useEffect(()=>{if(typeof window===\"undefined\")return;window.addEventListener(\"click\",handleClick);return()=>{window.removeEventListener(\"click\",handleClick);};},[handleClick]);// Parse custom ease or use preset\nconst getEasing=useCallback(()=>{if(easing===\"custom\"){const values=customEase.split(\",\").map(v=>parseFloat(v.trim()));if(values.length===4&&values.every(v=>!isNaN(v))){return values;}return[.4,0,.2,1];}return easing;},[easing,customEase]);const easingValue=getEasing();// Generate path based on shape type\nconst generatePath=useCallback(angle=>{const centerX=size/2;const centerY=size/2;const innerRadius=innerCircleSize/2;const length=size/2;const startX=centerX+innerRadius*Math.cos(angle*Math.PI/180);const startY=centerY+innerRadius*Math.sin(angle*Math.PI/180);const endX=centerX+length*Math.cos(angle*Math.PI/180);const endY=centerY+length*Math.sin(angle*Math.PI/180);switch(shapeType){case\"wavy\":const waveCount=3;const amplitude=size/20;let wavyPath=`M ${startX} ${startY}`;for(let i=1;i<=10;i++){const t=i/10;const currentRadius=innerRadius+(length-innerRadius)*t;const x=centerX+currentRadius*Math.cos(angle*Math.PI/180);const y=centerY+currentRadius*Math.sin(angle*Math.PI/180);const perpAngle=angle+90;const offset=Math.sin(t*Math.PI*waveCount)*amplitude;const offsetX=offset*Math.cos(perpAngle*Math.PI/180);const offsetY=offset*Math.sin(perpAngle*Math.PI/180);wavyPath+=` L ${x+offsetX} ${y+offsetY}`;}return wavyPath;case\"zigzag\":const segments=5;let zigzagPath=`M ${startX} ${startY}`;for(let i=1;i<=segments;i++){const t=i/segments;const currentRadius=innerRadius+(length-innerRadius)*t;const x=centerX+currentRadius*Math.cos(angle*Math.PI/180);const y=centerY+currentRadius*Math.sin(angle*Math.PI/180);const perpAngle=angle+90;const offset=(i%2===0?1:-1)*(size/15);const offsetX=offset*Math.cos(perpAngle*Math.PI/180);const offsetY=offset*Math.sin(perpAngle*Math.PI/180);zigzagPath+=` L ${x+offsetX} ${y+offsetY}`;}zigzagPath+=` L ${endX} ${endY}`;return zigzagPath;case\"curved\":const controlDist=innerRadius+(length-innerRadius)*.5;const perpAngle=angle+90;const controlX=centerX+controlDist*Math.cos(angle*Math.PI/180)+size/8*Math.cos(perpAngle*Math.PI/180);const controlY=centerY+controlDist*Math.sin(angle*Math.PI/180)+size/8*Math.sin(perpAngle*Math.PI/180);return`M ${startX} ${startY} Q ${controlX} ${controlY} ${endX} ${endY}`;case\"dotted\":const dots=8;let dottedPath=\"\";for(let i=0;i<=dots;i++){const t=i/dots;const currentRadius=innerRadius+(length-innerRadius)*t;const x=centerX+currentRadius*Math.cos(angle*Math.PI/180);const y=centerY+currentRadius*Math.sin(angle*Math.PI/180);const dotSize=strokeWidth*1.5;dottedPath+=`M ${x-dotSize/2} ${y} a ${dotSize/2} ${dotSize/2} 0 1 0 ${dotSize} 0 a ${dotSize/2} ${dotSize/2} 0 1 0 -${dotSize} 0 `;}return dottedPath;case\"straight\":default:return`M ${startX} ${startY} L ${endX} ${endY}`;}},[size,shapeType,strokeWidth,innerCircleSize]);return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"div\",{style:{...style,position:\"relative\",width:\"100%\",height:\"100%\",backgroundColor:\"transparent\"}}),/*#__PURE__*/_jsx(\"div\",{style:{position:\"fixed\",top:0,left:0,width:\"100vw\",height:\"100vh\",pointerEvents:\"none\",zIndex:9999,overflow:\"hidden\"},children:/*#__PURE__*/_jsx(AnimatePresence,{children:waves.map(wave=>/*#__PURE__*/_jsx(motion.div,{initial:{opacity:1,scale:0},animate:{opacity:0,scale:1},exit:{opacity:0},transition:{scale:{duration,ease:easingValue},opacity:{duration:opacityDuration,ease:easingValue,delay:duration}},style:{position:\"absolute\",left:wave.x+offsetX,top:wave.y+offsetY,width:size,height:size,transform:`translate(-50%, -50%)`},children:/*#__PURE__*/_jsxs(\"svg\",{width:size,height:size,viewBox:`0 0 ${size} ${size}`,fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",style:{transform:`rotate(${rotation}deg)`,transformOrigin:\"center\"},children:[/*#__PURE__*/_jsx(motion.path,{d:generatePath(0),stroke:color,strokeWidth:strokeWidth,strokeLinecap:\"round\",fill:\"none\",initial:{pathLength:0},animate:{pathLength:1},transition:{duration:duration*.6,ease:easingValue}}),/*#__PURE__*/_jsx(motion.path,{d:generatePath(angleBetween),stroke:color,strokeWidth:strokeWidth,strokeLinecap:\"round\",fill:\"none\",initial:{pathLength:0},animate:{pathLength:1},transition:{duration:duration*.6,ease:easingValue,delay:duration*.1}}),/*#__PURE__*/_jsx(motion.path,{d:generatePath(angleBetween*2),stroke:color,strokeWidth:strokeWidth,strokeLinecap:\"round\",fill:\"none\",initial:{pathLength:0},animate:{pathLength:1},transition:{duration:duration*.6,ease:easingValue,delay:duration*.2}}),/*#__PURE__*/_jsx(motion.path,{d:generatePath(angleBetween*3),stroke:color,strokeWidth:strokeWidth,strokeLinecap:\"round\",fill:\"none\",initial:{pathLength:0},animate:{pathLength:1},transition:{duration:duration*.6,ease:easingValue,delay:duration*.15}})]})},wave.id))})})]});}addPropertyControls(WaveClickEffect,{color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#0099FF\"},duration:{type:ControlType.Number,title:\"Duration\",defaultValue:1.5,min:.1,max:5,step:.1,unit:\"s\"},opacityDuration:{type:ControlType.Number,title:\"Opacity Duration\",defaultValue:1.5,min:0,max:5,step:.1,unit:\"s\"},strokeWidth:{type:ControlType.Number,title:\"Stroke Width\",defaultValue:2,min:1,max:10,step:.5,unit:\"px\"},size:{type:ControlType.Number,title:\"Size\",defaultValue:100,min:32,max:300,step:10,unit:\"px\"},innerCircleSize:{type:ControlType.Number,title:\"Inner Circle Size\",defaultValue:0,min:0,max:200,step:5,unit:\"px\"},offsetX:{type:ControlType.Number,title:\"Offset X\",defaultValue:0,min:-100,max:100,step:1,unit:\"px\"},offsetY:{type:ControlType.Number,title:\"Offset Y\",defaultValue:0,min:-100,max:100,step:1,unit:\"px\"},rotation:{type:ControlType.Number,title:\"Rotation\",defaultValue:0,min:0,max:360,step:15,unit:\"deg\"},easing:{type:ControlType.Enum,title:\"Easing\",defaultValue:\"easeOut\",options:[\"linear\",\"easeIn\",\"easeOut\",\"easeInOut\",\"anticipate\",\"backOut\",\"custom\"],optionTitles:[\"Linear\",\"Ease In\",\"Ease Out\",\"Ease In Out\",\"Anticipate\",\"Back Out\",\"Custom\"]},customEase:{type:ControlType.String,title:\"Custom Ease\",defaultValue:\"0.4, 0, 0.2, 1\",placeholder:\"0.4, 0, 0.2, 1\",hidden:({easing})=>easing!==\"custom\"},angleBetween:{type:ControlType.Number,title:\"Angle Between\",defaultValue:120,min:0,max:180,step:5,unit:\"deg\"},shapeType:{type:ControlType.Enum,title:\"Shape Type\",defaultValue:\"straight\",options:[\"straight\",\"wavy\",\"zigzag\",\"curved\",\"dotted\"],optionTitles:[\"Straight\",\"Wavy\",\"Zigzag\",\"Curved\",\"Dotted\"]}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"WaveClickEffect\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"fixed\",\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"100\",\"framerIntrinsicWidth\":\"100\",\"framerSupportedLayoutWidth\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./WaveClickEffect.map"],"mappings":"mRASG,SAAwB,EAAgB,EAAM,CAAC,GAAK,CAAC,QAAM,UAAU,WAAS,IAAI,cAAY,EAAE,OAAK,IAAI,UAAQ,EAAE,UAAQ,EAAE,WAAS,EAAE,SAAO,UAAU,aAAW,iBAAiB,eAAa,IAAI,YAAU,WAAW,kBAAgB,EAAE,kBAAgB,IAAI,SAAO,EAAW,CAAC,EAAM,GAAUA,EAAS,EAAE,CAAC,CAAO,EAAYC,EAAY,GAAG,CAAC,IAAM,EAAQ,CAAC,GAAG,KAAK,KAAK,CAAC,EAAE,EAAE,QAAQ,EAAE,EAAE,QAAQ,CAAC,MAAoB,CAAC,EAAS,GAAM,CAAC,GAAG,EAAK,EAAQ,CAAC,EAAG,CAAC,eAAe,CAAC,MAAoB,CAAC,EAAS,GAAM,EAAK,OAAO,GAAM,EAAK,KAAK,EAAQ,GAAG,CAAC,EAAG,EAAG,EAAS,IAAI,EAAG,CAAC,EAAS,CAAC,CAAC,MAAc,CAAI,GAAO,IAAS,OAAgE,OAA7C,EAAO,iBAAiB,QAAQ,EAAY,KAAW,CAAC,EAAO,oBAAoB,QAAQ,EAAY,GAAK,CAAC,EAAY,CAAC,CACngB,IAAM,EAAtOA,MAAgB,CAAC,GAAG,IAAS,SAAS,CAAC,IAAM,EAAO,EAAW,MAAM,IAAI,CAAC,IA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