Spaces:
Running
Running
| class CustomNavbar extends HTMLElement { | |
| connectedCallback() { | |
| this.attachShadow({ mode: 'open' }); | |
| this.shadowRoot.innerHTML = ` | |
| <style> | |
| :host { | |
| display: block; | |
| position: sticky; | |
| top: 0; | |
| z-index: 50; | |
| background: rgba(255, 255, 255, 0.95); | |
| backdrop-filter: blur(12px); | |
| border-bottom: 1px solid rgba(0, 0, 0, 0.05); | |
| } | |
| nav { | |
| max-width: 1280px; | |
| margin: 0 auto; | |
| padding: 1rem; | |
| display: flex; | |
| align-items: center; | |
| justify-content: space-between; | |
| } | |
| .logo { | |
| display: flex; | |
| align-items: center; | |
| gap: 0.75rem; | |
| text-decoration: none; | |
| } | |
| .logo-icon { | |
| font-size: 1.75rem; | |
| } | |
| .logo-text { | |
| font-size: 1.25rem; | |
| font-weight: 700; | |
| color: #1e293b; | |
| background: linear-gradient(45deg, #6d28d9, #ec4899); | |
| -webkit-background-clip: text; | |
| background-clip: text; | |
| -webkit-text-fill-color: transparent; | |
| } | |
| .nav-links { | |
| display: none; | |
| gap: 2rem; | |
| align-items: center; | |
| } | |
| .nav-link { | |
| color: #64748b; | |
| font-weight: 500; | |
| text-decoration: none; | |
| transition: color 0.2s; | |
| padding: 0.5rem; | |
| border-radius: 0.25rem; | |
| } | |
| .nav-link:focus { | |
| outline: 2px solid #7c3aed; | |
| outline-offset: 2px; | |
| } | |
| .nav-link:hover { | |
| color: #6d28d9; | |
| } | |
| .cta-btn { | |
| padding: 0.5rem 1.5rem; | |
| border-radius: 0.5rem; | |
| font-weight: 600; | |
| background: linear-gradient(45deg, #6d28d9, #ec4899); | |
| color: white; | |
| transition: all 0.2s; | |
| outline: none; | |
| } | |
| .cta-btn:focus { | |
| outline: 2px solid #7c3aed; | |
| outline-offset: 2px; | |
| } | |
| .cta-btn:hover { | |
| transform: translateY(-2px); | |
| box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); | |
| } | |
| @media (min-width: 768px) { | |
| .nav-links { | |
| display: flex; | |
| } | |
| } | |
| </style> | |
| <nav> | |
| <a href="/" class="logo"> | |
| <span class="logo-icon">π</span> | |
| <span class="logo-text">MissionQuest</span> | |
| </a> | |
| <div class="nav-links"> | |
| <a href="#missions" class="nav-link">Missions</a> | |
| <a href="#how-it-works" class="nav-link">Comment Γ§a marche</a> | |
| <a href="#get-started" class="cta-btn">Commencer</a> | |
| </div> | |
| </nav> | |
| `; | |
| } | |
| } | |
| customElements.define('custom-navbar', CustomNavbar); |