From e0c466094d66e8ac1ef0f0ad95528ced52f02e6e Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Wed, 2 Dec 2026 21:21:34 +0100 Subject: [PATCH] Page: spacing for the echoed lines; shoot script scrolls play views to the newest --- crates/ghostlight-dungeon/page/page.css | 2 +- probes/page/shoot.mjs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/ghostlight-dungeon/page/page.css b/crates/ghostlight-dungeon/page/page.css index 63dd93a..ff06e22 100644 --- a/crates/ghostlight-dungeon/page/page.css +++ b/crates/ghostlight-dungeon/page/page.css @@ -46,7 +46,7 @@ textarea { resize: vertical; line-height: 1.5; } .line { border-left: 4px solid var(--bad); background: var(--badbg); border-radius: .4rem; padding: .6rem .8rem; margin: .75rem 0; } .line.info { border-color: var(--accent); background: var(--panel); } .turn { margin: 1.4rem 0; } -.you { color: var(--muted); font-style: italic; border-left: 3px solid var(--line); padding-left: .8rem; margin: 0 0 .7rem; white-space: pre-wrap; } +.you { color: var(--muted); font-style: italic; border-left: 3px solid var(--line); padding-left: .8rem; margin: .8rem 0; white-space: pre-wrap; } .story { white-space: pre-wrap; margin: 0; } .ask { border: 1px solid var(--accent); border-radius: .6rem; padding: .6rem .8rem; margin: .8rem 0; } .status { color: var(--muted); font: 500 .85rem var(--head); } diff --git a/probes/page/shoot.mjs b/probes/page/shoot.mjs index f4258a5..9540f5f 100644 --- a/probes/page/shoot.mjs +++ b/probes/page/shoot.mjs @@ -24,6 +24,7 @@ async function shot(name) { for (const [label, [w, h]] of Object.entries(widths)) { await cdp("Emulation.setDeviceMetricsOverride", { width: w, height: h, deviceScaleFactor: label === "phone" ? 2 : 1, mobile: label === "phone" }); await sleep(350); + await js("document.querySelector('#say') && window.scrollTo(0, document.documentElement.scrollHeight)"); await sleep(200); const overflow = await js("document.documentElement.scrollWidth > document.documentElement.clientWidth"); const { result } = await cdp("Page.captureScreenshot", { format: "png" }); writeFileSync(join(out, `${name}-${label}.png`), Buffer.from(result.data, "base64"));