Krydev32's picture
why is it about pixel pass?
30b7646 verified
class CustomHeader extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
:host {
display: block;
width: 100%;
}
nav {
background-color: white;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.nav-container {
max-width: 1200px;
margin: 0 auto;
padding: 1rem 2rem;
display: flex;
justify-content: space-between;
align-items: center;
}
.logo {
font-size: 1.5rem;
font-weight: 700;
color: #6366f1;
text-decoration: none;
}
.nav-links {
display: flex;
gap: 2rem;
align-items: center;
}
.nav-link {
color: #4b5563;
text-decoration: none;
font-weight: 500;
transition: color 0.2s;
}
.nav-link:hover {
color: #6366f1;
}
.auth-buttons {
display: flex;
gap: 1rem;
}
.login-btn {
padding: 0.5rem 1.5rem;
border-radius: 0.375rem;
font-weight: 500;
transition: all 0.2s;
}
.signup-btn {
padding: 0.5rem 1.5rem;
border-radius: 0.375rem;
font-weight: 500;
transition: all 0.2s;
background-color: #6366f1;
color: white;
}
.signup-btn:hover {
background-color: #4f46e5;
}
.mobile-menu-btn {
display: none;
background: none;
border: none;
cursor: pointer;
}
@media (max-width: 768px) {
.nav-links, .auth-buttons {
display: none;
}
.mobile-menu-btn {
display: block;
}
}
</style>
<nav>
<div class="nav-container">
<a href="/" class="logo">AuthPortal</a>
<div class="nav-links">
<a href="/features" class="nav-link">Features</a>
<a href="/pricing" class="nav-link">Pricing</a>
<a href="/about" class="nav-link">About</a>
<a href="/contact" class="nav-link">Contact</a>
</div>
<div class="auth-buttons">
<a href="/login" class="login-btn">Log In</a>
<a href="/register" class="signup-btn">Sign Up</a>
</div>
<button class="mobile-menu-btn">
<i data-feather="menu"></i>
</button>
</div>
</nav>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
`;
}
}
customElements.define('custom-header', CustomHeader);