{"version":3,"file":"Test_grid_1.DuDWrCvw.mjs","names":["useState","useMemo"],"sources":["https:/framerusercontent.com/modules/4a56Ph9OC3vwfQiFUJ9b/P1sKFziIOCaoHo2IQnJx/O0qRIEfGI.js","https:/framerusercontent.com/modules/MbxnH8HzKagsHjF5Jr2z/ySPm72mwiZsF1k98IAJ4/Test_grid_1.js"],"sourcesContent":["// Generated by Framer (98479f1)\nimport{fontStore}from\"framer\";fontStore.loadFonts([]);export const fonts=[{explicitInter:true,fonts:[]}];export const css=['.framer-lxtoU .framer-styles-preset-1htquvy:not(.rich-text-wrapper), .framer-lxtoU .framer-styles-preset-1htquvy.rich-text-wrapper a { --framer-link-current-text-color: #111111; --framer-link-current-text-decoration: underline; --framer-link-hover-text-color: var(--token-a6d501c8-613c-4a05-884d-7858416851f8, #7a005e) /* {\"name\":\"Hover dark pink\"} */; --framer-link-hover-text-decoration: underline; --framer-link-text-color: var(--token-e5f74f00-66f7-48e8-9d11-db5b6075915e, #ff4dc1); --framer-link-text-decoration: none; }'];export const className=\"framer-lxtoU\";\nexport const __FramerMetadata__ = {\"exports\":{\"fonts\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"css\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"className\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect,useMemo}from\"react\";export function FlowingGrid(){const gridSize=25;const canvasSize=1e3;const viewSize=800;const scale=.6;const[time,setTime]=useState(0);// Animation loop\nuseEffect(()=>{let animationId;const animate=timestamp=>{setTime(timestamp*5e-4);animationId=requestAnimationFrame(animate);};animationId=requestAnimationFrame(animate);return()=>cancelAnimationFrame(animationId);},[]);// Force component update\nuseEffect(()=>{setTime(0);},[]);// Calculate 3D transformed point with perspective projection\nconst getTransformedPoint=(i,j)=>{const centerOffset=(1-scale)/2;const baseX=(i/gridSize*scale+centerOffset)*canvasSize;const baseY=(j/gridSize*scale+centerOffset)*canvasSize;// Normalize coordinates to center around 0 (-1 to 1 range)\nconst centerX=gridSize/2;const centerY=gridSize/2;const normalizedX=(i-centerX)/(gridSize/2);const normalizedY=(j-centerY)/(gridSize/2);const distance=Math.sqrt(normalizedX**2+normalizedY**2);// Flowing wave calculations\nconst waveX=Math.sin(normalizedX*5+time*1.5)*12+Math.sin(normalizedY*4+time*2.2)*7+Math.sin((normalizedX+normalizedY)*3+time*.8)*5;const waveY=Math.cos(normalizedY*6+time*1.8)*15+Math.sin(normalizedX*4.5+time*1.3)*9+Math.cos((normalizedX-normalizedY)*3.5+time*1.1)*6;const waveZ=Math.sin(distance*4-time*3)*25+Math.cos(normalizedX*3.5+time*2.5)*15+Math.sin(normalizedY*4.2+time*1.8)*12;// Perspective projection\nconst focalLength=800;const viewerDistance=1e3;const perspectiveScale=focalLength/(viewerDistance-waveZ);return{x:(baseX+waveX)*perspectiveScale,y:(baseY+waveY)*perspectiveScale,depth:Math.max(.3,Math.min(1.2,(viewerDistance-waveZ)/viewerDistance))};};// Generate line paths with depth-based styling\nconst generatePaths=isHorizontal=>{const paths=[];const outerSize=isHorizontal?gridSize:gridSize;const innerSize=isHorizontal?gridSize:gridSize;for(let outer=0;outer<=outerSize;outer++){let pathData=\"\";let avgDepth=0;for(let inner=0;inner<=innerSize;inner++){const[i,j]=isHorizontal?[inner,outer]:[outer,inner];const point=getTransformedPoint(i,j);avgDepth+=point.depth;pathData+=`${inner===0?\"M\":\"L\"} ${point.x.toFixed(2)} ${point.y.toFixed(2)} `;}paths.push({pathData,depth:avgDepth/(innerSize+1)});}return paths;};// Calculate dynamic bounds for tight framing\nconst calculateBounds=()=>{let minX=Infinity,maxX=-Infinity,minY=Infinity,maxY=-Infinity;for(let i=0;i<=gridSize;i++){for(let j=0;j<=gridSize;j++){const point=getTransformedPoint(i,j);minX=Math.min(minX,point.x);maxX=Math.max(maxX,point.x);minY=Math.min(minY,point.y);maxY=Math.max(maxY,point.y);}}// Add small padding for stroke width and visual breathing room\nconst padding=20;return{minX:minX-padding,minY:minY-padding,width:maxX-minX+2*padding,height:maxY-minY+2*padding};};const bounds=useMemo(()=>calculateBounds(),[time]);const horizontalPaths=useMemo(()=>generatePaths(true),[time]);const verticalPaths=useMemo(()=>generatePaths(false),[time]);const renderLines=(paths,isHorizontal)=>{const baseOpacity=isHorizontal?.8:.7;const minOpacity=isHorizontal?.2:.15;const maxOpacity=isHorizontal?.95:.8;const minStroke=isHorizontal?1.5:1.2;const maxStroke=isHorizontal?3.6:3;const depthMultiplier=isHorizontal?2.1:1.8;return paths.map((line,index)=>({...line,index})).sort((a,b)=>a.depth-b.depth).map(({pathData,depth,index})=>{const opacity=Math.max(minOpacity,Math.min(maxOpacity,depth*baseOpacity));const strokeWidth=Math.max(minStroke,Math.min(maxStroke,depth*depthMultiplier));return /*#__PURE__*/_jsx(\"path\",{d:pathData,stroke:`rgba(255, 255, 255, ${opacity})`,strokeWidth:strokeWidth,fill:\"none\"},`${isHorizontal?\"h\":\"v\"}-${index}`);});};return /*#__PURE__*/_jsx(\"div\",{className:\"size-full flex items-center justify-center overflow-hidden\",children:/*#__PURE__*/_jsxs(\"svg\",{width:\"100%\",height:\"100%\",viewBox:`${bounds.minX} ${bounds.minY} ${bounds.width} ${bounds.height}`,className:\"max-w-full max-h-full\",preserveAspectRatio:\"xMidYMid meet\",children:[renderLines(horizontalPaths,true),renderLines(verticalPaths,false)]})});}\nexport const __FramerMetadata__ = {\"exports\":{\"FlowingGrid\":{\"type\":\"reactComponent\",\"name\":\"FlowingGrid\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Test_grid_1.map"],"mappings":"qRAC8B,GAAU,UAAU,EAAE,CAAC,CAAc,EAAM,CAAC,CAAC,cAAc,GAAK,MAAM,EAAE,CAAC,CAAC,CAAc,EA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