Spaces:
Running
Running
| class CustomHeader extends HTMLElement { | |
| connectedCallback() { | |
| this.attachShadow({ mode: 'open' }); | |
| this.shadowRoot.innerHTML = ` | |
| <style> | |
| :host { | |
| display: block; | |
| width: 100%; | |
| background-color: white; | |
| box-shadow: 0 2px 4px rgba(0,0,0,0.1); | |
| } | |
| .header-content { | |
| max-width: 1200px; | |
| margin: 0 auto; | |
| padding: 1.5rem 2rem; | |
| display: flex; | |
| justify-content: space-between; | |
| align-items: center; | |
| } | |
| .logo { | |
| font-size: 1.5rem; | |
| font-weight: bold; | |
| color: #4f46e5; | |
| } | |
| nav { | |
| display: flex; | |
| gap: 1.5rem; | |
| } | |
| nav a { | |
| text-decoration: none; | |
| color: #4b5563; | |
| font-weight: 500; | |
| transition: color 0.3s ease; | |
| } | |
| nav a:hover { | |
| color: #4f46e5; | |
| } | |
| </style> | |
| <div class="header-content"> | |
| <div class="logo">Timeless 🕰️</div> | |
| <nav> | |
| <a href="#"><i data-feather="home"></i> Home</a> | |
| <a href="#"><i data-feather="clock"></i> Countdown</a> | |
| <a href="#"><i data-feather="info"></i> About</a> | |
| <a href="#"><i data-feather="mail"></i> Contact</a> | |
| </nav> | |
| </div> | |
| `; | |
| } | |
| } | |
| customElements.define('custom-header', CustomHeader); |