class CustomNavbar extends HTMLElement {
constructor() {
super();
this.attachShadow({ mode: 'open' });
}
connectedCallback() {
this.shadowRoot.innerHTML = `
`;
// Add scroll effect
window.addEventListener('scroll', () => {
const navbar = this.shadowRoot.querySelector('.navbar');
if (window.scrollY > 50) {
navbar.classList.add('scrolled');
} else {
navbar.classList.remove('scrolled');
}
});
// Replace feather icons
feather.replace({ 'stroke-width': 2 });
}
}
customElements.define('custom-navbar', CustomNavbar);