Spaces:
Running
Running
| class CustomHeader extends HTMLElement { | |
| connectedCallback() { | |
| this.attachShadow({ mode: 'open' }); | |
| this.shadowRoot.innerHTML = ` | |
| <style> | |
| nav { | |
| background-color: white; | |
| box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); | |
| } | |
| .nav-link { | |
| transition: color 0.2s ease; | |
| } | |
| .nav-link:hover { | |
| color: #3b82f6; | |
| } | |
| </style> | |
| <nav class="py-4 px-6"> | |
| <div class="container mx-auto flex justify-between items-center"> | |
| <a href="/" class="text-xl font-bold text-gray-800 flex items-center"> | |
| <i data-feather="activity" class="mr-2 text-blue-500"></i> | |
| DataViz Pro | |
| </a> | |
| <div class="hidden md:flex space-x-8"> | |
| <a href="#" class="nav-link text-gray-600">Dashboard</a> | |
| <a href="#" class="nav-link text-gray-600">Analytics</a> | |
| <a href="#" class="nav-link text-gray-600">Reports</a> | |
| <a href="#" class="nav-link text-gray-600">Settings</a> | |
| </div> | |
| <button class="md:hidden"> | |
| <i data-feather="menu" class="text-gray-600"></i> | |
| </button> | |
| </div> | |
| </nav> | |
| `; | |
| } | |
| } | |
| customElements.define('custom-header', CustomHeader); |