shimanta420's picture
fix the style
48ca600 verified
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);