File size: 1,980 Bytes
b320581 | 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 | class CustomHeader extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
nav {
background: rgba(17, 24, 39, 0.8);
backdrop-filter: blur(10px);
}
.nav-link {
transition: all 0.3s ease;
}
.nav-link:hover {
color: #3b82f6;
transform: translateY(-2px);
}
</style>
<header class="fixed w-full z-50">
<nav class="border-b border-gray-800">
<div class="container mx-auto px-4 py-4 flex items-center justify-between">
<a href="/" class="flex items-center">
<span class="text-2xl font-bold bg-gradient-to-r from-primary to-secondary bg-clip-text text-transparent">HeroForge</span>
</a>
<div class="hidden md:flex items-center space-x-8">
<a href="/" class="nav-link text-white">Home</a>
<a href="/examples.html" class="nav-link text-gray-400 hover:text-white">Examples</a>
<a href="/pricing.html" class="nav-link text-gray-400 hover:text-white">Pricing</a>
<a href="/about.html" class="nav-link text-gray-400 hover:text-white">About</a>
<a href="#" class="px-4 py-2 rounded-full bg-gradient-to-r from-primary to-secondary font-medium">Try Now</a>
</div>
<button class="md:hidden text-white">
<i data-feather="menu"></i>
</button>
</div>
</nav>
</header>
`;
}
}
customElements.define('custom-header', CustomHeader); |