#!/usr/bin/env node /** * Generates the Chrome Web Store small promo tile (440x280) from an SVG template. * * Run: node scripts/generate-promo-tile.js */ import puppeteer from 'puppeteer'; import fs from 'fs'; import path from 'path'; import { fileURLToPath } from 'url'; const __dirname = path.dirname(fileURLToPath(import.meta.url)); const ROOT = path.resolve(__dirname, '..'); const OUT = path.join(ROOT, 'extension/icons/promo-small.png'); // Brand colors const BG = '#0e0d10'; const BG_TOP = '#161318'; const MAGENTA = '#cc1b89'; // approximates oklch(55% 0.25 350) const TEXT = '#f5f3ef'; const TEXT_DIM = '#7a7680'; const svg = ` `; const browser = await puppeteer.launch({ headless: true }); const page = await browser.newPage(); await page.setViewport({ width: 440, height: 280, deviceScaleFactor: 1 }); await page.setContent(`
${svg} `); await page.screenshot({ path: OUT, omitBackground: false }); await browser.close(); console.log(`Generated ${path.relative(ROOT, OUT)}`);