Spaces:
Running
Running
File size: 4,315 Bytes
93cbe09 |
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 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
class CustomHeader extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
:host {
display: block;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
header {
background-color: white;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
position: sticky;
top: 0;
z-index: 50;
transition: all 0.3s ease;
}
.container {
max-width: 1280px;
margin: 0 auto;
padding: 0 1rem;
}
nav {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem 0;
}
.logo {
display: flex;
align-items: center;
gap: 0.75rem;
font-weight: 700;
font-size: 1.5rem;
color: #0f172a;
text-decoration: none;
}
.logo-icon {
color: #2563eb;
}
.nav-links {
display: flex;
gap: 2rem;
}
.nav-link {
font-weight: 500;
color: #64748b;
text-decoration: none;
transition: color 0.2s;
}
.nav-link:hover {
color: #2563eb;
}
.auth-buttons {
display: flex;
gap: 1rem;
align-items: center;
}
.btn-outline {
color: #2563eb;
border: 1px solid #2563eb;
padding: 0.5rem 1rem;
border-radius: 0.5rem;
font-weight: 500;
transition: all 0.2s;
text-decoration: none;
}
.btn-outline:hover {
background-color: #2563eb;
color: white;
}
.btn-primary {
background-color: #2563eb;
color: white;
padding: 0.5rem 1rem;
border-radius: 0.5rem;
font-weight: 500;
transition: background-color 0.2s;
text-decoration: none;
}
.btn-primary:hover {
background-color: #1d4ed8;
}
.mobile-menu-button {
display: none;
background: none;
border: none;
cursor: pointer;
}
@media (max-width: 768px) {
.nav-links, .auth-buttons {
display: none;
}
.mobile-menu-button {
display: block;
}
}
</style>
<header>
<div class="container">
<nav>
<a href="/" class="logo">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="logo-icon">
<path d="M12 2L2 7l10 5 10-5-10-5z"></path>
<path d="M2 17l10 5 10-5"></path>
<path d="M2 12l10 5 10-5"></path>
</svg>
<span>GhostStack</span>
</a>
<div class="nav-links">
<a href="#" class="nav-link">Dashboard</a>
<a href="#" class="nav-link">Candidates</a>
<a href="#" class="nav-link">Analytics</a>
<a href="#" class="nav-link">Resources</a>
</div>
<div class="auth-buttons">
<a href="#" class="btn-outline">Sign In</a>
<a href="#" class="btn-primary">Get Started</a>
</div>
<button class="mobile-menu-button">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<line x1="3" y1="12" x2="21" y2="12"></line>
<line x1="3" y1="6" x2="21" y2="6"></line>
<line x1="3" y1="18" x2="21" y2="18"></line>
</svg>
</button>
</nav>
</div>
</header>
`;
}
}
customElements.define('custom-header', CustomHeader); |