File size: 5,674 Bytes
c3fa188 |
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 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 |
class CustomNavbar extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
nav {
background: linear-gradient(90deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.95) 100%);
backdrop-filter: blur(10px);
border-bottom: 1px solid rgba(6, 182, 212, 0.2);
position: sticky;
top: 0;
z-index: 1000;
padding: 1rem 0;
}
.nav-container {
max-width: 1200px;
margin: 0 auto;
padding: 0 1rem;
display: flex;
justify-content: space-between;
align-items: center;
}
.logo {
display: flex;
align-items: center;
gap: 12px;
text-decoration: none;
color: white;
font-weight: 700;
font-size: 1.5rem;
}
.logo-icon {
width: 40px;
height: 40px;
background: linear-gradient(45deg, #06b6d4, #8b5cf6);
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
animation: pulse 2s infinite;
}
@keyframes pulse {
0%, 100% { transform: scale(1); }
50% { transform: scale(1.05); }
}
.logo-text {
background: linear-gradient(45deg, #06b6d4, #8b5cf6);
background-clip: text;
-webkit-background-clip: text;
color: transparent;
}
.nav-links {
display: flex;
gap: 2rem;
align-items: center;
}
.nav-link {
color: #cbd5e1;
text-decoration: none;
font-weight: 500;
transition: all 0.3s ease;
padding: 0.5rem 1rem;
border-radius: 6px;
display: flex;
align-items: center;
gap: 8px;
}
.nav-link:hover {
color: white;
background: rgba(6, 182, 212, 0.1);
transform: translateY(-2px);
}
.nav-link i {
width: 18px;
height: 18px;
}
.system-indicator {
display: flex;
align-items: center;
gap: 8px;
padding: 0.5rem 1rem;
background: rgba(16, 185, 129, 0.1);
border-radius: 6px;
font-size: 0.875rem;
color: #10b981;
}
.indicator-dot {
width: 8px;
height: 8px;
background: #10b981;
border-radius: 50%;
animation: pulse 2s infinite;
}
@media (max-width: 768px) {
.nav-links {
display: none;
}
.mobile-menu-btn {
display: block;
}
}
</style>
<nav>
<div class="nav-container">
<a href="/" class="logo">
<div class="logo-icon">
<i data-feather="cpu"></i>
</div>
<span class="logo-text">QCWE</span>
</a>
<div class="nav-links">
<a href="/" class="nav-link">
<i data-feather="home"></i>
Dashboard
</a>
<a href="/graph" class="nav-link">
<i data-feather="git-merge"></i>
Graph Explorer
</a>
<a href="/workers" class="nav-link">
<i data-feather="activity"></i>
Worker Monitor
</a>
<a href="/settings" class="nav-link">
<i data-feather="settings"></i>
Settings
</a>
<div class="system-indicator">
<span class="indicator-dot"></span>
<span>System Operational</span>
</div>
</div>
</div>
</nav>
`;
// Feather icons need to be replaced after insertion
setTimeout(() => {
if (window.feather) {
feather.replace();
}
}, 100);
}
}
customElements.define('custom-navbar', CustomNavbar); |