|
1 | 1 | {{define "header"}} |
2 | 2 | <header class="sticky top-0 z-50 border-b border-gray-200 dark:border-gray-800 bg-white/80 dark:bg-gray-900/80 backdrop-blur-sm"> |
3 | 3 | <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8"> |
4 | | - <div class="flex justify-between items-center h-16"> |
5 | | - <div class="flex items-center gap-2"> |
| 4 | + <div class="flex justify-between items-center h-16 gap-4"> |
| 5 | + <a href="/ui/" class="flex items-center gap-2 text-xl font-semibold hover:text-gray-700 dark:hover:text-gray-300 shrink-0"> |
6 | 6 | <svg class="w-8 h-8 text-primary-600 dark:text-primary-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"> |
7 | 7 | <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4"/> |
8 | 8 | </svg> |
9 | | - <a href="/ui/" class="text-xl font-semibold hover:text-gray-700 dark:hover:text-gray-300">git-pkgs proxy</a> |
10 | | - </div> |
11 | | - <div class="flex-1 max-w-md mx-8"> |
12 | | - <form action="/ui/search" method="get" class="relative"> |
13 | | - <input |
14 | | - type="text" |
15 | | - name="q" |
16 | | - placeholder="Search packages..." |
17 | | - class="w-full px-4 py-2 pl-10 text-sm bg-gray-100 dark:bg-gray-800 border border-gray-300 dark:border-gray-700 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400" |
18 | | - /> |
19 | | - <svg class="absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"> |
20 | | - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/> |
21 | | - </svg> |
22 | | - </form> |
| 9 | + <span>git-pkgs proxy</span> |
| 10 | + </a> |
| 11 | + <div class="hidden md:block flex-1 max-w-md mx-4"> |
| 12 | + {{template "search_form" .}} |
23 | 13 | </div> |
24 | | - <nav class="flex items-center gap-6"> |
25 | | - <a href="/ui/install" class="text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100">Install</a> |
26 | | - <a href="/health" class="text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100">Health</a> |
27 | | - <a href="/stats" class="text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100">API</a> |
28 | | - <button id="theme-toggle" class="p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors"> |
| 14 | + <nav class="hidden md:flex items-center gap-6"> |
| 15 | + {{template "nav_links" .}} |
| 16 | + </nav> |
| 17 | + <div class="flex items-center gap-2"> |
| 18 | + <button id="theme-toggle" class="p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors" aria-label="Toggle theme"> |
29 | 19 | <svg class="w-5 h-5 hidden dark:block" fill="currentColor" viewBox="0 0 20 20"> |
30 | 20 | <path d="M10 2a1 1 0 011 1v1a1 1 0 11-2 0V3a1 1 0 011-1zm4 8a4 4 0 11-8 0 4 4 0 018 0zm-.464 4.95l.707.707a1 1 0 001.414-1.414l-.707-.707a1 1 0 00-1.414 1.414zm2.12-10.607a1 1 0 010 1.414l-.706.707a1 1 0 11-1.414-1.414l.707-.707a1 1 0 011.414 0zM17 11a1 1 0 100-2h-1a1 1 0 100 2h1zm-7 4a1 1 0 011 1v1a1 1 0 11-2 0v-1a1 1 0 011-1zM5.05 6.464A1 1 0 106.465 5.05l-.708-.707a1 1 0 00-1.414 1.414l.707.707zm1.414 8.486l-.707.707a1 1 0 01-1.414-1.414l.707-.707a1 1 0 011.414 1.414zM4 11a1 1 0 100-2H3a1 1 0 000 2h1z"/> |
31 | 21 | </svg> |
32 | 22 | <svg class="w-5 h-5 block dark:hidden" fill="currentColor" viewBox="0 0 20 20"> |
33 | 23 | <path d="M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z"/> |
34 | 24 | </svg> |
35 | 25 | </button> |
| 26 | + <button id="nav-toggle" type="button" class="md:hidden p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors" aria-label="Toggle menu" aria-expanded="false" aria-controls="mobile-nav"> |
| 27 | + <span class="nav-icon-open"><i data-lucide="menu" class="w-5 h-5"></i></span> |
| 28 | + <span class="nav-icon-close hidden"><i data-lucide="x" class="w-5 h-5"></i></span> |
| 29 | + </button> |
| 30 | + </div> |
| 31 | + </div> |
| 32 | + <div id="mobile-nav" class="hidden md:hidden pb-4 space-y-3"> |
| 33 | + {{template "search_form" .}} |
| 34 | + <nav class="flex flex-col"> |
| 35 | + {{template "nav_links" .}} |
36 | 36 | </nav> |
37 | 37 | </div> |
38 | 38 | </div> |
39 | 39 | </header> |
40 | 40 | {{end}} |
| 41 | + |
| 42 | +{{define "search_form"}} |
| 43 | +<form action="/ui/search" method="get" class="relative"> |
| 44 | + <input |
| 45 | + type="text" |
| 46 | + name="q" |
| 47 | + placeholder="Search packages..." |
| 48 | + class="w-full px-4 py-2 pl-10 text-sm bg-gray-100 dark:bg-gray-800 border border-gray-300 dark:border-gray-700 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400" |
| 49 | + /> |
| 50 | + <svg class="absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"> |
| 51 | + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/> |
| 52 | + </svg> |
| 53 | +</form> |
| 54 | +{{end}} |
| 55 | + |
| 56 | +{{define "nav_links"}} |
| 57 | +<a href="/ui/install" class="text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 py-2 md:py-0">Install</a> |
| 58 | +<a href="/health" class="text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 py-2 md:py-0">Health</a> |
| 59 | +<a href="/stats" class="text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 py-2 md:py-0">API</a> |
| 60 | +{{end}} |
0 commit comments