class CustomNavbar extends HTMLElement { connectedCallback() { this.attachShadow({ mode: 'open' }); this.shadowRoot.innerHTML = ` `; // Mobile menu toggle this.shadowRoot.getElementById('mobile-menu-button').addEventListener('click', () => { const menu = this.shadowRoot.getElementById('mobile-menu'); menu.classList.toggle('hidden'); const icon = this.shadowRoot.querySelector('#mobile-menu-button i'); if (menu.classList.contains('hidden')) { icon.setAttribute('data-feather', 'menu'); } else { icon.setAttribute('data-feather', 'x'); } feather.replace(); }); } } customElements.define('custom-navbar', CustomNavbar);