Spaces:
Running
Running
| class CustomNavbar extends HTMLElement { | |
| connectedCallback() { | |
| this.attachShadow({ mode: 'open' }); | |
| this.shadowRoot.innerHTML = ` | |
| <style> | |
| :host { | |
| display: block; | |
| width: 100%; | |
| position: sticky; | |
| top: 0; | |
| z-index: 50; | |
| backdrop-filter: blur(10px); | |
| background-color: rgba(17, 24, 39, 0.8); | |
| border-bottom: 1px solid rgba(255, 255, 255, 0.1); | |
| } | |
| nav { | |
| display: flex; | |
| justify-content: space-between; | |
| align-items: center; | |
| padding: 1rem 2rem; | |
| max-width: 1440px; | |
| margin: 0 auto; | |
| } | |
| .logo { | |
| font-weight: 700; | |
| font-size: 1.25rem; | |
| background: linear-gradient(90deg, #0ea5e9, #8b5cf6); | |
| -webkit-background-clip: text; | |
| background-clip: text; | |
| color: transparent; | |
| } | |
| .nav-links { | |
| display: flex; | |
| gap: 1.5rem; | |
| } | |
| .nav-links a { | |
| color: rgba(255, 255, 255, 0.8); | |
| font-weight: 500; | |
| transition: all 0.2s; | |
| position: relative; | |
| } | |
| .nav-links a:hover { | |
| color: white; | |
| } | |
| .nav-links a::after { | |
| content: ''; | |
| position: absolute; | |
| bottom: -4px; | |
| left: 0; | |
| width: 0; | |
| height: 2px; | |
| background: linear-gradient(90deg, #0ea5e9, #8b5cf6); | |
| transition: width 0.3s; | |
| } | |
| .nav-links a:hover::after { | |
| width: 100%; | |
| } | |
| .mobile-menu-btn { | |
| display: none; | |
| background: none; | |
| border: none; | |
| color: white; | |
| cursor: pointer; | |
| } | |
| @media (max-width: 768px) { | |
| .nav-links { | |
| display: none; | |
| } | |
| .mobile-menu-btn { | |
| display: block; | |
| } | |
| } | |
| </style> | |
| <nav> | |
| <a href="/" class="logo">VOIDSCAPE</a> | |
| <div class="nav-links"> | |
| <a href="#">Features</a> | |
| <a href="#">Pricing</a> | |
| <a href="#">Docs</a> | |
| <a href="#">Contact</a> | |
| </div> | |
| <button class="mobile-menu-btn"> | |
| <i data-feather="menu"></i> | |
| </button> | |
| </nav> | |
| `; | |
| } | |
| } | |
| customElements.define('custom-navbar', CustomNavbar); |