wormate-io-clone / components /wormate-nav.js
dannyboy84's picture
new project
e92b0de verified
class WormateNav extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
nav {
background: #1a1a2e;
color: white;
padding: 1rem;
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 100;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}
.nav-container {
display: flex;
justify-content: space-between;
align-items: center;
max-width: 1200px;
margin: 0 auto;
}
.logo {
font-family: 'Press Start 2P', cursive;
font-size: 1.2rem;
color: #ff6b6b;
text-decoration: none;
}
.nav-links {
display: flex;
gap: 1.5rem;
}
.nav-link {
color: white;
text-decoration: none;
font-family: 'Press Start 2P', cursive;
font-size: 0.8rem;
transition: all 0.3s;
}
.nav-link:hover {
color: #ff6b6b;
}
@media (max-width: 768px) {
.nav-container {
flex-direction: column;
gap: 1rem;
}
.nav-links {
gap: 1rem;
}
}
</style>
<nav>
<div class="nav-container">
<a href="#" class="logo">WORMATE.IO</a>
<div class="nav-links">
<a href="index.html" class="nav-link">HOME</a>
<a href="index.html#play" class="nav-link">PLAY</a>
<a href="#" class="nav-link">SKINS</a>
<a href="#" class="nav-link">LEADERBOARD</a>
<a href="about.html" class="nav-link">ABOUT</a>
</div>
</div>
</nav>
`;
}
}
customElements.define('wormate-nav', WormateNav);