Give the phone its own harbour UI instead of a squeezed desktop.

Full-screen water with a floating dock and bottom sheet for detail, clearer boats and Gas actions, plus a branded gate and a fixed sheet-over-scrim stack.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-11-08 01:59:40 +07:00
parent da05aeb503
commit 2a0b65c30b
4 changed files with 335 additions and 67 deletions

View File

@@ -86,6 +86,9 @@ const TYPES: Record<string, string> = { '.html': 'text/html; charset=utf-8', '.j
const escapeHtml = (s: string) => s.replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[c]!);
const PAGE_HEAD = `<meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover"><meta name="theme-color" content="#9DCAC3"><link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin><link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600&family=Atkinson+Hyperlegible:wght@400;700&display=swap"><link rel="stylesheet" href="/board.css"><link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='16' fill='%23172B33'/%3E%3Cpath d='M22 14V42H44' fill='none' stroke='%23F6F2EA' stroke-width='8' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='44' cy='26' r='5.5' fill='%23E8A33D'/%3E%3C/svg%3E">`;
const BRAND_MARK = `<header class="brand"><svg width="36" height="36" viewBox="0 0 64 64" aria-hidden="true"><rect width="64" height="64" rx="16" fill="#172B33"/><path d="M22 14V42H44" fill="none" stroke="#F6F2EA" stroke-width="8" stroke-linecap="round" stroke-linejoin="round"/><circle cx="44" cy="26" r="5.5" fill="#E8A33D"/></svg><span>labuh</span></header>`;
// The rubric as a plain page with an anchor per rule (`## R9 · …` → #r9).
function rubricPage(md: string): string {
const body = md
@@ -97,7 +100,7 @@ function rubricPage(md: string): string {
return `<h${h[1].length}${id ? ` id="${id}"` : ''}>${escapeHtml(h[2])}</h${h[1].length}>`;
})
.join('\n');
return `<!doctype html><html lang="id"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>Rubrik Labuh</title><link rel="stylesheet" href="/board.css"></head><body class="page-rubric"><main>${body}</main></body></html>`;
return `<!doctype html><html lang="id"><head>${PAGE_HEAD}<title>Rubrik Labuh</title></head><body class="page-rubric"><main>${body}</main></body></html>`;
}
const ACTIONS: Action[] = ['gas', 'tunda', 'tolak', 'close', 'undo'];
@@ -144,7 +147,7 @@ export function createBoard(store: Store, cfg: BoardConfig, projects: string[],
};
const json = (res: http.ServerResponse, status: number, data: unknown) => send(res, status, 'application/json; charset=utf-8', JSON.stringify(data));
const page = (res: http.ServerResponse, status: number, title: string, text: string, action = '') =>
send(res, status, TYPES['.html'], `<!doctype html><html lang="id"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>Labuh</title><link rel="stylesheet" href="/board.css"></head><body class="page-gate"><main><h1>${escapeHtml(title)}</h1><p>${escapeHtml(text)}</p>${action}</main></body></html>`);
send(res, status, TYPES['.html'], `<!doctype html><html lang="id"><head>${PAGE_HEAD}<title>Labuh</title></head><body class="page-gate"><main>${BRAND_MARK}<h1>${escapeHtml(title)}</h1><p>${escapeHtml(text)}</p>${action}</main></body></html>`);
const viewerOf = (req: http.IncomingMessage): Viewer | null => {
// Approver rights follow board.json on every request, so adding or removing one needs no new sign-in.