LittleMonkeyLab's picture
Upload 19 files
e44e7cc verified
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);