Spaces:
Running
Running
| class CustomNavbar extends HTMLElement { | |
| connectedCallback() { | |
| this.attachShadow({ mode: 'open' }); | |
| this.shadowRoot.innerHTML = ` | |
| <style> | |
| nav { | |
| background: var(--primary-dark); | |
| color: white; | |
| padding: 1rem 2rem; | |
| position: fixed; | |
| width: 100%; | |
| top: 0; | |
| z-index: 1000; | |
| box-shadow: 0 2px 10px rgba(0,0,0,0.1); | |
| } | |
| .nav-container { | |
| display: flex; | |
| justify-content: space-between; | |
| align-items: center; | |
| max-width: 1200px; | |
| margin: 0 auto; | |
| } | |
| .logo { | |
| font-size: 1.5rem; | |
| font-weight: 700; | |
| } | |
| .nav-links { | |
| display: flex; | |
| gap: 2rem; | |
| } | |
| .nav-links a { | |
| color: white; | |
| text-decoration: none; | |
| font-weight: 500; | |
| transition: all 0.3s ease; | |
| } | |
| .nav-links a:hover { | |
| color: var(--accent-light); | |
| } | |
| @media (max-width: 768px) { | |
| .nav-links { | |
| display: none; | |
| } | |
| } | |
| </style> | |
| <nav> | |
| <div class="nav-container"> | |
| <div class="logo">砖讬专讛 讟专讬</div> | |
| <div class="nav-links"> | |
| <a href="/">讘讬转</a> | |
| <a href="#about">讗讜讚讜转</a> | |
| <a href="#services">砖讬专讜转讬诐</a> | |
| <a href="#testimonials">诇拽讜讞讜转</a> | |
| <a href="#contact">爪讜专 拽砖专</a> | |
| </div> | |
| </div> | |
| </nav> | |
| `; | |
| } | |
| } | |
| customElements.define('custom-navbar', CustomNavbar); |