{"version":3,"file":"BorderWave.C_0BFDWQ.mjs","names":["React.useRef","React.useState"],"sources":["https:/framerusercontent.com/modules/2LeodhHz02ryVzHuBWal/f5jtKus4YZo4BZgpmgQj/BorderWave.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import*as React from\"react\";// Smooth SVG Wave Component\nexport default function SmoothSVGWave(props){const{waveColor,waveCount,waveHeight,waveWidth,curviness,position,fillPosition,waveShape}=props;// Reference to container and state for width\nconst containerRef=React.useRef(null);const[containerWidth,setContainerWidth]=React.useState(1e3);// Update width on resize\nReact.useEffect(()=>{if(!containerRef.current)return;const updateWidth=()=>{if(containerRef.current){setContainerWidth(containerRef.current.offsetWidth);}};// Initial update\nupdateWidth();// Add resize listener\nwindow.addEventListener(\"resize\",updateWidth);// Clean up\nreturn()=>window.removeEventListener(\"resize\",updateWidth);},[]);// Generate the SVG path for the wave\nconst generateWavePath=()=>{// Adjust actual wave width based on container width and wave count\nconst actualWaveWidth=containerWidth/waveCount;// Initialize path\nlet path=\"\";// Use different wave generation based on shape\nif(waveShape===\"sine\"){// Sine wave (smooth up and down waves)\n// Set starting point based on fill position\nif(fillPosition===\"top\"){// Start at top-left for top fill\npath=`M 0 0 L ${containerWidth} 0 L ${containerWidth} ${waveHeight/2} `;// Create sine-like waves using cubic bezier curves\nfor(let i=waveCount;i>0;i--){const x1=i*actualWaveWidth;const x2=(i-.5)*actualWaveWidth;const x3=(i-1)*actualWaveWidth;const controlPointHeight=waveHeight*(curviness/100);// Create smooth sine-like wave\npath+=`C ${x1-actualWaveWidth/4} ${waveHeight/2+controlPointHeight}, `;path+=`${x2+actualWaveWidth/4} ${waveHeight/2+controlPointHeight}, `;path+=`${x2} ${waveHeight/2} `;path+=`C ${x2-actualWaveWidth/4} ${waveHeight/2-controlPointHeight}, `;path+=`${x3+actualWaveWidth/4} ${waveHeight/2-controlPointHeight}, `;path+=`${x3} ${waveHeight/2} `;}// Close the path\npath+=`L 0 ${waveHeight/2} Z`;}else{// Start at bottom-left for bottom fill\npath=`M 0 ${waveHeight/2} `;// Create sine-like waves using cubic bezier curves\nfor(let i=0;i<waveCount;i++){const x1=i*actualWaveWidth;const x2=(i+.5)*actualWaveWidth;const x3=(i+1)*actualWaveWidth;const controlPointHeight=waveHeight*(curviness/100);// Create smooth sine-like wave\npath+=`C ${x1+actualWaveWidth/4} ${waveHeight/2-controlPointHeight}, `;path+=`${x2-actualWaveWidth/4} ${waveHeight/2-controlPointHeight}, `;path+=`${x2} ${waveHeight/2} `;path+=`C ${x2+actualWaveWidth/4} ${waveHeight/2+controlPointHeight}, `;path+=`${x3-actualWaveWidth/4} ${waveHeight/2+controlPointHeight}, `;path+=`${x3} ${waveHeight/2} `;}// Close the path for bottom fill\npath+=`L ${containerWidth} ${waveHeight/2} L ${containerWidth} ${waveHeight} L 0 ${waveHeight} Z`;}}else if(waveShape===\"sound\"){// Sound wave (like an audio waveform)\n// Set starting point based on fill position\nif(fillPosition===\"top\"){// Start at top-left for top fill\npath=`M 0 0 L ${containerWidth} 0 L ${containerWidth} ${waveHeight/2} `;// Create each wave segment\nfor(let i=0;i<containerWidth;i+=actualWaveWidth/10){// Calculate wave height at this point (using sine function for smoothness)\nconst amplitude=waveHeight/2*(curviness/100);const y=waveHeight/2+amplitude*Math.sin(i/actualWaveWidth*Math.PI*2*waveCount);// Add point to path\npath+=`L ${containerWidth-i} ${y} `;}// Complete the path\npath+=`L 0 ${waveHeight/2} Z`;}else{// Start at bottom-left for bottom fill\npath=`M 0 ${waveHeight/2} `;// Create each wave segment\nfor(let i=0;i<containerWidth;i+=actualWaveWidth/10){// Calculate wave height at this point (using sine function for smoothness)\nconst amplitude=waveHeight/2*(curviness/100);const y=waveHeight/2+amplitude*Math.sin(i/actualWaveWidth*Math.PI*2*waveCount);// Add point to path\npath+=`L ${i} ${y} `;}// Complete the path\npath+=`L ${containerWidth} ${waveHeight/2} L ${containerWidth} ${waveHeight} L 0 ${waveHeight} Z`;}}return path;};// Position style based on top or bottom placement\nconst positionStyle=position===\"top\"?{top:0,left:0}:{bottom:0,left:0};return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{position:\"absolute\",width:\"100%\",height:waveHeight,...positionStyle,overflow:\"visible\",pointerEvents:\"none\"},children:/*#__PURE__*/_jsx(\"svg\",{width:\"100%\",height:waveHeight,viewBox:`0 0 ${containerWidth} ${waveHeight}`,preserveAspectRatio:\"none\",xmlns:\"http://www.w3.org/2000/svg\",children:/*#__PURE__*/_jsx(\"path\",{d:generateWavePath(),fill:waveColor})})});}// Default properties\nSmoothSVGWave.defaultProps={waveColor:\"#3182CE\",waveCount:6,waveHeight:84,waveWidth:200,curviness:80,position:\"top\",fillPosition:\"top\",waveShape:\"sine\"};// Property controls for Framer\naddPropertyControls(SmoothSVGWave,{// Wave appearance\nwaveColor:{type:ControlType.Color,title:\"Wave Color\",defaultValue:\"#3182CE\"},waveShape:{type:ControlType.Enum,title:\"Wave Shape\",defaultValue:\"sine\",options:[\"sine\",\"sound\"],optionTitles:[\"Sine Wave\",\"Sound Wave\"]},waveCount:{type:ControlType.Number,title:\"Wave Count\",defaultValue:6,min:1,max:20,step:1,displayStepper:true},waveHeight:{type:ControlType.Number,title:\"Wave Height\",defaultValue:84,min:10,max:500,step:1},waveWidth:{type:ControlType.Number,title:\"Wave Width\",defaultValue:200,min:50,max:1e3,step:10,displayStepper:true},curviness:{type:ControlType.Number,title:\"Curviness\",defaultValue:80,min:0,max:100,step:5},// Positioning\nposition:{type:ControlType.Enum,title:\"Position\",defaultValue:\"top\",options:[\"top\",\"bottom\"],optionTitles:[\"Top\",\"Bottom\"]},fillPosition:{type:ControlType.Enum,title:\"Fill Position\",defaultValue:\"top\",options:[\"top\",\"bottom\"],optionTitles:[\"Top\",\"Bottom\"]}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SmoothSVGWave\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}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