| class CustomNavbar extends HTMLElement { | |
| connectedCallback() { | |
| this.attachShadow({ mode: 'open' }); | |
| this.shadowRoot.innerHTML = ` | |
| <style> | |
| nav { | |
| background: rgba(0, 0, 0, 0.9); | |
| padding: 1rem 2rem; | |
| display: flex; | |
| justify-content: space-between; | |
| align-items: center; | |
| position: fixed; | |
| top: 0; | |
| left: 0; | |
| right: 0; | |
| z-index: 1000; | |
| border-bottom: 2px solid #dc2626; | |
| } | |
| .logo { | |
| color: white; | |
| font-weight: bold; | |
| font-size: 1.5rem; | |
| text-transform: uppercase; | |
| letter-spacing: 2px; | |
| } | |
| .logo span { | |
| color: #dc2626; | |
| } | |
| ul { | |
| display: flex; | |
| gap: 2rem; | |
| list-style: none; | |
| margin: 0; | |
| padding: 0; | |
| } | |
| a { | |
| color: white; | |
| text-decoration: none; | |
| text-transform: uppercase; | |
| font-weight: bold; | |
| letter-spacing: 1px; | |
| position: relative; | |
| padding: 0.5rem 0; | |
| } | |
| a:hover { | |
| color: #dc2626; | |
| } | |
| a.active { | |
| color: #dc2626; | |
| } | |
| a.active::after { | |
| content: ''; | |
| position: absolute; | |
| bottom: 0; | |
| left: 0; | |
| width: 100%; | |
| height: 2px; | |
| background: #dc2626; | |
| } | |
| .mobile-menu { | |
| display: none; | |
| } | |
| @media (max-width: 768px) { | |
| ul { | |
| display: none; | |
| } | |
| .mobile-menu { | |
| display: block; | |
| } | |
| } | |
| </style> | |
| <nav> | |
| <div class="logo">M<span>.e</span>B</div> | |
| <ul> | |
| <li><a href="#home" data-translate="home">Home</a></li> | |
| <li><a href="#about" data-translate="band">The Band</a></li> | |
| <li><a href="#music" data-translate="music">Music</a></li> | |
| <li><a href="#shows" data-translate="shows">Shows</a></li> | |
| <li><a href="#contact" data-translate="contact">Contact</a></li> | |
| </ul> | |
| <div class="mobile-menu"> | |
| <i data-feather="menu" class="text-white w-8 h-8"></i> | |
| </div> | |
| </nav> | |
| `; | |
| } | |
| } | |
| customElements.define('custom-navbar', CustomNavbar); |