File size: 13,196 Bytes
42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 2a72aeb 37b5223 2a72aeb 37b5223 2a72aeb 37b5223 42a0d15 37b5223 42a0d15 37b5223 4b8e879 42a0d15 37b5223 42a0d15 37b5223 2a72aeb 42a0d15 4b8e879 37b5223 42a0d15 4b8e879 37b5223 42a0d15 37b5223 2a72aeb 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 4b8e879 37b5223 4b8e879 37b5223 4b8e879 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 37b5223 42a0d15 | 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 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 | <template>
<div class="app-shell">
<!-- Top Bar -->
<header class="app-header">
<div class="flag-stripes" aria-hidden="true">
<span class="stripe black" />
<span class="stripe fimbriation" />
<span class="stripe red" />
<span class="stripe fimbriation" />
<span class="stripe green" />
</div>
<div class="header-inner">
<router-link to="/" class="brand">
<div class="brand-mark" aria-hidden="true">
<svg viewBox="0 0 48 56" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M4 6 L24 2 L44 6 L44 30 C44 42 35 50 24 54 C13 50 4 42 4 30 Z"
stroke="currentColor" stroke-width="2" fill="none" />
<path d="M14 18 H34 M14 26 H34 M14 34 H28" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" />
<circle cx="24" cy="10" r="2" fill="currentColor" />
</svg>
</div>
<div class="brand-text">
<h1 class="brand-name">Ukweli</h1>
<span class="brand-tagline">ukweli · truth</span>
</div>
</router-link>
<nav class="main-nav" :class="{ 'mobile-open': mobileMenuOpen }">
<router-link
v-for="item in navItems"
:key="item.path"
:to="item.path"
class="nav-link"
:class="{ active: route.path.startsWith(item.path) && (item.path !== '/' || route.path === '/') }"
@click="mobileMenuOpen = false"
>
<n-icon size="18" class="nav-icon">
<component :is="item.icon" />
</n-icon>
<span class="nav-label">{{ item.label }}</span>
</router-link>
</nav>
<div class="header-actions">
<RateLimitPill />
<n-tooltip placement="bottom">
<template #trigger>
<button class="icon-btn" @click="themeStore.toggle()" :aria-label="`Switch to ${themeStore.theme === 'light' ? 'dark' : 'light'} mode`">
<n-icon size="18">
<sunny-outline v-if="themeStore.theme === 'dark'" />
<moon-outline v-else />
</n-icon>
</button>
</template>
{{ themeStore.theme === 'dark' ? 'Light mode' : 'Dark mode' }}
</n-tooltip>
<UserMenu v-if="authStore.isAuthenticated" />
<n-button
v-else
size="small"
type="primary"
@click="authStore.openAuthModal()"
class="signin-btn"
>
Sign in
</n-button>
<button
class="icon-btn mobile-menu-btn"
@click="mobileMenuOpen = !mobileMenuOpen"
aria-label="Menu"
>
<n-icon size="20">
<close-outline v-if="mobileMenuOpen" />
<menu-outline v-else />
</n-icon>
</button>
</div>
</div>
</header>
<!-- Main Content -->
<main class="app-main">
<router-view v-slot="{ Component, route }">
<transition name="fade" mode="out-in">
<component :is="Component" :key="route.path" />
</transition>
</router-view>
</main>
<!-- Footer -->
<footer class="app-footer">
<div class="footer-inner">
<div class="footer-brand">
<div class="brand-mark small" aria-hidden="true">
<svg viewBox="0 0 48 56" fill="none">
<path d="M4 6 L24 2 L44 6 L44 30 C44 42 35 50 24 54 C13 50 4 42 4 30 Z"
stroke="currentColor" stroke-width="2" fill="none" />
<path d="M14 18 H34 M14 26 H34 M14 34 H28" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" />
</svg>
</div>
<p class="footer-tag">
<strong>Ukweli</strong> — Democratizing access to Kenya's public
audit information. Built in the spirit of Article 35.
</p>
</div>
<div class="footer-cols">
<div class="footer-col">
<h5>Resources</h5>
<router-link to="/about">About Ukweli</router-link>
<router-link to="/methodology">Methodology</router-link>
<router-link to="/coverage">Data Coverage</router-link>
<router-link to="/changelog">Changelog</router-link>
<router-link to="/status">System Status</router-link>
</div>
<div class="footer-col">
<h5>Legal</h5>
<router-link to="/terms">Terms of Service</router-link>
<router-link to="/privacy">Privacy Policy</router-link>
<router-link to="/acceptable-use">Acceptable Use</router-link>
<router-link to="/disclaimer">Disclaimer</router-link>
</div>
<div class="footer-col">
<h5>External</h5>
<a href="https://www.oagkenya.go.ke" target="_blank" rel="noopener">OAG Kenya</a>
<a href="https://www.treasury.go.ke" target="_blank" rel="noopener">National Treasury</a>
<p style="font-size: 11px; margin-top: 8px; color: var(--text-muted);">Built in the spirit of Article 35.</p>
</div>
</div>
</div>
<div class="footer-bottom">
<div class="flag-stripes small" aria-hidden="true">
<span class="stripe black" />
<span class="stripe fimbriation" />
<span class="stripe red" />
<span class="stripe fimbriation" />
<span class="stripe green" />
</div>
<p>Built for transparency. Harambee.</p>
</div>
</footer>
<AuthModal />
</div>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue'
import { useRoute } from 'vue-router'
import { useAuthStore } from '@/stores/auth'
import { useThemeStore } from '@/stores/theme'
import {
SearchOutline,
ChatbubblesOutline,
CompassOutline,
ShareSocialOutline,
InformationCircleOutline,
SunnyOutline,
MoonOutline,
MenuOutline,
CloseOutline,
KeyOutline,
} from '@vicons/ionicons5'
import AuthModal from './AuthModal.vue'
import RateLimitPill from './RateLimitPill.vue'
import UserMenu from './UserMenu.vue'
const route = useRoute()
const authStore = useAuthStore()
const themeStore = useThemeStore()
const mobileMenuOpen = ref(false)
const navItems = [
{ path: '/', label: 'Search', icon: SearchOutline },
{ path: '/chat', label: 'Ask', icon: ChatbubblesOutline },
{ path: '/explore', label: 'Explore', icon: CompassOutline },
{ path: '/graph', label: 'Graph', icon: ShareSocialOutline },
{ path: '/about', label: 'About', icon: InformationCircleOutline },
{ path: '/api-keys', label: 'API Keys', icon: KeyOutline },
]
onMounted(() => {
authStore.initialize()
})
</script>
<style scoped lang="scss">
.app-shell {
min-height: 100vh;
display: flex;
flex-direction: column;
background: var(--bg-page);
}
// =============================================================================
// HEADER
// =============================================================================
.app-header {
position: sticky;
top: 0;
z-index: 100;
background: var(--bg-card);
border-bottom: 1px solid var(--border);
backdrop-filter: blur(12px);
}
.flag-stripes {
display: flex;
width: 100%;
height: 4px;
.stripe { flex: 1; transition: filter 0.3s var(--ease-out); }
.stripe.black { background: var(--ke-black); flex: 1.4; }
.stripe.fimbriation { background: var(--ke-white); flex: 0.15; }
.stripe.red { background: var(--ke-red); flex: 1.2; }
.stripe.green { background: var(--ke-green); flex: 1.4; }
&.small {
height: 2px;
max-width: 80px;
border-radius: 2px;
overflow: hidden;
}
}
.header-inner {
max-width: 1400px;
margin: 0 auto;
padding: 0 28px;
height: 68px;
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
}
.brand {
display: flex;
align-items: center;
gap: 12px;
text-decoration: none;
color: var(--text-primary);
flex-shrink: 0;
transition: opacity 0.2s var(--ease-out);
&:hover { opacity: 0.85; }
}
.brand-mark {
width: 38px;
height: 44px;
color: var(--primary);
&.small { width: 28px; height: 32px; }
}
.brand-text {
display: flex;
flex-direction: column;
line-height: 1.1;
}
.brand-name {
font-family: var(--font-display);
font-size: 22px;
font-weight: 700;
color: var(--text-primary);
letter-spacing: -0.02em;
margin: 0;
}
.brand-tagline {
font-size: 10px;
text-transform: uppercase;
letter-spacing: 0.12em;
color: var(--text-muted);
font-weight: 600;
margin-top: 2px;
}
.main-nav {
display: flex;
gap: 2px;
background: var(--bg-elevated);
padding: 4px;
border-radius: 999px;
border: 1px solid var(--border);
}
.nav-link {
display: flex;
align-items: center;
gap: 6px;
padding: 7px 14px;
border-radius: 999px;
color: var(--text-secondary);
text-decoration: none;
font-weight: 600;
font-size: 13px;
transition: all 0.2s var(--ease-out);
white-space: nowrap;
&:hover {
color: var(--text-primary);
background: var(--bg-card);
}
&.active {
background: var(--primary);
color: white;
box-shadow: 0 2px 6px rgba(0, 102, 0, 0.25);
}
}
.nav-label { letter-spacing: 0.01em; }
.header-actions {
display: flex;
align-items: center;
gap: 10px;
flex-shrink: 0;
}
.icon-btn {
display: inline-flex;
align-items: center;
justify-content: center;
width: 36px;
height: 36px;
border-radius: 10px;
background: transparent;
border: 1px solid transparent;
color: var(--text-secondary);
cursor: pointer;
transition: all 0.2s var(--ease-out);
&:hover {
background: var(--bg-elevated);
color: var(--text-primary);
}
}
.signin-btn {
font-weight: 700;
letter-spacing: 0.02em;
border-radius: 10px;
}
.mobile-menu-btn { display: none; }
// =============================================================================
// MAIN
// =============================================================================
.app-main {
flex: 1;
max-width: 1400px;
width: 100%;
margin: 0 auto;
padding: 32px 28px;
}
// =============================================================================
// FOOTER
// =============================================================================
.app-footer {
background: var(--bg-card);
border-top: 1px solid var(--border);
margin-top: 64px;
}
.footer-inner {
max-width: 1400px;
margin: 0 auto;
padding: 56px 28px 32px;
display: grid;
grid-template-columns: 1.2fr 2fr;
gap: 56px;
}
.footer-brand {
display: flex;
flex-direction: column;
gap: 16px;
}
.footer-tag {
font-size: 14px;
line-height: 1.6;
color: var(--text-secondary);
max-width: 340px;
strong {
font-family: var(--font-display);
color: var(--text-primary);
font-size: 16px;
}
}
.footer-cols {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 32px;
}
.footer-col {
display: flex;
flex-direction: column;
gap: 8px;
h5 {
font-family: var(--font-body);
font-size: 11px;
text-transform: uppercase;
letter-spacing: 0.12em;
color: var(--text-muted);
font-weight: 700;
margin-bottom: 8px;
}
a, p {
font-size: 13px;
color: var(--text-secondary);
text-decoration: none;
line-height: 1.7;
transition: color 0.2s var(--ease-out);
}
a:hover { color: var(--primary); }
}
.footer-bottom {
border-top: 1px solid var(--border);
padding: 24px 28px;
display: flex;
align-items: center;
justify-content: space-between;
max-width: 1400px;
margin: 0 auto;
gap: 16px;
p {
font-size: 12px;
color: var(--text-muted);
font-style: italic;
}
}
// =============================================================================
// MOBILE
// =============================================================================
@media (max-width: 768px) {
.header-inner {
padding: 0 16px;
height: 60px;
}
.brand-name { font-size: 18px; }
.brand-tagline { display: none; }
.main-nav {
position: fixed;
top: 64px;
left: 0;
right: 0;
background: var(--bg-card);
flex-direction: column;
padding: 16px;
gap: 4px;
border-radius: 0;
border: none;
border-bottom: 1px solid var(--border);
box-shadow: var(--shadow-lg);
transform: translateY(-110%);
opacity: 0;
pointer-events: none;
transition: all 0.3s var(--ease-out);
z-index: 99;
&.mobile-open {
transform: translateY(0);
opacity: 1;
pointer-events: all;
}
.nav-link {
width: 100%;
border-radius: var(--radius-md);
padding: 12px 16px;
justify-content: flex-start;
}
}
.mobile-menu-btn { display: inline-flex; }
.signin-btn { display: none; }
.app-main { padding: 20px 16px; }
.footer-inner {
grid-template-columns: 1fr;
padding: 40px 16px 24px;
gap: 32px;
}
.footer-cols { grid-template-columns: 1fr; gap: 24px; }
.footer-bottom { flex-direction: column; align-items: flex-start; }
}
</style>
|