| class CustomHeader extends HTMLElement { | |
| connectedCallback() { | |
| this.attachShadow({ mode: 'open' }); | |
| this.shadowRoot.innerHTML = ` | |
| <style> | |
| header { | |
| background: linear-gradient(90deg, rgba(31, 41, 55, 0.9), rgba(17, 24, 39, 0.9)); | |
| backdrop-filter: blur(10px); | |
| padding: 1rem 2rem; | |
| box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); | |
| } | |
| .container { | |
| max-width: 1200px; | |
| margin: 0 auto; | |
| display: flex; | |
| justify-content: space-between; | |
| align-items: center; | |
| } | |
| .logo { | |
| font-size: 1.5rem; | |
| font-weight: 700; | |
| background: linear-gradient(45deg, #f97316, #eab308); | |
| -webkit-background-clip: text; | |
| background-clip: text; | |
| color: transparent; | |
| display: flex; | |
| align-items: center; | |
| gap: 0.5rem; | |
| } | |
| nav ul { | |
| display: flex; | |
| gap: 1.5rem; | |
| list-style: none; | |
| } | |
| nav a { | |
| color: #d1d5db; | |
| text-decoration: none; | |
| font-weight: 500; | |
| transition: color 0.2s; | |
| display: flex; | |
| align-items: center; | |
| gap: 0.25rem; | |
| } | |
| nav a:hover { | |
| color: white; | |
| } | |
| @media (max-width: 768px) { | |
| .container { | |
| flex-direction: column; | |
| gap: 1rem; | |
| } | |
| nav ul { | |
| gap: 1rem; | |
| } | |
| } | |
| </style> | |
| <header> | |
| <div class="container"> | |
| <a href="/" class="logo"> | |
| <i data-feather="diamond"></i> | |
| <span>Loot Spin</span> | |
| </a> | |
| <nav> | |
| <ul> | |
| <li><a href="/"><i data-feather="home"></i> Home</a></li> | |
| <li><a href="/about"><i data-feather="info"></i> About</a></li> | |
| <li><a href="/leaderboard"><i data-feather="award"></i> Leaderboard</a></li> | |
| </ul> | |
| </nav> | |
| </div> | |
| </header> | |
| `; | |
| } | |
| } | |
| customElements.define('custom-header', CustomHeader); |