Spaces:
Running
Running
| class CustomNavbar extends HTMLElement { | |
| connectedCallback() { | |
| this.attachShadow({ mode: 'open' }); | |
| this.shadowRoot.innerHTML = ` | |
| <style> | |
| :host { | |
| display: block; | |
| position: fixed; | |
| top: 0; | |
| width: 100%; | |
| z-index: 1000; | |
| background: rgba(15, 23, 42, 0.95); | |
| backdrop-filter: blur(10px); | |
| border-bottom: 1px solid rgba(212, 175, 55, 0.2); | |
| } | |
| nav { | |
| display: flex; | |
| justify-content: space-between; | |
| align-items: center; | |
| padding: 1rem 5%; | |
| max-width: 1600px; | |
| margin: 0 auto; | |
| } | |
| .logo { | |
| display: flex; | |
| align-items: center; | |
| gap: 0.75rem; | |
| font-family: 'Cormorant Garamond', serif; | |
| font-weight: 700; | |
| font-size: 1.5rem; | |
| color: #F8FAFC; | |
| text-decoration: none; | |
| } | |
| .logo-icon { | |
| color: #D4AF37; | |
| } | |
| .nav-links { | |
| display: flex; | |
| gap: 2rem; | |
| } | |
| .nav-link { | |
| color: #CBD5E1; | |
| text-decoration: none; | |
| font-weight: 500; | |
| transition: color 0.3s ease; | |
| position: relative; | |
| } | |
| .nav-link:hover { | |
| color: #D4AF37; | |
| } | |
| .nav-link::after { | |
| content: ''; | |
| position: absolute; | |
| bottom: -5px; | |
| left: 0; | |
| width: 0; | |
| height: 2px; | |
| background: #D4AF37; | |
| transition: width 0.3s ease; | |
| } | |
| .nav-link:hover::after { | |
| width: 100%; | |
| } | |
| .cta-button { | |
| background: linear-gradient(45deg, #D4AF37, #F8FAFC); | |
| color: #0F172A; | |
| border: none; | |
| padding: 0.75rem 1.5rem; | |
| border-radius: 30px; | |
| font-weight: 600; | |
| cursor: pointer; | |
| transition: all 0.3s ease; | |
| } | |
| .cta-button:hover { | |
| transform: translateY(-2px); | |
| box-shadow: 0 10px 20px rgba(212, 175, 55, 0.3); | |
| } | |
| .mobile-menu-button { | |
| display: none; | |
| background: none; | |
| border: none; | |
| color: #F8FAFC; | |
| font-size: 1.5rem; | |
| cursor: pointer; | |
| } | |
| @media (max-width: 768px) { | |
| .nav-links { | |
| display: none; | |
| } | |
| .mobile-menu-button { | |
| display: block; | |
| } | |
| } | |
| </style> | |
| <nav> | |
| <a href="/" class="logo"> | |
| <i data-feather="anchor" class="logo-icon"></i> | |
| <span>Commodore Yachting</span> | |
| </a> | |
| <div class="nav-links"> | |
| <a href="#courses" class="nav-link">Courses</a> | |
| <a href="#fleet" class="nav-link">Fleet</a> | |
| <a href="#instructors" class="nav-link">Instructors</a> | |
| <a href="#charter" class="nav-link">Charter</a> | |
| <a href="#blog" class="nav-link">Blog</a> | |
| </div> | |
| <button class="cta-button">Book Now</button> | |
| <button class="mobile-menu-button"> | |
| <i data-feather="menu"></i> | |
| </button> | |
| </nav> | |
| `; | |
| // Initialize feather icons | |
| import('https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js').then(() => { | |
| feather.replace({ icons: this.shadowRoot.querySelectorAll('[data-feather]') }); | |
| }); | |
| } | |
| } | |
| customElements.define('custom-navbar', CustomNavbar); |