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