{"version":3,"file":"ParticleBackground.TChLM3TO.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/gMdPtmRiz7dXNUYq26K8/vfDmgvdu9g01yhPiu6Zs/ParticleBackground.js"],"sourcesContent":["// GENERATE A DYNAMIC PARTICLE BACKGROUND THAT EMULATES A DEEP SPACE-LIKE ENVIRONMENT\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{useInView}from\"framer-motion\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function ParticleBackground(props){const{particleCount=125,glowIntensity=.8,driftSpeed=.3,pulseIntensity=.1}=props;const canvasRef=useRef(null);const animationRef=useRef();const particlesRef=useRef([]);const timeRef=useRef(0);const isStatic=useIsStaticRenderer();const isInView=useInView(canvasRef);// Deep space color palette\nconst colors={background:\"#0A0D2C\",particles:[\"#3B82F6\",\"#60A5FA\",\"#93C5FD\",\"#1E40AF\",\"#FFFFFF\"]};// Initialize particles with depth layers\nconst initializeParticles=(width,height)=>{const particles=[];for(let i=0;i<particleCount;i++){const layer=Math.random()<.8?Math.random():1// 80% background, 20% foreground\n;const isWhiteDot=Math.random()<.3// 30% chance for white dots\n;const colorIndex=isWhiteDot?4:Math.floor(Math.random()*4);particles.push({x:Math.random()*width,y:Math.random()*height,vx:(Math.random()-.5)*driftSpeed*(.5+layer*.5),vy:(Math.random()-.5)*driftSpeed*(.5+layer*.5),size:isWhiteDot?1+Math.random():(4+Math.random()*2)*(.5+layer*.5),opacity:.3+Math.random()*.4,color:colors.particles[colorIndex],layer:layer,pulsePhase:Math.random()*Math.PI*2,pulseSpeed:.02+Math.random()*.01});}particlesRef.current=particles;};// Update particle positions with parallax effect\nconst updateParticles=(width,height,deltaTime)=>{particlesRef.current.forEach(particle=>{// Slow drift movement\nparticle.x+=particle.vx;particle.y+=particle.vy;// Wrap around edges for seamless movement\nif(particle.x<-particle.size)particle.x=width+particle.size;if(particle.x>width+particle.size)particle.x=-particle.size;if(particle.y<-particle.size)particle.y=height+particle.size;if(particle.y>height+particle.size)particle.y=-particle.size;// Update pulse phase\nparticle.pulsePhase+=particle.pulseSpeed;});};// Draw particles with glow effects\nconst draw=(ctx,width,height,time)=>{// Clear canvas with deep space background\nctx.fillStyle=colors.background;ctx.fillRect(0,0,width,height);const particles=particlesRef.current;// Sort particles by layer for proper depth rendering\nconst sortedParticles=[...particles].sort((a,b)=>a.layer-b.layer);// Draw particles with glow and breathing animation\nsortedParticles.forEach(particle=>{const pulseScale=.95+pulseIntensity*Math.sin(particle.pulsePhase);const currentSize=particle.size*pulseScale;const glowSize=currentSize*(2+glowIntensity);// Create glow effect\nconst gradient=ctx.createRadialGradient(particle.x,particle.y,0,particle.x,particle.y,glowSize);const rgb=hexToRgb(particle.color);gradient.addColorStop(0,`rgba(${rgb}, ${particle.opacity})`);gradient.addColorStop(.3,`rgba(${rgb}, ${particle.opacity*.6})`);gradient.addColorStop(1,`rgba(${rgb}, 0)`);// Draw glow\nctx.fillStyle=gradient;ctx.beginPath();ctx.arc(particle.x,particle.y,glowSize,0,Math.PI*2);ctx.fill();// Draw core particle\nctx.fillStyle=`rgba(${rgb}, ${particle.opacity})`;ctx.beginPath();ctx.arc(particle.x,particle.y,currentSize,0,Math.PI*2);ctx.fill();});};// Animation loop\nconst animate=currentTime=>{const canvas=canvasRef.current;if(!canvas)return;const ctx=canvas.getContext(\"2d\");if(!ctx)return;const{width,height}=canvas;const deltaTime=currentTime-timeRef.current;timeRef.current=currentTime;updateParticles(width,height,deltaTime);draw(ctx,width,height,currentTime);if(isInView&&!isStatic){animationRef.current=requestAnimationFrame(animate);}};// Setup canvas and start animation\nuseEffect(()=>{if(isStatic)return;const canvas=canvasRef.current;if(!canvas)return;const ctx=canvas.getContext(\"2d\");if(!ctx)return;// Set canvas size\nconst updateCanvasSize=()=>{const rect=canvas.getBoundingClientRect();canvas.width=rect.width;canvas.height=rect.height;initializeParticles(rect.width,rect.height);};updateCanvasSize();// Start animation if in view\nif(isInView){timeRef.current=performance.now();animate(timeRef.current);}// Handle resize\nconst handleResize=()=>{updateCanvasSize();};if(typeof window!==\"undefined\"){window.addEventListener(\"resize\",handleResize);return()=>{window.removeEventListener(\"resize\",handleResize);if(animationRef.current){cancelAnimationFrame(animationRef.current);}};}},[isStatic,isInView,particleCount,glowIntensity,driftSpeed,pulseIntensity]);// Static preview for non-interactive environments\nif(isStatic){return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",backgroundColor:colors.background,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",position:\"relative\",overflow:\"hidden\"},children:Array.from({length:Math.min(particleCount,30)}).map((_,i)=>{const isWhite=Math.random()<.3;const colorIndex=isWhite?4:Math.floor(Math.random()*4);const size=isWhite?1+Math.random():4+Math.random()*2;return /*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",width:size*2,height:size*2,backgroundColor:colors.particles[colorIndex],borderRadius:\"50%\",left:`${Math.random()*100}%`,top:`${Math.random()*100}%`,opacity:.3+Math.random()*.4,boxShadow:`0 0 ${size*4}px ${colors.particles[colorIndex]}`}},i);})});}return /*#__PURE__*/_jsx(\"canvas\",{ref:canvasRef,style:{width:\"100%\",height:\"100%\",display:\"block\",backgroundColor:colors.background}});}// Helper function to convert hex to RGB\nfunction hexToRgb(hex){const result=/^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);if(result){const r=parseInt(result[1],16);const g=parseInt(result[2],16);const b=parseInt(result[3],16);return`${r}, ${g}, ${b}`;}return\"255, 255, 255\";}addPropertyControls(ParticleBackground,{particleCount:{type:ControlType.Number,title:\"Particle Density\",defaultValue:125,min:50,max:200,step:5},glowIntensity:{type:ControlType.Number,title:\"Glow Intensity\",defaultValue:.8,min:.2,max:2,step:.1},driftSpeed:{type:ControlType.Number,title:\"Drift Speed\",defaultValue:.3,min:.1,max:1,step:.1},pulseIntensity:{type:ControlType.Number,title:\"Pulse Intensity\",defaultValue:.1,min:0,max:.3,step:.05}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ParticleBackground\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerSupportedLayoutWidth\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ParticleBackground.map"],"mappings":"mPAIG,SAAwB,EAAmB,EAAM,CAAC,GAAK,CAAC,gBAAc,IAAI,gBAAc,GAAG,aAAW,GAAG,iBAAe,IAAI,EAAY,EAAUA,EAAO,KAAK,CAAO,EAAaA,GAAQ,CAAO,EAAaA,EAAO,EAAE,CAAC,CAAO,EAAQA,EAAO,EAAE,CAAO,EAAS,GAAqB,CAAO,EAAS,EAAU,EAAU,CACtT,EAAO,CAAC,WAAW,UAAU,UAAU,CAAC,UAAU,UAAU,UAAU,UAAU,UAAU,CAAC,CAC3F,GAAqB,EAAM,IAAS,CAAC,IAAM,EAAU,EAAE,CAAC,IAAI,IAAI,EAAE,EAAE,EAAE,EAAc,IAAI,CAAC,IAAM,EAAM,KAAK,QAAQ,CAAC,GAAG,KAAK,QAAQ,CAAC,EACnI,EAAW,KAAK,QAAQ,CAAC,GACzB,EAAW,EAAW,EAAE,KAAK,MAAM,KAAK,QAAQ,CAAC,EAAE,CAAC,EAAU,KAAK,CAAC,EAAE,KAAK,QAAQ,CAAC,EAAM,EAAE,KAAK,QAAQ,CAAC,EAAO,IAAI,KAAK,QAAQ,CAAC,IAAI,GAAY,GAAG,EAAM,IAAI,IAAI,KAAK,QAAQ,CAAC,IAAI,GAAY,GAAG,EAAM,IAAI,KAAK,EAAW,EAAE,KAAK,QAAQ,EAAE,EAAE,KAAK,QAAQ,CAAC,IAAI,GAAG,EAAM,IAAI,QAAQ,GAAG,KAAK,QAAQ,CAAC,GAAG,MAAM,EAAO,UAAU,GAAkB,QAAM,WAAW,KAAK,Q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