Hyperzilla's picture
google search
083161b verified
class CustomNavbar extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
nav {
background: white;
padding: 1rem 2rem;
display: flex;
justify-content: space-between;
align-items: center;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.nav-links {
display: flex;
gap: 1.5rem;
list-style: none;
margin: 0;
padding: 0;
}
a {
color: #5f6368;
text-decoration: none;
font-size: 0.875rem;
transition: color 0.2s;
}
a:hover {
color: #1a73e8;
}
.logo {
display: flex;
align-items: center;
gap: 0.5rem;
font-weight: 500;
color: #1a73e8;
font-size: 1.25rem;
}
.icon {
width: 24px;
height: 24px;
}
</style>
<nav>
<a href="/" class="logo">
<i data-feather="compass" class="icon"></i>
<span>Googly Moogly</span>
</a>
<ul class="nav-links">
<li><a href="#">Images</a></li>
<li><a href="#">Videos</a></li>
<li><a href="#">News</a></li>
<li><a href="#">MooglyMaps</a></li>
<li><a href="#">More</a></li>
</ul>
</nav>
`;
}
}
customElements.define('custom-navbar', CustomNavbar);