Spaces:
Running
Running
| class CustomHeader extends HTMLElement { | |
| connectedCallback() { | |
| this.attachShadow({ mode: 'open' }); | |
| this.shadowRoot.innerHTML = ` | |
| <style> | |
| :host { | |
| display: block; | |
| } | |
| header { | |
| background: rgba(31, 41, 55, 0.8); | |
| backdrop-filter: blur(10px); | |
| border-bottom: 1px solid rgba(255, 255, 255, 0.1); | |
| padding: 1rem 0; | |
| position: sticky; | |
| top: 0; | |
| z-index: 100; | |
| } | |
| .container { | |
| max-width: 1200px; | |
| margin: 0 auto; | |
| padding: 0 1rem; | |
| display: flex; | |
| justify-content: space-between; | |
| align-items: center; | |
| } | |
| .logo { | |
| display: flex; | |
| align-items: center; | |
| gap: 0.75rem; | |
| font-weight: 700; | |
| font-size: 1.5rem; | |
| background: linear-gradient(90deg, #3b82f6, #8b5cf6); | |
| -webkit-background-clip: text; | |
| -webkit-text-fill-color: transparent; | |
| } | |
| nav ul { | |
| display: flex; | |
| list-style: none; | |
| gap: 2rem; | |
| } | |
| nav a { | |
| color: #d1d5db; | |
| text-decoration: none; | |
| font-weight: 500; | |
| transition: color 0.3s ease; | |
| display: flex; | |
| align-items: center; | |
| gap: 0.5rem; | |
| } | |
| nav a:hover { | |
| color: #3b82f6; | |
| } | |
| @media (max-width: 768px) { | |
| .container { | |
| flex-direction: column; | |
| gap: 1rem; | |
| } | |
| nav ul { | |
| gap: 1rem; | |
| } | |
| } | |
| </style> | |
| <header> | |
| <div class="container"> | |
| <div class="logo"> | |
| <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> | |
| <path d="M11.767 19.089c4.924.868 6.14-6.025 1.216-6.894m-1.216 6.894L5.86 18.047m5.908 1.042-.347 1.97m1.563-8.864c4.924.869 6.14-6.025 1.215-6.893m-1.215 6.893-3.94-.695m5.155-6.2-.347-1.97m-5.807 4.048c4.924.868 6.14-6.026 1.215-6.894m-1.215 6.894L5.86 5.953m5.908-1.042-.347-1.97M7.48 9.855c-4.924-.868-6.14 6.026-1.215 6.894m1.215-6.894l5.908 1.042m-5.908-1.042-.347 1.97"/> | |
| </svg> | |
| Bitcoin Transfer Pro | |
| </div> | |
| <nav> | |
| <ul> | |
| <li><a href="#"><i data-feather="home"></i> Dashboard</a></li> | |
| <li><a href="#"><i data-feather="activity"></i> Transactions</a></li> | |
| <li><a href="#"><i data-feather="settings"></i> Settings</a></li> | |
| </ul> | |
| </nav> | |
| </div> | |
| </header> | |
| `; | |
| // Initialize Feather icons | |
| const featherScript = document.createElement('script'); | |
| featherScript.src = 'https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js'; | |
| featherScript.onload = () => { | |
| feather.replace(); | |
| }; | |
| this.shadowRoot.appendChild(featherScript); | |
| } | |
| } | |
| customElements.define('custom-header', CustomHeader); |