class CustomNavbar extends HTMLElement { connectedCallback() { this.attachShadow({ mode: 'open' }); this.shadowRoot.innerHTML = ` `; // Initialize mobile menu toggle const mobileMenuBtn = this.shadowRoot.getElementById('mobileMenuBtn'); const navLinks = this.shadowRoot.getElementById('navLinks'); mobileMenuBtn.addEventListener('click', () => { navLinks.classList.toggle('active'); }); // Initialize feather icons const featherScript = document.createElement('script'); featherScript.src = 'https://unpkg.com/feather-icons'; this.shadowRoot.appendChild(featherScript); featherScript.onload = () => { feather.replace(); }; } } customElements.define('custom-navbar', CustomNavbar);