Spaces:
Running
Running
Download components/header.js from repele/qi-men-analyzer: direct link, hf CLI and curl.
- Browser
- Download file 2.94 kB
-
https://huggingface.co/spaces/repele/qi-men-analyzer/resolve/main/components/header.js
- Command line
-
hf download hf://spaces/repele/qi-men-analyzer/components/header.js
-
curl -L -o header.js https://huggingface.co/spaces/repele/qi-men-analyzer/resolve/main/components/header.js
2.94 kB
| class CustomHeader extends HTMLElement { | |
| connectedCallback() { | |
| this.attachShadow({ mode: 'open' }); | |
| this.shadowRoot.innerHTML = ` | |
| <style> | |
| :host { | |
| display: block; | |
| } | |
| .header { | |
| background: linear-gradient(135deg, #fef3c7 0%, #f59e0b 100%); | |
| box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); | |
| } | |
| .container { | |
| max-width: 1200px; | |
| margin: 0 auto; | |
| padding: 0 1rem; | |
| } | |
| .nav { | |
| display: flex; | |
| justify-content: space-between; | |
| align-items: center; | |
| padding: 1rem 0; | |
| } | |
| .logo { | |
| display: flex; | |
| align-items: center; | |
| gap: 0.75rem; | |
| font-size: 1.5rem; | |
| font-weight: 700; | |
| color: #92400e; | |
| } | |
| .logo-icon { | |
| background: #92400e; | |
| color: white; | |
| width: 36px; | |
| height: 36px; | |
| border-radius: 50%; | |
| display: flex; | |
| align-items: center; | |
| justify-content: center; | |
| } | |
| .nav-links { | |
| display: flex; | |
| gap: 1.5rem; | |
| } | |
| .nav-link { | |
| color: #92400e; | |
| text-decoration: none; | |
| font-weight: 500; | |
| padding: 0.5rem 1rem; | |
| border-radius: 0.5rem; | |
| transition: all 0.2s ease; | |
| } | |
| .nav-link:hover { | |
| background: rgba(146, 64, 14, 0.1); | |
| } | |
| .nav-link.active { | |
| background: rgba(146, 64, 14, 0.2); | |
| } | |
| @media (max-width: 768px) { | |
| .nav { | |
| flex-direction: column; | |
| gap: 1rem; | |
| } | |
| .nav-links { | |
| flex-wrap: wrap; | |
| justify-content: center; | |
| } | |
| } | |
| </style> | |
| <header class="header"> | |
| <div class="container"> | |
| <nav class="nav"> | |
| <div class="logo"> | |
| <div class="logo-icon"> | |
| <i data-feather="compass"></i> | |
| </div> | |
| <span>Qi Men Analyzer</span> | |
| </div> | |
| <div class="nav-links"> | |
| <a href="#" class="nav-link active">Dashboard</a> | |
| <a href="#" class="nav-link">Charts</a> | |
| <a href="#" class="nav-link">Analysis</a> | |
| <a href="#" class="nav-link">Reports</a> | |
| <a href="#" class="nav-link">Settings</a> | |
| </div> | |
| </nav> | |
| </div> | |
| </header> | |
| `; | |
| // Initialize Feather Icons | |
| const script = document.createElement('script'); | |
| script.src = 'https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js'; | |
| script.onload = () => { | |
| if (this.shadowRoot) { | |
| feather.replace(); | |
| } | |
| }; | |
| this.shadowRoot.appendChild(script); | |
| } | |
| } | |
| customElements.define('custom-header', CustomHeader); |