Replace page glow with a flat outline and add a canvas grid

Pages now get a crisp 1 screen-px outline instead of a blurred shadow,
and the canvas background shows faint world-anchored grid lines that
pan and zoom with the pages (spacing steps up ×4 when zoomed out).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
agent 2026-09-27 17:27:39 +00:00
parent 964b3b1cdd
commit 4acb3a614c
3 changed files with 19 additions and 4 deletions

View file

@ -28,6 +28,13 @@
let stage: HTMLDivElement;
const cssVars = pageCssVars();
// Background grid: world-anchored, stepping up ×4 when zoomed out so lines never get denser than ~12px.
const gridStep = $derived.by(() => {
let step = 24 * viewport.scale;
while (step < 12) step *= 4;
return step;
});
// ---- autosave --------------------------------------------------------
$effect(() => {
if (doc.version > 0) untrack(() => workspace.scheduleSave());
@ -522,6 +529,7 @@
class:panning
class:erasing={tools.tool === 'eraser'}
bind:this={stage}
style="--grid: {gridStep}px; background-position: {viewport.x}px {viewport.y}px"
onpointerdown={onPointerDown}
onpointermove={onPointerMove}
onpointerup={onPointerUp}
@ -660,7 +668,11 @@
touch-action: none;
user-select: none;
-webkit-user-select: none;
background: var(--bg-canvas);
background-color: var(--bg-canvas);
background-image:
linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
background-size: var(--grid) var(--grid);
}
.stage :global(.cm-content) {
user-select: text;