File size: 3,580 Bytes
14efcd0 |
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 108 |
class CustomNavbar extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
:host {
display: block;
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 1000;
background: rgba(10, 14, 26, 0.9);
backdrop-filter: blur(10px);
border-bottom: 1px solid rgba(201, 164, 76, 0.1);
}
nav {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1.5rem 2rem;
max-width: 1440px;
margin: 0 auto;
}
.logo {
font-family: 'Playfair Display', serif;
font-size: 1.5rem;
font-weight: 700;
color: var(--gold-500);
text-decoration: none;
}
.nav-links {
display: flex;
gap: 2rem;
align-items: center;
}
.nav-links a {
color: var(--ivory-100);
text-decoration: none;
font-weight: 500;
letter-spacing: 0.5px;
position: relative;
transition: all 0.3s ease;
}
.nav-links a:hover {
color: var(--gold-500);
}
.nav-links a::after {
content: '';
position: absolute;
bottom: -5px;
left: 0;
width: 0;
height: 1px;
background-color: var(--gold-500);
transition: width 0.3s ease;
}
.nav-links a:hover::after {
width: 100%;
}
.mobile-menu-btn {
display: none;
background: none;
border: none;
color: var(--ivory-100);
font-size: 1.5rem;
cursor: pointer;
}
@media (max-width: 768px) {
.nav-links {
display: none;
}
.mobile-menu-btn {
display: block;
}
}
</style>
<nav>
<a href="/" class="logo">THE CODE COMPANY</a>
<div class="nav-links">
<a href="/about.html">About</a>
<a href="/capabilities.html">Capabilities</a>
<a href="/case-studies.html">Case Studies</a>
<a href="/insights.html">Insights</a>
<a href="/contact.html">Contact</a>
</div>
<button class="mobile-menu-btn">
<i data-feather="menu"></i>
</button>
</nav>
`;
}
}
customElements.define('custom-navbar', CustomNavbar); |