Spaces:
Running
Running
File size: 3,618 Bytes
d2e555d 30b7646 d2e555d | 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 | 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); |