class CustomHeader extends HTMLElement { connectedCallback() { this.attachShadow({ mode: 'open' }); this.shadowRoot.innerHTML = `
`; // Initialize feather icons const initIcons = () => { if (typeof feather !== 'undefined') { feather.replace(); } else { setTimeout(initIcons, 100); } }; initIcons(); // Mobile menu toggle const mobileMenuButton = this.shadowRoot.getElementById('mobileMenuButton'); const navLinks = this.shadowRoot.getElementById('navLinks'); mobileMenuButton.addEventListener('click', () => { navLinks.classList.toggle('active'); const menuIcon = mobileMenuButton.querySelector('[data-feather]'); if (navLinks.classList.contains('active')) { menuIcon.setAttribute('data-feather', 'x'); } else { menuIcon.setAttribute('data-feather', 'menu'); } feather.replace(); }); } } customElements.define('custom-header', CustomHeader);