From 17681aef07da22a7a81c3f7388f79b7236e15d08 Mon Sep 17 00:00:00 2001 From: aedes Date: Wed, 22 Apr 2026 03:08:12 +0300 Subject: [PATCH] fix: use percentages for chat position so it scales with image --- scripts/mirror.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/scripts/mirror.js b/scripts/mirror.js index 2271ecd..43eeb76 100644 --- a/scripts/mirror.js +++ b/scripts/mirror.js @@ -152,11 +152,14 @@ async function main() { const pageTitle = (await page.title()).replace(/[<>]/g, ''); - const chatBlocks = slots.map(s => ` -
+ const chatBlocks = slots.map(s => { + const topPct = (s.top / pageHeight * 100).toFixed(4); + return ` +
-
`).join(''); +
`; + }).join(''); const wrapperHtml = ` @@ -170,8 +173,8 @@ async function main() { .q-wrap img.bg { display:block; width:100%; height:auto; } .q-chat { position: absolute; - left: 250px; - width: 520px; + left: 15.6%; + width: 32.5%; z-index: 10; background: #fff; }