Odran's picture
a user centric ai backed crypto insurance app
1b10cf1 verified
class CustomNavbar extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
:host {
display: block;
width: 100%;
position: sticky;
top: 0;
z-index: 50;
background-color: white;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
nav {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem 2rem;
max-width: 1280px;
margin: 0 auto;
}
.logo {
display: flex;
align-items: center;
font-weight: 700;
font-size: 1.25rem;
color: #4f46e5;
}
.logo-icon {
margin-right: 0.5rem;
}
.nav-links {
display: flex;
gap: 2rem;
}
.nav-links a {
color: #4b5563;
font-weight: 500;
text-decoration: none;
transition: color 0.2s;
}
.nav-links a:hover {
color: #4f46e5;
}
.mobile-menu-btn {
display: none;
background: none;
border: none;
cursor: pointer;
}
@media (max-width: 768px) {
.nav-links {
display: none;
}
.mobile-menu-btn {
display: block;
}
}
</style>
<nav>
<a href="/" class="logo">
<i data-feather="shield" class="logo-icon"></i>
CryptoShield AI
</a>
<div class="nav-links">
<a href="/dashboard.html">Dashboard</a>
<a href="/how-it-works.html">How It Works</a>
<a href="/pricing.html">Pricing</a>
<a href="/about.html">About</a>
<a href="/login.html" class="text-indigo-600">Login</a>
</div>
<button class="mobile-menu-btn">
<i data-feather="menu"></i>
</button>
</nav>
`;
}
}
customElements.define('custom-navbar', CustomNavbar);