class FloatingParticles extends HTMLElement { connectedCallback() { this.attachShadow({ mode: 'open' }); this.shadowRoot.innerHTML = `
`; this.createParticles(); } createParticles() { const container = this.shadowRoot.getElementById('particles-container'); const particleCount = 15; for (let i = 0; i < particleCount; i++) { const particle = document.createElement('div'); particle.className = 'particle'; // Random properties const left = Math.random() * 100; const delay = Math.random() * 20; const duration = 15 + Math.random() * 10; particle.style.left = `${left}%`; particle.style.animation = `float-particle ${duration}s linear ${delay}s infinite`; container.appendChild(particle); } } } customElements.define('floating-particles', FloatingParticles);