Spaces:
Running
Running
File size: 1,327 Bytes
993c9ec 0270f27 bdf6428 993c9ec | 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 | class CustomHeader extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
header {
background-color: rgba(17, 24, 39, 0.8);
backdrop-filter: blur(10px);
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.container {
max-width: 1200px;
}
.logo {
color: #818cf8;
font-weight: 700;
font-size: 1.5rem;
}
.nav-link {
transition: color 0.2s;
}
.nav-link:hover {
color: #818cf8;
}
</style>
<header class="py-4 px-6">
<div class="container mx-auto flex justify-between items-center">
<a href="/" class="logo flex items-center">
<i data-feather="code" class="mr-2"></i>
CodeFlow
</a>
<nav class="hidden md:flex space-x-6">
<a href="/" class="nav-link">Home</a>
<a href="/leaderboard.html" class="nav-link">Leaderboard</a>
<a href="/login.html" class="nav-link">Login</a>
</nav>
<button class="md:hidden">
<i data-feather="menu"></i>
</button>
</div>
</header>
`;
}
}
customElements.define('custom-header', CustomHeader); |