(title: string, body: string)
| 423 | } |
| 424 | |
| 425 | function passwordShell(title: string, body: string): string { |
| 426 | return `<!doctype html> |
| 427 | <html lang="en"> |
| 428 | <head> |
| 429 | <meta charset="utf-8" /> |
| 430 | <meta name="viewport" content="width=device-width, initial-scale=1" /> |
| 431 | <title>${escapeHtml(title)}</title> |
| 432 | <style> |
| 433 | :root { color-scheme: light dark; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; } |
| 434 | body { min-height: 100vh; margin: 0; display: grid; place-items: center; background: #0e1116; color: #f4f7fb; } |
| 435 | main { width: min(100% - 32px, 420px); } |
| 436 | h1 { font-size: 1.45rem; margin: 0 0 12px; letter-spacing: 0; } |
| 437 | p { color: #aab5c3; line-height: 1.5; margin: 0 0 18px; } |
| 438 | .details { color: #d7deea; font-size: 0.92rem; } |
| 439 | .error { color: #ffb4a9; } |
| 440 | form { display: grid; gap: 14px; } |
| 441 | label { display: grid; gap: 8px; color: #d7deea; font-size: 0.92rem; } |
| 442 | input { border: 1px solid #354153; border-radius: 8px; background: #151a22; color: #f4f7fb; font: inherit; padding: 11px 12px; } |
| 443 | button { border: 0; border-radius: 8px; background: #37c57b; color: #07110b; font: inherit; font-weight: 700; padding: 11px 14px; cursor: pointer; } |
| 444 | button:hover { background: #4bdd8f; } |
| 445 | </style> |
| 446 | </head> |
| 447 | <body> |
| 448 | <main> |
| 449 | <h1>${escapeHtml(title)}</h1> |
| 450 | ${body} |
| 451 | </main> |
| 452 | </body> |
| 453 | </html>`; |
| 454 | } |
| 455 | |
| 456 | function jsonResponse(value: unknown, status = 200): Response { |
| 457 | return new Response(JSON.stringify(value), { |
no test coverage detected