| class CustomHeader extends HTMLElement { | |
| connectedCallback() { | |
| this.attachShadow({ mode: 'open' }); | |
| this.shadowRoot.innerHTML = ` | |
| <style> | |
| nav { | |
| backdrop-filter: blur(10px); | |
| background-color: rgba(255, 255, 255, 0.8); | |
| } | |
| .nav-link { | |
| transition: all 0.2s ease; | |
| position: relative; | |
| } | |
| .nav-link:hover { | |
| color: var(--primary, #000); | |
| } | |
| .nav-link:after { | |
| content: ''; | |
| position: absolute; | |
| width: 0; | |
| height: 2px; | |
| bottom: -2px; | |
| left: 0; | |
| background-color: var(--primary, transparent); | |
| transition: width 0.3s ease; | |
| } | |
| .nav-link:hover:after { | |
| width: 100%; | |
| } | |
| </style> | |
| <header> | |
| <nav class="border-b border-gray-200 fixed w-full z-10"> | |
| <div class="container mx-auto px-4 py-4 flex justify-between items-center"> | |
| <a href="/" class="text-2xl font-bold bg-clip-text text-transparent bg-gradient-to-r from-gray-400 to-gray-600"> | |
| Colorless<span class="font-light">Canvas</span> | |
| </a> | |
| <div class="hidden md:flex space-x-8"> | |
| <a href="#" class="nav-link text-gray-600 hover:text-gray-900">Features</a> | |
| <a href="#" class="nav-link text-gray-600 hover:text-gray-900">Pricing</a> | |
| <a href="#" class="nav-link text-gray-600 hover:text-gray-900">Docs</a> | |
| <a href="#" class="nav-link text-gray-600 hover:text-gray-900">About</a> | |
| </div> | |
| <button class="md:hidden focus:outline-none"> | |
| <i data-feather="menu" class="text-gray-600"></i> | |
| </button> | |
| </div> | |
| </nav> | |
| </header> | |
| `; | |
| } | |
| } | |
| customElements.define('custom-header', CustomHeader); |