Spaces:
Running
Running
File size: 2,477 Bytes
e44e7cc | 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 | class CustomNavbar extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
nav {
background: rgba(17, 24, 39, 0.8);
backdrop-filter: blur(10px);
padding: 1rem 2rem;
display: flex;
justify-content: space-between;
align-items: center;
position: sticky;
top: 0;
z-index: 50;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.logo {
color: white;
font-weight: bold;
font-size: 1.5rem;
background: linear-gradient(90deg, #10B981 0%, #3B82F6 100%);
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;
}
ul {
display: flex;
gap: 1.5rem;
list-style: none;
margin: 0;
padding: 0;
align-items: center;
}
a {
color: rgba(255, 255, 255, 0.8);
text-decoration: none;
transition: all 0.2s;
font-weight: 500;
display: flex;
align-items: center;
gap: 0.5rem;
}
a:hover {
color: white;
}
.active {
color: white;
font-weight: 600;
}
.play-btn {
background: linear-gradient(90deg, #10B981 0%, #3B82F6 100%);
padding: 0.5rem 1rem;
border-radius: 0.375rem;
color: white !important;
}
.play-btn:hover {
transform: translateY(-2px) scale(1.05);
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}
@media (max-width: 768px) {
nav {
flex-direction: column;
gap: 1rem;
padding: 1rem;
}
}
</style>
<nav>
<div class="logo">Trading Game</div>
<ul>
<li><a href="/" class="active"><i data-feather="home"></i> Home</a></li>
<li><a href="/play.html"><i data-feather="activity"></i> Play</a></li>
<li><a href="/learn.html"><i data-feather="book"></i> Learn</a></li>
<li><a href="/leaderboard.html"><i data-feather="award"></i> Leaderboard</a></li>
<li><a href="/play.html" class="play-btn"><i data-feather="play"></i> Play Now</a></li>
</ul>
</nav>
`;
}
}
customElements.define('custom-navbar', CustomNavbar); |