File size: 3,333 Bytes
7a79b89 | 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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | class HeaderSection extends HTMLElement {
constructor() {
super();
}
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.render();
}
render() {
this.shadowRoot.innerHTML = `
<style>
.header {
background: white;
border-bottom: 1px solid #e5e7eb;
}
.search-input {
background-color: #f9fafb;
transition: all 0.3s ease;
}
.search-input:focus {
background-color: white;
border-color: #ff580f;
}
.notification-badge {
position: absolute;
top: -2px;
right: -2px;
width: 8px;
height: 8px;
background-color: #ff580f;
border-radius: 50%;
}
</style>
<header class="header p-4">
<div class="flex items-center justify-between">
<!-- Left Section -->
<div class="flex items-center space-x-4">
<!-- Mobile Menu Button -->
<button class="md:hidden p-2 rounded-lg hover:bg-gray-100 transition-colors" data-mobile-menu>
<i data-feather="menu" class="w-5 h-5 text-gray-600"></i>
</button>
<!-- Search Bar -->
<div class="relative hidden md:block">
<i data-feather="search" class="absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"></i>
<input
type="text"
placeholder="Search repositories, agents..."
class="search-input pl-10 pr-4 py-2 rounded-lg border border-gray-200 focus:outline-none focus:ring-2 focus:ring-secondary/20 focus:border-secondary w-64"
data-search-input
>
</div>
</div>
<!-- Right Section -->
<div class="flex items-center space-x-4">
<!-- Notifications -->
<div class="relative">
<button class="p-2 rounded-lg hover:bg-gray-100 transition-colors">
<i data-feather="bell" class="w-5 h-5 text-gray-600"></i>
<div class="notification-badge"></div>
</button>
</div>
<!-- User Menu -->
<div class="flex items-center space-x-3">
<div class="text-right hidden md:block">
<p class="text-sm font-medium text-primary">DevOps Team</p>
<p class="text-xs text-gray-500">Administrator</p>
</div>
<div class="w-8 h-8 bg-secondary rounded-full flex items-center justify-center">
<i data-feather="user" class="w-4 h-4 text-white"></i>
</div>
</div>
</div>
</header>
`;
}
}
customElements.define('header-section', HeaderSection); |