Spaces:
Running
Running
| class CustomNavbar extends HTMLElement { | |
| connectedCallback() { | |
| this.attachShadow({ mode: 'open' }); | |
| this.shadowRoot.innerHTML = ` | |
| <style> | |
| nav { | |
| background-color: white; | |
| box-shadow: 0 2px 10px rgba(0,0,0,0.1); | |
| padding: 1rem 2rem; | |
| } | |
| .nav-container { | |
| display: flex; | |
| justify-content: space-between; | |
| align-items: center; | |
| max-width: 1200px; | |
| margin: 0 auto; | |
| } | |
| .logo { | |
| font-size: 1.5rem; | |
| font-weight: bold; | |
| color: #4f46e5; | |
| text-decoration: none; | |
| display: flex; | |
| align-items: center; | |
| } | |
| .logo i { | |
| margin-right: 0.5rem; | |
| } | |
| .nav-links { | |
| display: flex; | |
| gap: 2rem; | |
| } | |
| .nav-links a { | |
| color: #4b5563; | |
| text-decoration: none; | |
| font-weight: 500; | |
| transition: color 0.3s; | |
| } | |
| .nav-links a:hover { | |
| color: #4f46e5; | |
| } | |
| @media (max-width: 768px) { | |
| .nav-container { | |
| flex-direction: column; | |
| gap: 1rem; | |
| } | |
| .nav-links { | |
| width: 100%; | |
| justify-content: space-around; | |
| gap: 0; | |
| } | |
| } | |
| </style> | |
| <nav> | |
| <div class="nav-container"> | |
| <a href="#" class="logo"> | |
| <i data-feather="cpu"></i> | |
| AIaaS Platform | |
| </a> | |
| <div class="nav-links"> | |
| <a href="#">Features</a> | |
| <a href="#">Services</a> | |
| <a href="#">Governance</a> | |
| <a href="#">Documentation</a> | |
| </div> | |
| </div> | |
| </nav> | |
| `; | |
| } | |
| } | |
| customElements.define('custom-navbar', CustomNavbar); |