Spaces:
Running
Running
File size: 4,462 Bytes
152c583 | 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 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | class HeaderComponent extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
header {
background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
}
.header-content {
max-width: 1200px;
margin: 0 auto;
padding: 1.5rem 2rem;
display: flex;
justify-content: space-between;
align-items: center;
}
.logo {
display: flex;
align-items: center;
gap: 0.75rem;
font-size: 1.5rem;
font-weight: 700;
color: white;
text-decoration: none;
}
.logo-icon {
width: 40px;
height: 40px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.5rem;
}
.nav-menu {
display: flex;
gap: 2rem;
list-style: none;
margin: 0;
padding: 0;
}
.nav-link {
color: #94a3b8;
text-decoration: none;
font-weight: 500;
transition: color 0.3s ease;
padding: 0.5rem 1rem;
border-radius: 8px;
}
.nav-link:hover, .nav-link.active {
color: white;
background: rgba(255, 255, 255, 0.1);
}
.user-menu {
display: flex;
align-items: center;
gap: 1rem;
}
.user-avatar {
width: 36px;
height: 36px;
border-radius: 50%;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
display: flex;
align-items: center;
justify-content: center;
color: white;
font-weight: 600;
}
@media (max-width: 768px) {
.header-content {
padding: 1rem;
}
.nav-menu {
display: none;
}
.logo span {
display: none;
}
}
</style>
<header>
<div class="header-content">
<a href="#" class="logo">
<div class="logo-icon">⭕</div>
<span>Oura Health Hub</span>
</a>
<nav>
<ul class="nav-menu">
<li><a href="#" class="nav-link active">Dashboard</a></li>
<li><a href="#" class="nav-link">Trends</a></li>
<li><a href="#" class="nav-link">Insights</a></li>
<li><a href="#" class="nav-link">Settings</a></li>
</ul>
</nav>
<div class="user-menu">
<button style="background: none; border: none; cursor: pointer;">
<i data-feather="bell" style="width: 20px; height: 20px; color: #94a3b8;"></i>
</button>
<div class="user-avatar">JD</div>
</div>
</div>
</header>
`;
}
}
customElements.define('header-component', HeaderComponent); |