Spaces:
Running
Running
File size: 1,870 Bytes
5c75c54 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | 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); |