class CustomHeader extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
`;
// Add mobile menu toggle functionality
setTimeout(() => {
const menuButton = this.shadowRoot.getElementById('mobile-menu-button');
const mobileMenu = this.shadowRoot.getElementById('mobile-menu');
if (menuButton && mobileMenu) {
menuButton.addEventListener('click', () => {
const isExpanded = menuButton.getAttribute('aria-expanded') === 'true';
menuButton.setAttribute('aria-expanded', !isExpanded);
mobileMenu.classList.toggle('hidden');
// Toggle feather icons
const menuIcon = menuButton.querySelector('i');
if (menuIcon) {
menuIcon.setAttribute('data-feather', isExpanded ? 'menu' : 'x');
feather.replace();
}
});
}
}, 0);
}
}
customElements.define('custom-header', CustomHeader);