Kraft102's picture
BYG ET SIMPELT SPIL
8f231d6 verified
class CustomHeader extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
header {
background: linear-gradient(90deg, #7C3AED 0%, #4F46E5 100%);
color: white;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
nav {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem 2rem;
max-width: 1200px;
margin: 0 auto;
}
.logo {
font-size: 1.5rem;
font-weight: 700;
display: flex;
align-items: center;
gap: 0.5rem;
}
.nav-links {
display: flex;
gap: 2rem;
}
.nav-links a {
color: white;
text-decoration: none;
font-weight: 500;
transition: all 0.3s ease;
display: flex;
align-items: center;
gap: 0.3rem;
}
.nav-links a:hover {
opacity: 0.8;
transform: translateY(-2px);
}
@media (max-width: 768px) {
nav {
flex-direction: column;
gap: 1rem;
padding: 1rem;
}
.nav-links {
gap: 1rem;
}
}
</style>
<header>
<nav>
<div class="logo">
<i data-feather="zap"></i>
<span>Spin & Win</span>
</div>
<div class="nav-links">
<a href="#">
<i data-feather="home"></i>
Home
</a>
<a href="#">
<i data-feather="info"></i>
About
</a>
<a href="#">
<i data-feather="gift"></i>
Prizes
</a>
</div>
</nav>
</header>
`;
}
}
customElements.define('custom-header', CustomHeader);