{"version":3,"file":"WaveGrid_7.CwoqyIIa.mjs","names":["useRef","sampleZ"],"sources":["https:/framerusercontent.com/modules/zABLoollxQq7jSGcg2lx/q6lMCWmTFr6joxEPL1WD/WaveGrid_7.js"],"sourcesContent":["// Animated 3D perspective wave grid component for dark hero background\n// Tilted flat plane grid viewed from above at an angle with sine wave ripple effect\n// Canvas-based with perspective projection and depth-based fading\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function WaveGrid(props){const{lineColor=\"#b0b0c0\",lineOpacity=1,dotColor=\"#b0b0c0\",dotOpacity=1,dotSize=2,gridSpacing=38,perspectiveValue=560,tiltAngle=.72,animationSpeed=.012,waveAmplitude=1,fadeOpacity=.7,backgroundColor=\"#000000\"}=props;const canvasRef=useRef(null);const animationRef=useRef();const timeRef=useRef(0);useEffect(()=>{const canvas=canvasRef.current;if(!canvas)return;const ctx=canvas.getContext(\"2d\");if(!ctx)return;let width=canvas.width;let height=canvas.height;const resize=()=>{const dpr=window.devicePixelRatio||1;const rect=canvas.getBoundingClientRect();width=rect.width;height=rect.height;canvas.width=width*dpr;canvas.height=height*dpr;ctx.scale(dpr,dpr);};resize();const project=(x,y,z)=>{const cosAngle=Math.cos(tiltAngle);const sinAngle=Math.sin(tiltAngle);const rotatedY=y*cosAngle-z*sinAngle;const rotatedZ=y*sinAngle+z*cosAngle;const scale=perspectiveValue/(perspectiveValue+rotatedZ);return{x:x*scale+width/2,y:rotatedY*scale+height/2,scale:scale,z:rotatedZ};};const getWaveHeight=(x,z,t)=>{const distance=Math.sqrt(x*x+z*z);const wave=Math.sin(distance*.009-t*1.2)*28*waveAmplitude+Math.sin(x*.012+t*.7)*14*waveAmplitude+Math.sin(z*.016-t*.9)*10*waveAmplitude;return wave;};const getAlpha=z=>{const maxZ=800;const alpha=Math.max(0,Math.min(1,1-z/maxZ));return alpha;};const applyColorWithAlpha=(color,baseOpacity,alpha)=>{// Parse the color and apply alpha combined with baseOpacity\nconst finalAlpha=alpha*baseOpacity;const colorStr=color.trim();// Handle hex colors\nif(colorStr.startsWith(\"#\")){const hex=colorStr.replace(\"#\",\"\");const r=parseInt(hex.substring(0,2),16);const g=parseInt(hex.substring(2,4),16);const b=parseInt(hex.substring(4,6),16);return`rgba(${r}, ${g}, ${b}, ${finalAlpha})`;}// Handle rgb/rgba colors\nif(colorStr.startsWith(\"rgb\")){const match=colorStr.match(/\\d+\\.?\\d*/g);if(match&&match.length>=3){return`rgba(${match[0]}, ${match[1]}, ${match[2]}, ${finalAlpha})`;}}// Handle hsl/hsla colors\nif(colorStr.startsWith(\"hsl\")){// For HSL, we'll convert to a temp canvas to get RGB\nif(typeof document!==\"undefined\"){const tempCtx=document.createElement(\"canvas\").getContext(\"2d\");if(tempCtx){tempCtx.fillStyle=colorStr;const computedColor=tempCtx.fillStyle;if(computedColor.startsWith(\"#\")){const hex=computedColor.replace(\"#\",\"\");const r=parseInt(hex.substring(0,2),16);const g=parseInt(hex.substring(2,4),16);const b=parseInt(hex.substring(4,6),16);return`rgba(${r}, ${g}, ${b}, ${finalAlpha})`;}}}}// Fallback: default gray color\nreturn`rgba(176, 176, 192, ${finalAlpha})`;};const animate=()=>{ctx.clearRect(0,0,width,height);const gridSize=30;const centerX=0;const centerZ=200;timeRef.current+=animationSpeed;// Draw horizontal lines\nfor(let i=-gridSize;i<=gridSize;i++){ctx.beginPath();let firstPoint=true;for(let j=-gridSize;j<=gridSize;j++){const x=j*gridSpacing;const z=i*gridSpacing+centerZ;const y=getWaveHeight(x,z,timeRef.current);const projected=project(x,y,z);if(projected.z<-perspectiveValue)continue;if(firstPoint){ctx.moveTo(projected.x,projected.y);firstPoint=false;}else{ctx.lineTo(projected.x,projected.y);}}const sampleZ=i*gridSpacing+centerZ;const alpha=getAlpha(sampleZ);ctx.strokeStyle=applyColorWithAlpha(lineColor,lineOpacity,alpha);ctx.lineWidth=1;ctx.stroke();}// Draw vertical lines\nfor(let j=-gridSize;j<=gridSize;j++){ctx.beginPath();let firstPoint=true;for(let i=-gridSize;i<=gridSize;i++){const x=j*gridSpacing;const z=i*gridSpacing+centerZ;const y=getWaveHeight(x,z,timeRef.current);const projected=project(x,y,z);if(projected.z<-perspectiveValue)continue;if(firstPoint){ctx.moveTo(projected.x,projected.y);firstPoint=false;}else{ctx.lineTo(projected.x,projected.y);}}const sampleZ=centerZ;const alpha=getAlpha(sampleZ);ctx.strokeStyle=applyColorWithAlpha(lineColor,lineOpacity,alpha);ctx.lineWidth=1;ctx.stroke();}// Draw dots at intersections\nfor(let i=-gridSize;i<=gridSize;i++){for(let j=-gridSize;j<=gridSize;j++){const x=j*gridSpacing;const z=i*gridSpacing+centerZ;const y=getWaveHeight(x,z,timeRef.current);const projected=project(x,y,z);if(projected.z<-perspectiveValue)continue;const alpha=getAlpha(z);const dotRadius=dotSize*projected.scale;ctx.beginPath();ctx.arc(projected.x,projected.y,dotRadius,0,Math.PI*2);ctx.fillStyle=applyColorWithAlpha(dotColor,dotOpacity,alpha);ctx.fill();}}animationRef.current=requestAnimationFrame(animate);};animate();window.addEventListener(\"resize\",resize);return()=>{if(animationRef.current){cancelAnimationFrame(animationRef.current);}window.removeEventListener(\"resize\",resize);};},[lineColor,lineOpacity,dotColor,dotOpacity,dotSize,gridSpacing,perspectiveValue,tiltAngle,animationSpeed,waveAmplitude]);return /*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",height:\"100%\",position:\"relative\",overflow:\"hidden\",backgroundColor:backgroundColor,...props.style},children:[/*#__PURE__*/_jsx(\"canvas\",{ref:canvasRef,style:{width:\"100%\",height:\"100%\",display:\"block\"}}),/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:0,left:0,right:0,height:\"30%\",background:`linear-gradient(to bottom, rgba(0,0,0,${fadeOpacity}), transparent)`,pointerEvents:\"none\"}}),/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",bottom:0,left:0,right:0,height:\"30%\",background:`linear-gradient(to top, rgba(0,0,0,${fadeOpacity}), transparent)`,pointerEvents:\"none\"}})]});}addPropertyControls(WaveGrid,{backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#000000\"},lineColor:{type:ControlType.Color,title:\"Line Color\",defaultValue:\"#b0b0c0\"},lineOpacity:{type:ControlType.Number,title:\"Line Opacity\",defaultValue:1,min:0,max:1,step:.1},dotColor:{type:ControlType.Color,title:\"Dot Color\",defaultValue:\"#b0b0c0\"},dotOpacity:{type:ControlType.Number,title:\"Dot Opacity\",defaultValue:1,min:0,max:1,step:.1},dotSize:{type:ControlType.Number,title:\"Dot Size\",defaultValue:2,min:.5,max:10,step:.5},gridSpacing:{type:ControlType.Number,title:\"Grid Spacing\",defaultValue:38,min:20,max:80,step:1},perspectiveValue:{type:ControlType.Number,title:\"Perspective\",defaultValue:560,min:200,max:1e3,step:10},tiltAngle:{type:ControlType.Number,title:\"Tilt Angle\",defaultValue:.72,min:0,max:1.57,step:.01,unit:\"rad\"},animationSpeed:{type:ControlType.Number,title:\"Animation Speed\",defaultValue:.012,min:0,max:.05,step:.001},waveAmplitude:{type:ControlType.Number,title:\"Wave Amplitude\",defaultValue:1,min:0,max:2,step:.1},fadeOpacity:{type:ControlType.Number,title:\"Fade Opacity\",defaultValue:.7,min:0,max:1,step:.1}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"WaveGrid\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./WaveGrid_7.map"],"mappings":"kMAMG,SAAwB,EAAS,EAAM,CAAC,GAAK,CAAC,YAAU,UAAU,cAAY,EAAE,WAAS,UAAU,aAAW,EAAE,UAAQ,EAAE,cAAY,GAAG,mBAAi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