| 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: rgba(17, 24, 39, 0.8); | |
| backdrop-filter: blur(10px); | |
| border-bottom: 1px solid rgba(255, 255, 255, 0.1); | |
| } | |
| nav { | |
| max-width: 1280px; | |
| margin: 0 auto; | |
| padding: 1rem 2rem; | |
| display: flex; | |
| justify-content: space-between; | |
| align-items: center; | |
| } | |
| .logo { | |
| display: flex; | |
| align-items: center; | |
| gap: 0.5rem; | |
| font-weight: 600; | |
| font-size: 1.25rem; | |
| color: white; | |
| text-decoration: none; | |
| } | |
| .logo img { | |
| height: 32px; | |
| } | |
| .nav-links { | |
| display: flex; | |
| gap: 1.5rem; | |
| } | |
| .nav-links a { | |
| color: rgba(209, 213, 219, 0.8); | |
| text-decoration: none; | |
| font-weight: 500; | |
| transition: color 0.2s; | |
| font-size: 0.95rem; | |
| } | |
| .nav-links a:hover { | |
| color: white; | |
| } | |
| .nav-actions { | |
| display: flex; | |
| gap: 1rem; | |
| align-items: center; | |
| } | |
| .nav-button { | |
| padding: 0.5rem 1rem; | |
| border-radius: 0.375rem; | |
| font-weight: 500; | |
| text-decoration: none; | |
| transition: all 0.2s; | |
| font-size: 0.95rem; | |
| } | |
| .nav-button.secondary { | |
| color: white; | |
| border: 1px solid rgba(255, 255, 255, 0.2); | |
| } | |
| .nav-button.secondary:hover { | |
| background-color: rgba(255, 255, 255, 0.05); | |
| border-color: rgba(255, 255, 255, 0.3); | |
| } | |
| .nav-button.primary { | |
| background-color: #6366f1; | |
| color: white; | |
| } | |
| .nav-button.primary:hover { | |
| background-color: #4f46e5; | |
| } | |
| .mobile-menu-button { | |
| display: none; | |
| background: none; | |
| border: none; | |
| color: white; | |
| cursor: pointer; | |
| } | |
| @media (max-width: 768px) { | |
| .nav-links, .nav-actions { | |
| display: none; | |
| } | |
| .mobile-menu-button { | |
| display: block; | |
| } | |
| } | |
| </style> | |
| <nav> | |
| <a href="/" class="logo"> | |
| <img src="https://www.greptile.com/logo-only.svg" alt="CodeGuardian AI"> | |
| <span>CodeGuardian</span> | |
| </a> | |
| <div class="nav-links"> | |
| <a href="/pricing">Pricing</a> | |
| <div class="relative group"> | |
| <a href="#features" class="flex items-center gap-1"> | |
| Features | |
| <i data-feather="chevron-down" class="w-4 h-4"></i> | |
| </a> | |
| <div class="absolute left-0 mt-2 w-48 rounded-md shadow-lg bg-gray-800 border border-gray-700 hidden group-hover:block z-10"> | |
| <a href="/feature/code-context" class="block px-4 py-2 text-gray-300 hover:bg-gray-700">Code Context</a> | |
| <a href="/feature/custom-rules" class="block px-4 py-2 text-gray-300 hover:bg-gray-700">Custom Rules</a> | |
| <a href="/feature/learning" class="block px-4 py-2 text-gray-300 hover:bg-gray-700">Learning</a> | |
| <a href="/feature/sequence-diagrams" class="block px-4 py-2 text-gray-300 hover:bg-gray-700">Sequence Diagrams</a> | |
| </div> | |
| </div> | |
| <a href="/enterprise">Enterprise</a> | |
| <div class="relative group"> | |
| <a href="#" class="flex items-center gap-1"> | |
| Resources | |
| <i data-feather="chevron-down" class="w-4 h-4"></i> | |
| </a> | |
| <div class="absolute left-0 mt-2 w-48 rounded-md shadow-lg bg-gray-800 border border-gray-700 hidden group-hover:block z-10"> | |
| <a href="/docs" class="block px-4 py-2 text-gray-300 hover:bg-gray-700">Docs</a> | |
| <a href="/examples" class="block px-4 py-2 text-gray-300 hover:bg-gray-700">Examples</a> | |
| <a href="/customers" class="block px-4 py-2 text-gray-300 hover:bg-gray-700">Customers</a> | |
| <a href="/blog" class="block px-4 py-2 text-gray-300 hover:bg-gray-700">Blog</a> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="nav-actions"> | |
| <a href="/login" class="nav-button secondary">Sign In</a> | |
| <a href="/signup" class="nav-button primary">Start Now</a> | |
| </div> | |
| <button class="mobile-menu-button"> | |
| <i data-feather="menu"></i> | |
| </button> | |
| </nav> | |
| `; | |
| } | |
| } | |
| customElements.define('custom-navbar', CustomNavbar); |