Commit 2c2cdc53 authored by Mahmoud Aglan's avatar Mahmoud Aglan

chore(tools): shoot.mjs --scale for print-resolution screenshots

Co-Authored-By: 's avatarClaude Opus 5.5 <noreply@anthropic.com>
parent f56437fc
...@@ -29,6 +29,7 @@ const ANON = args.includes('--anon'); // signed out: the first-run screens ...@@ -29,6 +29,7 @@ const ANON = args.includes('--anon'); // signed out: the first-run screens
const WITH_FRIEND = args.includes('--with-friend'); // a second account, befriended and online const WITH_FRIEND = args.includes('--with-friend'); // a second account, befriended and online
const RAW_THEME = args.includes('--raw-theme'); const RAW_THEME = args.includes('--raw-theme');
const DROP_ASSETS = argOf('--drop-assets', ''); // regex: stored asset ids to hide, to preview the built-in art const DROP_ASSETS = argOf('--drop-assets', ''); // regex: stored asset ids to hide, to preview the built-in art
const SCALE = Number(argOf('--scale', '2')); // device pixel ratio of the shots (4 for print work)
const PUSH = argOf('--push', ''); const PUSH = argOf('--push', '');
const PARAMS = argOf('--params', '{}'); const PARAMS = argOf('--params', '{}');
const NAME = argOf('--name', PUSH); const NAME = argOf('--name', PUSH);
...@@ -169,7 +170,7 @@ try { ...@@ -169,7 +170,7 @@ try {
if ((m.type() === 'warn' || m.type() === 'warning') && m.text().includes('[i18n] missing')) errors.push(`[${current}] ` + m.text()); if ((m.type() === 'warn' || m.type() === 'warning') && m.text().includes('[i18n] missing')) errors.push(`[${current}] ` + m.text());
}); });
page.on('pageerror', e => errors.push(`[${current}] PAGEERROR ` + String(e).slice(0, 200))); page.on('pageerror', e => errors.push(`[${current}] PAGEERROR ` + String(e).slice(0, 200)));
await page.setViewport({ width: W, height: H, deviceScaleFactor: 2, isMobile: true, hasTouch: true }); await page.setViewport({ width: W, height: H, deviceScaleFactor: SCALE, isMobile: true, hasTouch: true });
await page.setRequestInterception(true); await page.setRequestInterception(true);
page.on('request', async req => { page.on('request', async req => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment