Page: spacing for the echoed lines; shoot script scrolls play views to the newest

This commit is contained in:
Meta Vens 2026-12-02 21:21:34 +01:00
commit e0c466094d
2 changed files with 2 additions and 1 deletions

View file

@ -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); }

View file

@ -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"));