Spaces:
Running
Running
File size: 3,500 Bytes
f853e9d |
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 |
class CustomHeader extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
:host {
display: block;
width: 100%;
}
header {
background: rgba(255, 255, 255, 0.8);
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
padding: 1rem 2rem;
}
.container {
max-width: 1200px;
margin: 0 auto;
display: flex;
justify-content: space-between;
align-items: center;
}
.logo {
font-family: 'Archivo Black', sans-serif;
font-size: 1.5rem;
color: #3b82f6;
text-decoration: none;
display: flex;
align-items: center;
}
.logo-icon {
margin-right: 0.5rem;
color: #22c55e;
}
nav ul {
display: flex;
gap: 1.5rem;
list-style: none;
}
nav a {
text-decoration: none;
color: #334155;
font-weight: 500;
transition: color 0.2s;
position: relative;
}
nav a:hover {
color: #3b82f6;
}
nav a::after {
content: '';
position: absolute;
bottom: -4px;
left: 0;
width: 0;
height: 2px;
background: linear-gradient(to right, #3b82f6, #22c55e);
transition: width 0.3s;
}
nav a:hover::after {
width: 100%;
}
@media (max-width: 768px) {
.container {
flex-direction: column;
gap: 1rem;
}
nav ul {
flex-wrap: wrap;
justify-content: center;
}
}
</style>
<header>
<div class="container">
<a href="/" class="logo">
<i data-feather="hexagon" class="logo-icon"></i>
Neon Garden
</a>
<nav>
<ul>
<li><a href="#ideas">Ideas</a></li>
<li><a href="#about">About</a></li>
<li><a href="#share">Share</a></li>
<li><a href="#community">Community</a></li>
</ul>
</nav>
</div>
</header>
`;
}
}
customElements.define('custom-header', CustomHeader); |