Spaces:
Running
Running
| class CustomNavbar extends HTMLElement { | |
| connectedCallback() { | |
| this.attachShadow({ mode: 'open' }); | |
| this.shadowRoot.innerHTML = ` | |
| <style> | |
| nav { | |
| background: rgba(17, 24, 39, 0.95); | |
| backdrop-filter: blur(10px); | |
| border-bottom: 1px solid rgba(55, 65, 81, 0.5); | |
| padding: 1rem 2rem; | |
| display: flex; | |
| justify-content: space-between; | |
| align-items: center; | |
| position: fixed; | |
| top: 0; | |
| left: 0; | |
| right: 0; | |
| z-index: 1000; | |
| transition: all 0.3s ease; | |
| } | |
| .logo { | |
| color: #ffffff; | |
| font-weight: 800; | |
| font-size: 1.5rem; | |
| background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%); | |
| -webkit-background-clip: text; | |
| -webkit-text-fill-color: transparent; | |
| } | |
| ul { | |
| display: flex; | |
| gap: 2rem; | |
| list-style: none; | |
| margin: 0; | |
| padding: 0; | |
| } | |
| a { | |
| color: #d1d5db; | |
| text-decoration: none; | |
| font-weight: 500; | |
| transition: all 0.2s ease; | |
| position: relative; | |
| } | |
| a:hover { | |
| color: #ffffff; | |
| } | |
| a::after { | |
| content: ''; | |
| position: absolute; | |
| width: 0; | |
| height: 2px; | |
| bottom: -4px; | |
| left: 0; | |
| background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%); | |
| transition: width 0.3s ease; | |
| } | |
| a:hover::after { | |
| width: 100%; | |
| } | |
| @media (max-width: 768px) { | |
| nav { | |
| padding: 1rem; | |
| flex-direction: column; | |
| gap: 1rem; | |
| } | |
| ul { | |
| gap: 1rem; | |
| } | |
| } | |
| </style> | |
| <nav> | |
| <div class="logo">FlexGen Studio</div> | |
| <ul> | |
| <li><a href="#hero">首页</a></li> | |
| <li><a href="#features">特性</a></li> | |
| <li><a href="#generator">生成器</a></li> | |
| <li><a href="#documentation">文档</a></li> | |
| <li><a href="https://mybatis-flex.com" target="_blank">文档</a></li> | |
| </ul> | |
| </nav> | |
| `; | |
| } | |
| } | |
| customElements.define('custom-navbar', CustomNavbar); |