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