| class CustomNavbar extends HTMLElement { | |
| connectedCallback() { | |
| this.attachShadow({ mode: 'open' }); | |
| this.shadowRoot.innerHTML = ` | |
| <style> | |
| nav { | |
| background: rgba(255, 255, 255, 0.9); | |
| backdrop-filter: blur(4px); | |
| padding: 0.75rem 2rem; | |
| display: flex; | |
| justify-content: space-between; | |
| align-items: center; | |
| border-bottom: 1px solid #e2e8f0; | |
| position: relative; | |
| z-index: 50; | |
| } | |
| .logo { | |
| color: #2b6cb0; | |
| font-weight: bold; | |
| font-size: 1.25rem; | |
| display: flex; | |
| align-items: center; | |
| gap: 0.5rem; | |
| } | |
| .logo-icon { | |
| width: 20px; | |
| height: 20px; | |
| color: #4299e1; | |
| } | |
| ul { | |
| display: flex; | |
| gap: 1rem; | |
| list-style: none; | |
| margin: 0; | |
| padding: 0; | |
| } | |
| a { | |
| color: #1a365d; | |
| text-decoration: none; | |
| transition: all 0.2s; | |
| font-weight: 600; | |
| display: flex; | |
| align-items: center; | |
| gap: 0.5rem; | |
| padding: 0.5rem 1rem; | |
| border-radius: 0.5rem; | |
| } | |
| a:hover { | |
| background: #ebf8ff; | |
| color: #2b6cb0; | |
| } | |
| .active { | |
| background: #ebf8ff; | |
| color: #2b6cb0; | |
| } | |
| @media (max-width: 768px) { | |
| nav { | |
| flex-direction: column; | |
| gap: 1rem; | |
| padding: 1rem; | |
| } | |
| ul { | |
| width: 100%; | |
| justify-content: space-around; | |
| } | |
| } | |
| </style> | |
| <nav> | |
| <a href="/" class="logo"> | |
| <i data-feather="pen-tool" class="logo-icon"></i> | |
| <span>Staff Portal</span> | |
| </a> | |
| <ul> | |
| <li><a href="/" class="active"><i data-feather="home"></i> Dashboard</a></li> | |
| <li><a href="/tasks"><i data-feather="check-square"></i> Tasks</a></li> | |
| <li><a href="/messages"><i data-feather="mail"></i> Messages</a></li> | |
| <li><a href="/team"><i data-feather="users"></i> Team</a></li> | |
| <li><a href="/calendar"><i data-feather="calendar"></i> Calendar</a></li> | |
| </ul> | |
| </nav> | |
| `; | |
| } | |
| } | |
| customElements.define('custom-navbar', CustomNavbar); |