Keep approved Dock and add row feedback with stable themed scrollbars

This commit is contained in:
SantaSpeen committed 2026-11-30 19:46:34 +03:00
1 parent c41a5e4276
commit 645afe3ebf
101 files changed
+580 -1348

No files matched your search

+14 -21
View File
@@ -1,4 +1,5 @@
import { chromium } from "playwright";
import { mkdir } from "node:fs/promises";
const base = process.env.BASE_URL || "http://127.0.0.1:4173";
const browser = await chromium.launch({
executablePath:
@@ -9,27 +10,19 @@ const browser = await chromium.launch({
headless: true,
});
try {
const page = await browser.newPage();
for (const device of ["desktop", "mobile"])
for (const theme of ["light", "dark"]) {
const width = device === "desktop" ? 640 : 300,
height = device === "desktop" ? 570 : 780;
await page.setViewportSize({
width: width * 3,
height: (height + 35) * 2,
});
await page.setContent(
`<style>*{box-sizing:border-box}body{margin:0;background:#303335;color:white;display:grid;grid-template-columns:repeat(3,${width}px);font:14px Arial}section{width:${width}px;height:${height + 35}px;padding:0 8px 8px}header{height:35px;padding:10px}img{width:100%;height:${height - 8}px;object-fit:contain;object-position:top;background:#202224}</style>${["relay", "ledger", "signal", "axis", "dock", "grid"].map((c) => `<section><header>${c.toUpperCase()} / ${theme} / ${device}</header><img src="${base}/test-results/screenshots/${c}-${theme}-${device}-dashboard.png"></section>`).join("")}`,
);
await page
.locator("img")
.evaluateAll((imgs) => Promise.all(imgs.map((i) => i.decode())));
await page.screenshot({
path: `references/concepts-${theme}-${device}.jpg`,
type: "jpeg",
quality: 90,
});
}
await mkdir("references/approved-dock", { recursive: true });
const page = await browser.newPage({
viewport: { width: 1440, height: 390 },
});
await page.setContent(
`<style>*{box-sizing:border-box}body{margin:0;display:flex;background:#18272d;color:white;font:14px Arial}section{width:720px}header{height:40px;padding:12px}img{display:block;width:720px;height:350px;object-fit:contain}</style>${["light", "dark"].map((theme) => `<section><header>ANIDEV DOCK / ${theme.toUpperCase()} / ROW HOVER</header><img src="${base}/references/approved-dock/rows-${theme}-desktop.png"></section>`).join("")}`,
);
await page
.locator("img")
.evaluateAll((images) =>
Promise.all(images.map((image) => image.decode())),
);
await page.screenshot({ path: "references/approved-dock/preview.png" });
} finally {
await browser.close();
}