Spaces:
Running
Running
File size: 1,380 Bytes
52dca4f | 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 | 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);
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 1rem;
}
.logo {
font-weight: 700;
font-size: 1.5rem;
color: #4F46E5;
}
nav a {
color: #4B5563;
transition: color 0.2s;
}
nav a:hover {
color: #4F46E5;
}
@media (max-width: 640px) {
.container {
flex-direction: column;
gap: 1rem;
}
}
</style>
<header>
<div class="container mx-auto px-4 flex justify-between items-center">
<a href="#" class="logo">FormFusion</a>
<nav class="flex gap-6">
<a href="#" class="flex items-center gap-1">
<i data-feather="home"></i>
<span>Home</span>
</a>
<a href="#" class="flex items-center gap-1">
<i data-feather="help-circle"></i>
<span>Help</span>
</a>
</nav>
</div>
</header>
`;
}
}
customElements.define('custom-header', CustomHeader); |