Skip to content

gitflarePublicPartly agent-ready50

cf-durable-whiteboard

Realtime collaborative whiteboard on Cloudflare Durable Objects: presence cursors, WebSocket hibernation, SQLite storage, undo, PNG export.

Keep board zoom and pan stable across reloads6eb4fbd
HTML26 lines3.0 KB
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Board · Durable Whiteboard</title><meta name="description" content="Collaborative whiteboard board."><meta name="theme-color" content="#0f1420"><link rel="icon" href="/favicon.svg" type="image/svg+xml"><link rel="stylesheet" href="/style.css"></head><body class="board-page"><header class="top"><a class="brand" href="/" aria-label="Durable Whiteboard home"><svg width="24" height="24" viewBox="0 0 32 32" aria-hidden="true"><path d="M6 22c4-10 7 2 10-8 1-3 3-4 8-4" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round"/></svg></a><h1 class="board-title">Board <code id="bid"></code></h1><button class="btn" id="copy" type="button">Copy link</button><span class="conn" id="status" role="status" aria-live="polite" data-state="connecting"><i></i><span>Connecting…</span></span><div class="people" id="people" aria-label="People here"><span id="count" aria-live="polite"></span><ul id="avatars"></ul></div></header><div class="stage" id="stage"><canvas id="board" aria-label="Whiteboard canvas. Draw with pointer or touch."></canvas><div id="cursors" aria-hidden="true"></div><div class="skel" id="loading">Loading board…</div><div class="empty-hint" id="empty" hidden>Empty board. Pick a tool and draw something.</div><div class="zoom"><button class="icon" id="zout" type="button" aria-label="Zoom out">−</button><button class="btn" id="zlabel" type="button" aria-label="Reset zoom">100%</button><button class="icon" id="zin" type="button" aria-label="Zoom in">+</button></div></div><nav class="dock" id="dock" aria-label="Drawing tools"><div class="grp" id="tools" role="group" aria-label="Tools"></div><div class="grp" id="sizes" role="group" aria-label="Pen size"></div><div class="grp" id="colours" role="group" aria-label="Colour"></div><div class="grp" role="group" aria-label="Actions"><button class="icon" id="undo" type="button" aria-label="Undo (Ctrl+Z)"></button><button class="icon" id="redo" type="button" aria-label="Redo (Ctrl+Shift+Z)"></button><button class="icon" id="clear" type="button" aria-label="Clear board"></button><button class="icon" id="export" type="button" aria-label="Export PNG"></button></div></nav><dialog id="dlg-clear" aria-labelledby="t1"><form method="dialog"><h2 id="t1">Clear the whole board?</h2><p>Everyone will see it empty. You can undo this.</p><div class="row"><button class="btn" value="cancel">Cancel</button><button class="btn danger" value="ok">Clear board</button></div></form></dialog><dialog id="dlg-export" aria-labelledby="t2"><form method="dialog"><h2 id="t2">Export PNG</h2><div class="row"><button class="btn" value="view">Visible area</button><button class="btn primary" value="all">Everything</button><button class="btn" value="cancel">Cancel</button></div></form></dialog><div class="toast" id="toast" role="status" aria-live="polite"></div><script type="module" src="/app.js"></script></body></html>