Spaces:
Running
Running
File size: 2,700 Bytes
abc8a56 48ca600 abc8a56 48ca600 abc8a56 48ca600 abc8a56 |
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 |
class HeaderComponent extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
nav {
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
}
.nav-link {
color: #cbd5e1;
font-weight: 500;
}
.nav-link:hover {
color: var(--primary-500);
}
.logo {
color: #f8fafc;
}
#theme-toggle, .menu-toggle {
color: #94a3b8;
}
#theme-toggle:hover, .menu-toggle:hover {
background-color: #1e293b;
color: var(--primary-500);
}
</style>
<header class="sticky top-0 z-50 border-b border-gray-800">
<nav class="bg-gray-900/80 py-4 px-6">
<div class="container mx-auto flex justify-between items-center">
<a href="/" class="flex items-center space-x-2">
<i data-feather="tool" class="text-primary-500"></i>
<span class="text-xl font-bold">Tooltopia Hub</span>
</a>
<div class="hidden md:flex items-center space-x-8">
<a href="#" class="nav-link text-gray-300 hover:text-primary-500">All Tools</a>
<a href="#" class="nav-link text-gray-300 hover:text-primary-500">Categories</a>
<a href="#" class="nav-link text-gray-300 hover:text-primary-500">Favorites</a>
<a href="#" class="nav-link text-gray-300 hover:text-primary-500">About</a>
</div>
<div class="flex items-center space-x-4">
<button id="theme-toggle" class="p-2 rounded-full hover:bg-gray-800">
<i data-feather="moon" class="hidden dark:block"></i>
<i data-feather="sun" class="block dark:hidden"></i>
</button>
<button class="md:hidden p-2 rounded-full hover:bg-gray-800">
<i data-feather="menu"></i>
</button>
</div>
</div>
</nav>
</header>
`;
}
}
customElements.define('header-component', HeaderComponent); |