class CustomHeader extends HTMLElement { connectedCallback() { this.attachShadow({ mode: 'open' }); this.shadowRoot.innerHTML = `
`; // Mobile menu toggle const menuToggle = this.shadowRoot.getElementById('menu-toggle'); const navLinks = this.shadowRoot.getElementById('nav-links'); menuToggle.addEventListener('click', () => { navLinks.classList.toggle('active'); const menuIcon = menuToggle.querySelector('i'); if (navLinks.classList.contains('active')) { menuIcon.setAttribute('data-feather', 'x'); } else { menuIcon.setAttribute('data-feather', 'menu'); } feather.replace(); }); } } customElements.define('custom-header', CustomHeader);