Spaces:
Running
Running
| class CustomNavbar extends HTMLElement { | |
| connectedCallback() { | |
| this.attachShadow({ mode: 'open' }); | |
| this.shadowRoot.innerHTML = ` | |
| <style> | |
| nav { | |
| background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%); | |
| padding: 1rem 2rem; | |
| display: flex; | |
| justify-content: space-between; | |
| align-items: center; | |
| box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); | |
| } | |
| .logo { | |
| color: white; | |
| font-weight: bold; | |
| font-size: 1.5rem; | |
| display: flex; | |
| align-items: center; | |
| gap: 0.5rem; | |
| } | |
| ul { | |
| display: flex; | |
| gap: 2rem; | |
| list-style: none; | |
| margin: 0; | |
| padding: 0; | |
| } | |
| a { | |
| color: white; | |
| text-decoration: none; | |
| font-weight: 500; | |
| padding: 0.5rem 1rem; | |
| border-radius: 0.5rem; | |
| transition: all 0.2s; | |
| } | |
| a:hover { | |
| background: rgba(255, 255, 255, 0.1); | |
| } | |
| .nav-container { | |
| width: 100%; | |
| max-width: 1200px; | |
| margin: 0 auto; | |
| display: flex; | |
| justify-content: space-between; | |
| align-items: center; | |
| } | |
| @media (max-width: 768px) { | |
| nav { | |
| padding: 1rem; | |
| } | |
| ul { | |
| gap: 1rem; | |
| } | |
| } | |
| </style> | |
| <nav> | |
| <div class="nav-container"> | |
| <div class="logo"> | |
| <i data-feather="globe"></i> | |
| Web Scraper Pro | |
| </div> | |
| <ul> | |
| <li><a href="/">Home</a></li> | |
| <li><a href="/about.html">About</a></li> | |
| <li><a href="/api.html">API</a></li> | |
| </ul> | |
| </div> | |
| </nav> | |
| `; | |
| } | |
| } | |
| customElements.define('custom-navbar', CustomNavbar); |