{"version":3,"file":"Particles_1.C2upQZPu.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/kCCpUbIpYv5yTjH6M5zK/X2ofpC7owCWBQ3cXy8FK/Particles_1.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";export default function ParticlesComponent(){const canvasRef=useRef(null);const animationRef=useRef(null);const particlesRef=useRef([]);const config={particleCount:80,speed:.3,minSize:.4,maxSize:1.2};useEffect(()=>{const canvas=canvasRef.current;if(!canvas)return;const ctx=canvas.getContext(\"2d\");// Ajustement dynamique du canvas\nconst resizeCanvas=()=>{canvas.width=canvas.offsetWidth;canvas.height=canvas.offsetHeight;};resizeCanvas();window.addEventListener(\"resize\",resizeCanvas);// Classe Particule\nclass Particle{update(){// Mouvement naturel lent\nthis.x+=this.vx*this.depth;this.y+=this.vy*this.depth;// Rebordissement doux\nif(this.x<0||this.x>canvas.width)this.vx*=-1;if(this.y<0||this.y>canvas.height)this.vy*=-1;// Scintillement léger\nthis.twinkle+=this.twinkleSpeed;this.opacity=this.baseOpacity+Math.sin(this.twinkle)*.1;}draw(){const alpha=this.opacity*this.depth;// Halo diffus\nctx.beginPath();ctx.arc(this.x,this.y,this.size*1.5,0,Math.PI*2);ctx.fillStyle=`rgba(255, 255, 255, ${alpha*.2})`;ctx.fill();// Point de poussière\nctx.beginPath();ctx.arc(this.x,this.y,this.size,0,Math.PI*2);ctx.fillStyle=`rgba(255, 255, 255, ${alpha})`;ctx.fill();}constructor(){this.x=Math.random()*canvas.width;this.y=Math.random()*canvas.height;// Vitesses plus larges horizontalement et lentes verticalement\nthis.vx=(Math.random()-.5)*config.speed*2// large plage horizontale\n;this.vy=(Math.random()-.5)*config.speed*.5-.02// léger mouvement ascendant\n;// Taille aléatoire\nthis.size=config.minSize+Math.random()*(config.maxSize-config.minSize);// Opacité aléatoire\nthis.opacity=.2+Math.random()*.6;this.baseOpacity=this.opacity;// Scintillement\nthis.twinkle=Math.random()*Math.PI*2;this.twinkleSpeed=.005+Math.random()*.015;// Profondeur pour effet de perspectives\nthis.depth=.5+Math.random()*.5;}}// Initialisation des particules\nconst initParticles=()=>{particlesRef.current=[];for(let i=0;i<config.particleCount;i++){particlesRef.current.push(new Particle);}};// Boucle d'animation\nconst animate=()=>{ctx.clearRect(0,0,canvas.width,canvas.height);particlesRef.current.forEach(particle=>{particle.update();particle.draw();});animationRef.current=requestAnimationFrame(animate);};// Démarrage\ninitParticles();animate();// Nettoyage\nreturn()=>{window.removeEventListener(\"resize\",resizeCanvas);if(animationRef.current)cancelAnimationFrame(animationRef.current);};},[]);return /*#__PURE__*/_jsx(\"div\",{className:\"w-full h-full\",children:/*#__PURE__*/_jsx(\"canvas\",{ref:canvasRef,className:\"w-full h-full block\",style:{backgroundColor:\"transparent\"}})});}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ParticlesComponent\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Particles_1.map"],"mappings":"kIAA+E,SAAwB,GAAoB,CAAC,IAAM,EAAUA,EAAO,KAAK,CAAO,EAAaA,EAAO,KAAK,CAAO,EAAaA,EAAO,EAAE,CAAC,CAAO,EAAO,CAAC,cAAc,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,IAAI,CAkB9I,OAlB+I,MAAc,CAAC,IAAM,EAAO,EAAU,QAAQ,GAAG,CAAC,EAAO,OAAO,IAAM,EAAI,EAAO,WAAW,KAAK,CAClX,MAAiB,CAAC,EAAO,MAAM,EAAO,YAAY,EAAO,OAAO,EAAO,cAAe,GAAc,CAAC,EAAO,iBAAiB,SAAS,EAAa,CACzJ,MAAM,CAAQ,CAAC,QAAQ,CACvB,KAAK,GAAG,KAAK,GAAG,KAAK,MAAM,KAAK,GAAG,KAAK,GAAG,KAAK,OAC7C,KAAK,EAAE,GAAG,KAAK,EAAE,EAAO,SAAM,K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