Spaces:
Running
Running
| class CustomNavbar extends HTMLElement { | |
| connectedCallback() { | |
| this.attachShadow({ mode: 'open' }); | |
| this.shadowRoot.innerHTML = ` | |
| <style> | |
| nav { | |
| background-color: white; | |
| box-shadow: 0 2px 4px rgba(0,0,0,0.1); | |
| padding: 1rem 2rem; | |
| position: fixed; | |
| top: 0; | |
| left: 0; | |
| right: 0; | |
| z-index: 50; | |
| } | |
| .navbar-container { | |
| max-width: 1280px; | |
| margin: 0 auto; | |
| display: flex; | |
| justify-content: space-between; | |
| align-items: center; | |
| } | |
| .brand { | |
| display: flex; | |
| align-items: center; | |
| text-decoration: none; | |
| } | |
| .brand-icon { | |
| width: 32px; | |
| height: 32px; | |
| color: #7c3aed; | |
| } | |
| .brand-text { | |
| margin-left: 0.75rem; | |
| font-size: 1.25rem; | |
| font-weight: 600; | |
| color: #111827; | |
| } | |
| .nav-links { | |
| display: flex; | |
| gap: 1.5rem; | |
| } | |
| .nav-link { | |
| text-decoration: none; | |
| color: #4b5563; | |
| font-weight: 500; | |
| transition: color 0.2s; | |
| } | |
| .nav-link:hover { | |
| color: #7c3aed; | |
| } | |
| .nav-link i { | |
| margin-right: 0.5rem; | |
| } | |
| @media (max-width: 768px) { | |
| .navbar-container { | |
| flex-direction: column; | |
| gap: 1rem; | |
| } | |
| .nav-links { | |
| width: 100%; | |
| justify-content: space-around; | |
| } | |
| } | |
| </style> | |
| <nav> | |
| <div class="navbar-container"> | |
| <a href="/" class="brand"> | |
| <i data-feather="zap" class="brand-icon"></i> | |
| <span class="brand-text">Neural Word Wizard</span> | |
| </a> | |
| <div class="nav-links"> | |
| <a href="/" class="nav-link"><i data-feather="home"></i> Home</a> | |
| <a href="/word-dataset.html" class="nav-link"><i data-feather="database"></i> Datasets</a> | |
| </div> | |
| </div> | |
| </nav> | |
| `; | |
| } | |
| } | |
| customElements.define('custom-navbar', CustomNavbar); |