From 6316fd21b9c26e17ee70c0fe36999be7601ba761 Mon Sep 17 00:00:00 2001
From: Claude
Date: Tue, 14 Apr 2026 20:06:43 +0000
Subject: [PATCH] =?UTF-8?q?Add=20Mouse=20&=20Cheese=20demo=20=E2=80=94=20o?=
=?UTF-8?q?bstacle-aware=20text=20layout=20with=20cute=20illustration?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
A new demo page (/demos/mouse-cheese) showing Pretext's layoutNextLine()
used for per-line variable-width layout: each story line gets a narrower
available width while it overlaps the cheese block, so the text naturally
wraps around the illustration. A slider resizes the cheese in real time
and the text reflows without any DOM measurements in the resize path.
The cheese and mouse are inline SVGs (cute cartoon style). The demo is
added to the demos index grid alongside the existing nine demos.
https://claude.ai/code/session_01P3CMU8eN1riSUg4EzCaMcA
---
pages/demos/index.html | 5 +
pages/demos/mouse-cheese.html | 215 ++++++++++++++++++++++++++++++++++
pages/demos/mouse-cheese.ts | 181 ++++++++++++++++++++++++++++
3 files changed, 401 insertions(+)
create mode 100644 pages/demos/mouse-cheese.html
create mode 100644 pages/demos/mouse-cheese.ts
diff --git a/pages/demos/index.html b/pages/demos/index.html
index c03d4a80..76e54794 100644
--- a/pages/demos/index.html
+++ b/pages/demos/index.html
@@ -141,6 +141,11 @@
Markdown Chat
Masonry
A text-card occlusion demo where height prediction comes from Pretext instead of DOM reads.
+ The story text wraps around the cheese in real time — no DOM measurements
+ in the layout path. Drag the slider to resize the cheese and watch the
+ lines reflow.
+