class BackgroundClouds extends HTMLElement { constructor() { super(); this.attachShadow({ mode: 'open' }); } connectedCallback() { this.shadowRoot.innerHTML = `
`; this.createClouds(); } createClouds() { const container = this.shadowRoot.getElementById('clouds-container'); const width = window.innerWidth; const height = window.innerHeight; for (let i = 0; i < 20; i++) { const cloud = document.createElement('div'); const size = Math.random() * 150 + 50; const opacity = Math.random() * 0.5 + 0.1; const left = Math.random() * width; const top = Math.random() * height; const duration = Math.random() * 30 + 30; cloud.className = 'bg-cloud'; cloud.style.width = `${size}px`; cloud.style.height = `${size * 0.6}px`; cloud.style.left = `${left}px`; cloud.style.top = `${top}px`; cloud.style.opacity = opacity; cloud.style.animationDuration = `${duration}s`; cloud.style.animationDelay = `${Math.random() * 20}s`; container.appendChild(cloud); } } } customElements.define('background-clouds', BackgroundClouds);