File size: 652 Bytes
c4a1e1a f4ebebf c4a1e1a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | class CustomNavbar extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
.navbar {
transition: background-color 0.3s ease;
}
.nav-link:hover {
color: #6366f1;
}
</style>
<nav class="navbar bg-white shadow-sm py-4 px-6">
<div class="container mx-auto flex justify-between items-center">
<div class="flex items-center">
<i data-feather="book" class="w-6 h-6 text-indigo-600 mr-2"></i>
</div>
</div>
</nav>
`;
}
}
customElements.define('custom-navbar', CustomNavbar); |