File size: 2,686 Bytes
bc2f68f | 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 | class CustomHeader extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
header {
background-color: white;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
height: 64px;
display: flex;
align-items: center;
padding: 0 24px;
position: sticky;
top: 0;
z-index: 50;
}
.logo {
font-weight: 700;
font-size: 1.25rem;
color: #4F46E5;
display: flex;
align-items: center;
}
.logo svg {
margin-right: 8px;
}
.header-content {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
}
.user-menu {
display: flex;
align-items: center;
}
.user-avatar {
width: 36px;
height: 36px;
border-radius: 50%;
background-color: #E0E7FF;
display: flex;
align-items: center;
justify-content: center;
color: #4F46E5;
font-weight: 600;
margin-left: 16px;
cursor: pointer;
}
@media (max-width: 768px) {
header {
padding: 0 16px;
}
}
</style>
<header>
<div class="header-content">
<a href="/" class="logo">
<i data-feather="activity"></i>
<span>CaseFlow</span>
</a>
<div class="user-menu">
<div class="tooltip">
<i data-feather="bell"></i>
<span class="tooltip-text">Notifications</span>
</div>
<div class="user-avatar">JD</div>
</div>
</div>
</header>
`;
}
}
customElements.define('custom-header', CustomHeader); |