{"version":3,"file":"Soundwave2.D2PjRfMu.mjs","names":["React.useRef"],"sources":["https:/framerusercontent.com/modules/pTIz38D3TK1kY00hw1nq/uSMduPSbUZU5JonBwLcz/Soundwave2.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{useAnimationFrame}from\"framer-motion\";export default function SmoothWave(props){const{tint,speed,amplitude,frequency,complexity}=props;// We use a Ref to update the SVG path directly.\n// This is much faster than React State for high-speed animation.\nconst pathRef=React.useRef(null);useAnimationFrame(t=>{if(!pathRef.current)return;const width=200// Internal coordinate system width\n;const height=100// Internal coordinate system height\n;const midY=height/2;const points=100// Resolution of the wave (higher = smoother)\n;// Arrays to store our top and bottom points\nlet topPoints=[];let bottomPoints=[];// Time scaler\nconst time=t*(speed*.001);for(let i=0;i<=points;i++){const x=i/points*width;// Normalized position (0 to 1) across the width\nconst norm=i/points;// 1. ENVELOPE FUNCTION (The \"Football\" Shape)\n// This ensures the wave is always 0 at the left/right edges\n// and loudest in the center.\nconst envelope=Math.sin(norm*Math.PI);// 2. NOISE GENERATION\n// We combine multiple sine waves at different frequencies to create\n// that organic \"blob\" look from your image.\nconst w1=Math.sin(time+norm*frequency*10);const w2=Math.cos(time*.8+norm*frequency*20);const w3=Math.sin(time*1.5+norm*complexity*40)// fast jitter\n;// Combine waves and apply the envelope\n// We multiply them to create \"interference\" (the quiet and loud spots)\nconst displacement=(w1+w2+w3*.3)*envelope*(amplitude*.4);topPoints.push(`${x},${midY-Math.abs(displacement)}`);bottomPoints.push(`${x},${midY+Math.abs(displacement)}`);}// Construct the SVG Path command\n// Move to start, Draw Top Line, Draw Bottom Line (in reverse), Close Path\nconst d=`\n            M 0,${midY} \n            L ${topPoints.join(\" L \")} \n            L ${bottomPoints.reverse().join(\" L \")} \n            Z\n        `;pathRef.current.setAttribute(\"d\",d);});return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},children:/*#__PURE__*/_jsx(\"svg\",{width:\"100%\",height:\"100%\",viewBox:\"0 0 200 100\",preserveAspectRatio:\"none\",style:{overflow:\"visible\"},children:/*#__PURE__*/_jsx(\"path\",{ref:pathRef,fill:tint,// A small stroke helps smooth out rendering edges on some screens\nstroke:tint,strokeWidth:\"1\",strokeLinejoin:\"round\"})})});}SmoothWave.defaultProps={tint:\"#333333\",speed:1,amplitude:80,frequency:1,complexity:.5};addPropertyControls(SmoothWave,{tint:{type:ControlType.Color,title:\"Color\"},amplitude:{type:ControlType.Number,title:\"Height\",min:0,max:150,step:1},speed:{type:ControlType.Number,title:\"Speed\",min:0,max:5,step:.1},frequency:{type:ControlType.Number,title:\"Waves\",min:.5,max:5,step:.1,description:\"Number of big humps\"},complexity:{type:ControlType.Number,title:\"Detail\",min:0,max:5,step:.1,description:\"Adds small ripples\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SmoothWave\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Soundwave2.map"],"mappings":"2NAAwK,SAAwB,EAAW,EAAM,CAAC,GAAK,CAAC,OAAK,QAAM,YAAU,YAAU,cAAY,EAE7P,EAAQA,EAAa,KAAK,CAsBiB,OAtBhB,EAAkB,GAAG,CAAC,GAAG,CAAC,EAAQ,QAAQ,OAAO,IAI9E,EAAU,EAAE,CAAK,EAAa,EAAE,CAC9B,EAAQ,EAAM,KAAT,EAAe,IAAI,IAAI,EAAE,EAAE,GAAG,IAAO,IAAI,CAAC,IAAM,EAAE,EAAE,IAAO,IAChE,EAAK,EAAE,IAGP,EAAS,KAAK,IAAI,EAAK,KAAK,GAAG,CAG/B,EAAG,KAAK,IAAI,EAAK,EAAK,EAAU,GAAG,CAAO,EAAG,KAAK,IAAI,EAAK,GAAG,EAAK,EAAU,GAAG,CAAO,EAAG,KAA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