Spaces:
Running
Running
| class CustomHeader extends HTMLElement { | |
| connectedCallback() { | |
| this.attachShadow({ mode: 'open' }); | |
| this.shadowRoot.innerHTML = ` | |
| <style> | |
| nav { | |
| transition: all 0.3s ease; | |
| } | |
| .nav-link { | |
| position: relative; | |
| } | |
| .nav-link::after { | |
| content: ''; | |
| position: absolute; | |
| bottom: -2px; | |
| left: 0; | |
| width: 0; | |
| height: 2px; | |
| background-color: #f97316; | |
| transition: width 0.3s ease; | |
| } | |
| .nav-link:hover::after { | |
| width: 100%; | |
| } | |
| </style> | |
| <header class="bg-white shadow-sm"> | |
| <nav class="container mx-auto px-4 py-4 flex justify-between items-center"> | |
| <a href="#" class="flex items-center"> | |
| <div class="bg-primary p-2 rounded-lg mr-3"> | |
| <i data-feather="message-circle" class="text-white"></i> | |
| </div> | |
| <span class="text-xl font-bold text-gray-800">OrangeRose</span> | |
| </a> | |
| <div class="hidden md:flex space-x-8"> | |
| <a href="#" class="nav-link text-gray-700 hover:text-primary">Home</a> | |
| <a href="#" class="nav-link text-gray-700 hover:text-primary">Features</a> | |
| <a href="#" class="nav-link text-gray-700 hover:text-primary">About</a> | |
| <a href="#" class="nav-link text-gray-700 hover:text-primary">Contact</a> | |
| </div> | |
| <button class="md:hidden text-gray-700"> | |
| <i data-feather="menu"></i> | |
| </button> | |
| </nav> | |
| </header> | |
| `; | |
| } | |
| } | |
| customElements.define('custom-header', CustomHeader); |