Blame · Line-by-line history
layout.tsx
Each line is annotated with the commit that last touched it. Click any SHA to jump to that commit and see the surrounding change.
| fc1817a | 1 | import type { FC, PropsWithChildren } from "hono/jsx"; |
| 2 | ||
| 3 | export const Layout: FC<PropsWithChildren<{ title?: string }>> = ({ | |
| 4 | children, | |
| 5 | title, | |
| 6 | }) => { | |
| 7 | return ( | |
| 8 | <html lang="en"> | |
| 9 | <head> | |
| 10 | <meta charset="UTF-8" /> | |
| 11 | <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
| 12 | <title>{title ? `${title} — gluecron` : "gluecron"}</title> | |
| 13 | <style>{css}</style> | |
| 14 | </head> | |
| 15 | <body> | |
| 16 | <header> | |
| 17 | <nav> | |
| 18 | <a href="/" class="logo"> | |
| 19 | gluecron | |
| 20 | </a> | |
| 21 | </nav> | |
| 22 | </header> | |
| 23 | <main>{children}</main> | |
| 24 | <footer> | |
| 25 | <span>gluecron — AI-native code intelligence</span> | |
| 26 | </footer> | |
| 27 | </body> | |
| 28 | </html> | |
| 29 | ); | |
| 30 | }; | |
| 31 | ||
| 32 | const css = ` | |
| 33 | :root { | |
| 34 | --bg: #0d1117; | |
| 35 | --bg-secondary: #161b22; | |
| 36 | --bg-tertiary: #21262d; | |
| 37 | --border: #30363d; | |
| 38 | --text: #e6edf3; | |
| 39 | --text-muted: #8b949e; | |
| 40 | --text-link: #58a6ff; | |
| 41 | --accent: #1f6feb; | |
| 42 | --accent-hover: #388bfd; | |
| 43 | --green: #3fb950; | |
| 44 | --red: #f85149; | |
| 45 | --yellow: #d29922; | |
| 46 | --font-mono: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace; | |
| 47 | --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; | |
| 48 | --radius: 6px; | |
| 49 | } | |
| 50 | ||
| 51 | * { margin: 0; padding: 0; box-sizing: border-box; } | |
| 52 | ||
| 53 | body { | |
| 54 | font-family: var(--font-sans); | |
| 55 | background: var(--bg); | |
| 56 | color: var(--text); | |
| 57 | line-height: 1.5; | |
| 58 | min-height: 100vh; | |
| 59 | display: flex; | |
| 60 | flex-direction: column; | |
| 61 | } | |
| 62 | ||
| 63 | a { color: var(--text-link); text-decoration: none; } | |
| 64 | a:hover { text-decoration: underline; } | |
| 65 | ||
| 66 | header { | |
| 67 | border-bottom: 1px solid var(--border); | |
| 68 | padding: 12px 24px; | |
| 69 | background: var(--bg-secondary); | |
| 70 | } | |
| 71 | ||
| 72 | header nav { display: flex; align-items: center; gap: 20px; max-width: 1200px; margin: 0 auto; } | |
| 73 | .logo { font-size: 20px; font-weight: 700; color: var(--text); } | |
| 74 | .logo:hover { text-decoration: none; color: var(--text-link); } | |
| 75 | ||
| 76 | main { max-width: 1200px; margin: 0 auto; padding: 24px; flex: 1; width: 100%; } | |
| 77 | ||
| 78 | footer { | |
| 79 | border-top: 1px solid var(--border); | |
| 80 | padding: 16px 24px; | |
| 81 | text-align: center; | |
| 82 | color: var(--text-muted); | |
| 83 | font-size: 13px; | |
| 84 | } | |
| 85 | ||
| 86 | .repo-header { | |
| 87 | display: flex; | |
| 88 | align-items: center; | |
| 89 | gap: 8px; | |
| 90 | margin-bottom: 16px; | |
| 91 | font-size: 20px; | |
| 92 | } | |
| 93 | .repo-header .owner { color: var(--text-link); } | |
| 94 | .repo-header .separator { color: var(--text-muted); } | |
| 95 | .repo-header .name { color: var(--text-link); font-weight: 600; } | |
| 96 | ||
| 97 | .repo-nav { | |
| 98 | display: flex; | |
| 99 | gap: 0; | |
| 100 | border-bottom: 1px solid var(--border); | |
| 101 | margin-bottom: 20px; | |
| 102 | } | |
| 103 | .repo-nav a { | |
| 104 | padding: 8px 16px; | |
| 105 | color: var(--text-muted); | |
| 106 | border-bottom: 2px solid transparent; | |
| 107 | font-size: 14px; | |
| 108 | } | |
| 109 | .repo-nav a:hover { text-decoration: none; color: var(--text); } | |
| 110 | .repo-nav a.active { color: var(--text); border-bottom-color: var(--accent); } | |
| 111 | ||
| 112 | .breadcrumb { display: flex; gap: 4px; align-items: center; margin-bottom: 16px; color: var(--text-muted); font-size: 14px; } | |
| 113 | .breadcrumb a { color: var(--text-link); } | |
| 114 | ||
| 115 | .file-table { width: 100%; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; } | |
| 116 | .file-table tr { border-bottom: 1px solid var(--border); } | |
| 117 | .file-table tr:last-child { border-bottom: none; } | |
| 118 | .file-table td { padding: 8px 16px; font-size: 14px; } | |
| 119 | .file-table tr:hover { background: var(--bg-secondary); } | |
| 120 | .file-icon { width: 20px; color: var(--text-muted); } | |
| 121 | .file-name a { color: var(--text); } | |
| 122 | .file-name a:hover { color: var(--text-link); text-decoration: underline; } | |
| 123 | ||
| 124 | .blob-view { | |
| 125 | border: 1px solid var(--border); | |
| 126 | border-radius: var(--radius); | |
| 127 | overflow: hidden; | |
| 128 | } | |
| 129 | .blob-header { | |
| 130 | background: var(--bg-secondary); | |
| 131 | padding: 8px 16px; | |
| 132 | border-bottom: 1px solid var(--border); | |
| 133 | font-size: 13px; | |
| 134 | color: var(--text-muted); | |
| 135 | } | |
| 136 | .blob-code { | |
| 137 | overflow-x: auto; | |
| 138 | font-family: var(--font-mono); | |
| 139 | font-size: 13px; | |
| 140 | line-height: 1.6; | |
| 141 | } | |
| 142 | .blob-code table { width: 100%; border-collapse: collapse; } | |
| 143 | .blob-code .line-num { | |
| 144 | width: 1%; | |
| 145 | min-width: 50px; | |
| 146 | padding: 0 12px; | |
| 147 | text-align: right; | |
| 148 | color: var(--text-muted); | |
| 149 | user-select: none; | |
| 150 | white-space: nowrap; | |
| 151 | border-right: 1px solid var(--border); | |
| 152 | } | |
| 153 | .blob-code .line-content { padding: 0 12px; white-space: pre; } | |
| 154 | ||
| 155 | .commit-list { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; } | |
| 156 | .commit-item { | |
| 157 | display: flex; | |
| 158 | justify-content: space-between; | |
| 159 | align-items: center; | |
| 160 | padding: 12px 16px; | |
| 161 | border-bottom: 1px solid var(--border); | |
| 162 | } | |
| 163 | .commit-item:last-child { border-bottom: none; } | |
| 164 | .commit-item:hover { background: var(--bg-secondary); } | |
| 165 | .commit-message { font-size: 14px; font-weight: 500; } | |
| 166 | .commit-meta { font-size: 12px; color: var(--text-muted); } | |
| 167 | .commit-sha { | |
| 168 | font-family: var(--font-mono); | |
| 169 | font-size: 12px; | |
| 170 | padding: 2px 8px; | |
| 171 | background: var(--bg-tertiary); | |
| 172 | border: 1px solid var(--border); | |
| 173 | border-radius: var(--radius); | |
| 174 | color: var(--text-link); | |
| 175 | } | |
| 176 | ||
| 177 | .diff-view { margin-top: 16px; } | |
| 178 | .diff-file { | |
| 179 | border: 1px solid var(--border); | |
| 180 | border-radius: var(--radius); | |
| 181 | margin-bottom: 16px; | |
| 182 | overflow: hidden; | |
| 183 | } | |
| 184 | .diff-file-header { | |
| 185 | background: var(--bg-secondary); | |
| 186 | padding: 8px 16px; | |
| 187 | border-bottom: 1px solid var(--border); | |
| 188 | font-family: var(--font-mono); | |
| 189 | font-size: 13px; | |
| 190 | } | |
| 191 | .diff-content { | |
| 192 | overflow-x: auto; | |
| 193 | font-family: var(--font-mono); | |
| 194 | font-size: 13px; | |
| 195 | line-height: 1.6; | |
| 196 | } | |
| 197 | .diff-content .line-add { background: rgba(63, 185, 80, 0.15); color: var(--green); } | |
| 198 | .diff-content .line-del { background: rgba(248, 81, 73, 0.1); color: var(--red); } | |
| 199 | .diff-content .line-hunk { background: rgba(56, 139, 253, 0.1); color: var(--text-link); } | |
| 200 | .diff-content .line { padding: 0 12px; white-space: pre; display: block; } | |
| 201 | ||
| 202 | .stat-add { color: var(--green); font-weight: 600; } | |
| 203 | .stat-del { color: var(--red); font-weight: 600; } | |
| 204 | ||
| 205 | .empty-state { | |
| 206 | text-align: center; | |
| 207 | padding: 60px 20px; | |
| 208 | color: var(--text-muted); | |
| 209 | } | |
| 210 | .empty-state h2 { font-size: 24px; margin-bottom: 8px; color: var(--text); } | |
| 211 | .empty-state pre { | |
| 212 | text-align: left; | |
| 213 | display: inline-block; | |
| 214 | background: var(--bg-secondary); | |
| 215 | padding: 16px 24px; | |
| 216 | border-radius: var(--radius); | |
| 217 | border: 1px solid var(--border); | |
| 218 | font-family: var(--font-mono); | |
| 219 | font-size: 13px; | |
| 220 | margin-top: 16px; | |
| 221 | line-height: 1.8; | |
| 222 | } | |
| 223 | ||
| 224 | .badge { | |
| 225 | display: inline-block; | |
| 226 | padding: 2px 8px; | |
| 227 | border-radius: 12px; | |
| 228 | font-size: 12px; | |
| 229 | font-weight: 500; | |
| 230 | background: var(--bg-tertiary); | |
| 231 | border: 1px solid var(--border); | |
| 232 | color: var(--text-muted); | |
| 233 | } | |
| 234 | ||
| 235 | .branch-selector { | |
| 236 | display: inline-flex; | |
| 237 | align-items: center; | |
| 238 | gap: 4px; | |
| 239 | padding: 4px 12px; | |
| 240 | background: var(--bg-tertiary); | |
| 241 | border: 1px solid var(--border); | |
| 242 | border-radius: var(--radius); | |
| 243 | font-size: 13px; | |
| 244 | color: var(--text); | |
| 245 | margin-bottom: 12px; | |
| 246 | } | |
| 247 | ||
| 248 | .card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; } | |
| 249 | .card { | |
| 250 | border: 1px solid var(--border); | |
| 251 | border-radius: var(--radius); | |
| 252 | padding: 16px; | |
| 253 | background: var(--bg-secondary); | |
| 254 | } | |
| 255 | .card h3 { font-size: 16px; margin-bottom: 4px; } | |
| 256 | .card p { font-size: 13px; color: var(--text-muted); } | |
| 257 | `; |