| class CustomNavbar extends HTMLElement { | |
| connectedCallback() { | |
| this.attachShadow({ mode: 'open' }); | |
| this.shadowRoot.innerHTML = ` | |
| <style> | |
| nav { | |
| background-color: #ffffff; | |
| box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); | |
| padding: 1rem; | |
| } | |
| .container { | |
| display: flex; | |
| justify-content: space-between; | |
| align-items: center; | |
| max-width: 1200px; | |
| margin: 0 auto; | |
| } | |
| .logo { | |
| font-weight: bold; | |
| font-size: 1.25rem; | |
| color: #1e40af; | |
| } | |
| .nav-links { | |
| display: flex; | |
| gap: 1.5rem; | |
| } | |
| .nav-link { | |
| color: #4b5563; | |
| text-decoration: none; | |
| font-weight: 500; | |
| } | |
| .nav-link:hover { | |
| color: #1e40af; | |
| } | |
| @media (max-width: 640px) { | |
| .nav-links { | |
| gap: 1rem; | |
| } | |
| } | |
| </style> | |
| <nav> | |
| <div class="container"> | |
| <div class="logo">TouchTask</div> | |
| <div class="nav-links"> | |
| <a href="#" class="nav-link"><i data-feather="home"></i></a> | |
| <a href="#" class="nav-link"><i data-feather="calendar"></i></a> | |
| <a href="#" class="nav-link"><i data-feather="settings"></i></a> | |
| </div> | |
| </div> | |
| </nav> | |
| `; | |
| } | |
| } | |
| customElements.define('custom-navbar', CustomNavbar); |