Spaces:
Running
Running
Download components/header.js from 5uck1t/codecraft-input-symphony: direct link, hf CLI and curl.
- Browser
- Download file 1.87 kB
-
https://huggingface.co/spaces/5uck1t/codecraft-input-symphony/resolve/main/components/header.js
- Command line
-
hf download hf://spaces/5uck1t/codecraft-input-symphony/components/header.js
-
curl -L -o header.js https://huggingface.co/spaces/5uck1t/codecraft-input-symphony/resolve/main/components/header.js
1.87 kB
| class CustomHeader extends HTMLElement { | |
| connectedCallback() { | |
| this.attachShadow({ mode: 'open' }); | |
| this.shadowRoot.innerHTML = ` | |
| <style> | |
| :host { | |
| display: block; | |
| position: fixed; | |
| top: 0; | |
| left: 0; | |
| right: 0; | |
| z-index: 50; | |
| background-color: rgba(17, 24, 39, 0.95); | |
| backdrop-filter: blur(8px); | |
| border-bottom: 1px solid rgba(255, 255, 255, 0.1); | |
| height: 60px; | |
| } | |
| header { | |
| display: flex; | |
| align-items: center; | |
| height: 100%; | |
| padding: 0 1rem; | |
| max-width: 100%; | |
| } | |
| .menu-btn { | |
| display: flex; | |
| align-items: center; | |
| justify-content: center; | |
| background: transparent; | |
| border: none; | |
| color: white; | |
| cursor: pointer; | |
| padding: 0.5rem; | |
| border-radius: 0.375rem; | |
| margin-right: 1rem; | |
| transition: all 0.2s; | |
| } | |
| .menu-btn:hover { | |
| background: rgba(255, 255, 255, 0.1); | |
| } | |
| .menu-btn i { | |
| width: 1.25rem; | |
| height: 1.25rem; | |
| } | |
| .title { | |
| font-size: 1.25rem; | |
| font-weight: 600; | |
| color: white; | |
| display: flex; | |
| align-items: center; | |
| gap: 0.5rem; | |
| } | |
| .title span { | |
| color: #8b5cf6; | |
| } | |
| </style> | |
| <header> | |
| <button class="menu-btn" id="sidebar-toggle"> | |
| <i data-feather="menu"></i> | |
| </button> | |
| <div class="title"> | |
| CodeCraft Input Symphony<span>🎹</span> | |
| </div> | |
| </header> | |
| `; | |
| // Initialize feather icons | |
| if (window.feather) { | |
| feather.replace({ class: 'feather', width: 20, height: 20 }); | |
| } | |
| } | |
| } | |
| customElements.define('custom-header', CustomHeader); |