#!/usr/bin/env node /* texture-gallery.mjs: render every texture preset on a swatch and save a PNG. * node scripts/texture-gallery.mjs out.png [--base "#b8a58a"] [--cols 6] * Useful for eyeballing a new preset, and the tests use the same page to check * that each one actually paints something. */ import { withBrowser } from './lib/browser-harness.mjs'; const args = process.argv.slice(2); const out = args.find((a) => a.endsWith('.png')) || 'texture-gallery.png'; const flag = (name, d) => { const i = args.indexOf(name); return i === -1 ? d : args[i + 1]; }; const base = flag('--base', '#b8a58a'); const cols = Number(flag('--cols', 6)); export const galleryPage = (base, cols) => `
`; if (import.meta.url === `file://${process.argv[1]}`) { await withBrowser(async ({ open }) => { const page = await open('/gallery'); await page.waitForFunction('window.ready === true'); await page.waitForTimeout(400); await page.screenshot({ path: out, fullPage: true }); console.log('wrote', out); }, { pages: { '/gallery': galleryPage(base, cols) }, viewport: { width: 1100, height: 700 } }); }