// Renders the Semantique social-share card (static/social-card.png). // // The card is the in-app wordmark — the same "semantique" you see in the HUD // (.sq-title): Caveat 700 in ink-soft, tilted -2deg, on paper with the faint // ruled-notebook lines (.sq-root::before). It is the og:image referenced by the // `thumbnail:` field in README.md's HF Space frontmatter. // // Run (point PLAYWRIGHT_DIR at any node_modules that has playwright; npx caches // one under ~/.npm/_npx/*, or `npx playwright install chromium` and drop the env): // PLAYWRIGHT_DIR=/path/to/node_modules node scripts/render_social_card.mjs // // Output is 2400x1260 (a 1200x630 OG card at deviceScaleFactor 2) so it stays // crisp when chat apps and HF downscale it. import { fileURLToPath, pathToFileURL } from "node:url"; import path from "node:path"; const pwSpecifier = process.env.PLAYWRIGHT_DIR ? pathToFileURL(path.join(process.env.PLAYWRIGHT_DIR, "playwright", "index.js")).href : "playwright"; const pw = await import(pwSpecifier); const chromium = pw.chromium ?? pw.default?.chromium; const HERE = path.dirname(fileURLToPath(import.meta.url)); const OUT = path.join(HERE, "..", "static", "social-card.png"); // Paper & ink, lifted straight from static/style.css. const PAPER = "#faf8f2"; const INK_SOFT = "#5a564c"; const HTML = `