class CustomNavbar extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
`;
// Mobile menu toggle functionality
const mobileBtn = this.shadowRoot.querySelector('.mobile-menu-btn');
const navLinks = this.shadowRoot.querySelector('.nav-links');
mobileBtn.addEventListener('click', () => {
navLinks.classList.toggle('show');
const icon = mobileBtn.querySelector('i');
if (navLinks.classList.contains('show')) {
icon.setAttribute('data-feather', 'x');
} else {
icon.setAttribute('data-feather', 'menu');
}
feather.replace();
});
}
}
customElements.define('custom-navbar', CustomNavbar);