veritas/scripts/capture-gallery.mjs
caelum0x 5bdee4507f feat(showcase): embed playable walkthrough in Demo section + DoraHacks gallery
- Demo section now embeds the mp4 walkthrough (served from web/assets) with poster + controls
- add gallery captures (media/gallery-*.png desktop sections + media/mobile-*.png)
- scripts/capture-gallery.mjs (Playwright) for section + mobile shots
- SUBMISSION.md lists the gallery assets for DoraHacks
- live: https://veritas-showcase-arhansubas-projects.vercel.app

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-29 15:22:49 +03:00

34 lines
1.3 KiB
JavaScript

// One-off: capture a DoraHacks gallery — desktop section shots + mobile views.
// Usage: node scripts/capture-gallery.mjs <url>
import { chromium } from "playwright";
const url = process.argv[2] ?? "https://veritas-showcase-arhansubas-projects.vercel.app";
const OUT = "media";
const browser = await chromium.launch();
// Desktop: per-section element shots.
const ctx = await browser.newContext({ viewport: { width: 1440, height: 900 }, deviceScaleFactor: 2 });
const page = await ctx.newPage();
await page.goto(url, { waitUntil: "networkidle" });
await page.waitForTimeout(1200);
for (const id of ["how", "sources", "cap", "demo"]) {
const el = page.locator(`#${id}`);
await el.scrollIntoViewIfNeeded();
await page.waitForTimeout(500);
await el.screenshot({ path: `${OUT}/gallery-${id}.png` });
}
await ctx.close();
// Mobile: hero + full page.
const m = await browser.newContext({ viewport: { width: 390, height: 844 }, deviceScaleFactor: 3, isMobile: true });
const mp = await m.newPage();
await mp.goto(url, { waitUntil: "networkidle" });
await mp.waitForTimeout(1200);
await mp.screenshot({ path: `${OUT}/mobile-hero.png` });
await mp.screenshot({ path: `${OUT}/mobile-full.png`, fullPage: true });
await m.close();
await browser.close();
console.log("gallery captured");