| class CustomNavbar extends HTMLElement { | |
| connectedCallback() { | |
| this.attachShadow({ mode: 'open' }); | |
| this.shadowRoot.innerHTML = ` | |
| <style> | |
| :host { | |
| display: block; | |
| width: 100%; | |
| background-color: #1a1a1a; | |
| padding: 1rem 0; | |
| box-shadow: 0 2px 10px rgba(0,0,0,0.3); | |
| position: sticky; | |
| top: 0; | |
| z-index: 100; | |
| } | |
| .navbar-container { | |
| display: flex; | |
| justify-content: space-between; | |
| align-items: center; | |
| max-width: 1200px; | |
| margin: 0 auto; | |
| padding: 0 1rem; | |
| } | |
| .logo { | |
| font-size: 1.5rem; | |
| font-weight: bold; | |
| color: #f0f0f0; | |
| text-decoration: none; | |
| display: flex; | |
| align-items: center; | |
| gap: 0.5rem; | |
| } | |
| .nav-links { | |
| display: flex; | |
| gap: 1.5rem; | |
| } | |
| .nav-link { | |
| color: #ccc; | |
| text-decoration: none; | |
| transition: color 0.2s; | |
| } | |
| .nav-link:hover { | |
| color: #fff; | |
| } | |
| .active { | |
| color: #fff; | |
| font-weight: bold; | |
| } | |
| </style> | |
| <div class="navbar-container"> | |
| <a href="index.html" class="logo">Unify</a> | |
| <div class="nav-links"> | |
| <a href="lost-found.html" class="nav-link">Lost & Found</a> | |
| <a href="events.html" class="nav-link">Events</a> | |
| <a href="news.html" class="nav-link">News</a> | |
| <a href="timetables.html" class="nav-link">Timetables</a> | |
| <a href="profile.html" class="nav-link">Profile</a> | |
| <a href="about.html" class="nav-link">About</a> | |
| </div> | |
| </div> | |
| `; | |
| } | |
| } | |
| customElements.define('custom-navbar', CustomNavbar); |