class CustomHeader extends HTMLElement {
constructor() {
super();
}
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
`;
// Add event listener for mobile menu
this.shadowRoot.getElementById('mobileMenuBtn').addEventListener('click', () => {
const menu = this.shadowRoot.getElementById('mobileMenu');
menu.classList.toggle('active');
});
// Replace feather icons after component is attached
if (window.feather) {
window.feather.replace();
} else {
window.addEventListener('feather-icons-loaded', () => {
window.feather.replace();
});
}
}
}
customElements.define('custom-header', CustomHeader);