// Renders the site art with Playwright (local only), in the watershed look (approved mockup 2026-11-16): the icon, the OG share image, // the Telegram proof cards (public/art/proof/vas-proof-{river,ink}.png) and the promo kit (public/art/kit/vas--.png, // 3 angles x 8 shapes, ad-blocker-neutral names). The hero (licensed kie art) and the topo pattern (licensed Envato) are embedded. // node tools/art.mjs (PLAYWRIGHT = path to the playwright package) import fs from 'node:fs'; import path from 'node:path'; import { createRequire } from 'node:module'; import { fileURLToPath } from 'node:url'; const require = createRequire(import.meta.url); const APP = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..'); const PW = process.env.PLAYWRIGHT || 'D:/Projects/MarketingAgent/qa-tester/node_modules/playwright'; const { chromium } = require(PW); const { SHAPES } = require(path.join(APP, 'promokit.js')); const ART = path.join(APP, 'public', 'art'); fs.mkdirSync(path.join(ART, 'kit'), { recursive: true }); fs.mkdirSync(path.join(ART, 'proof'), { recursive: true }); const b64 = f => fs.readFileSync(path.join(ART, f)).toString('base64'); const HERO = 'data:image/jpeg;base64,' + b64('hero.jpg'), TOPO = 'data:image/png;base64,' + b64('topo.png'); const FONTS = ''; const MARK = s => ``; const MARKL = s => MARK(s).replace('#0B2730', '#EAF6F4'); const CSS = `*{box-sizing:border-box;margin:0}html,body{width:100%;height:100%;overflow:hidden} body{font-family:'IBM Plex Sans',sans-serif;color:#0B2730;background:#EAF6F4} .h{font-family:'Bricolage Grotesque',sans-serif;font-weight:800;letter-spacing:-.02em;line-height:1.02} .m{font-family:'IBM Plex Mono',monospace;font-weight:500;letter-spacing:.12em;text-transform:uppercase} .wm{font-family:'Bricolage Grotesque',sans-serif;font-weight:800;white-space:nowrap}.wm b{color:#C4371B} .river{background:linear-gradient(90deg,#EAF6F4 0%,rgba(234,246,244,.92) 38%,rgba(234,246,244,0) 70%),url(${HERO}) right center/cover no-repeat} .ink{background:#0B2730 url(${TOPO}) repeat;background-size:600px;color:#EAF6F4}.ink .wm b{color:#FF9479} .btn{display:inline-block;background:#C4371B;color:#fff;border-radius:12px;font-weight:600;white-space:nowrap}`; const page = (w, h, body, cls) => `${FONTS}${body}`; const ANG = { free: { k: 'Free text ad', t: 'Every ad has a source.', s: 'Post one free text ad and watch who passes it on.', cta: 'Post your ad free' }, tree: { k: 'Family tree', t: 'Watch your ad travel.', s: 'Every reshare is a branch. See them all.', cta: 'See your tree' }, boost: { k: 'One-time Boost', t: 'Boost the source.', s: 'Top of the reshare board. Never a subscription.', cta: 'Boost my ad' } }; function kit(angle, shape) { const [w, h] = SHAPES[shape]; const a = ANG[angle]; const cls = angle === 'boost' ? 'ink' : 'river'; const mk = cls === 'ink' ? MARKL : MARK; if (h <= 90) { // strips and leaderboards const fs = Math.round(h * 0.36); return page(w, h, `
${mk(Math.round(h * .55))}
${a.t}
${w >= 700 ? `
${a.s}
` : ''}
${a.cta}
`, cls === 'ink' ? 'ink' : ''); } if (w <= 160) { // tile + tower const tall = h > w * 2; return page(w, h, `
${mk(tall ? 54 : 34)}
${a.t}
${tall ? `
${a.s}
` : ''}
ViralAdSource
${tall ? `${a.cta}` : ''}
`, cls === 'ink' ? 'ink' : ''); } if (shape === 'small') return page(w, h, `
${mk(24)}ViralAdSource
${a.t}
${a.cta}
`, cls === 'ink' ? 'ink' : ''); if (shape === 'wide') return page(w, h, `
${mk(28)}ViralAdSource
${a.k}
${a.t}
${a.s}
${a.cta}
`, cls); const big = Math.min(w, h); const pad = Math.round(big * .07); return page(w, h, `
${mk(Math.round(big * .09))}ViralAdSource
${a.k}
${a.t}
${a.s}
${a.cta}
`, cls); } const shots = [ ['icon-192.png', 192, 192, page(192, 192, `
${MARK(150)}
`)], ['og-share.png', 1200, 630, kit('free', 'social')], ['proof/vas-proof-river.png', 1200, 630, page(1200, 630, `
${MARK(54)}ViralAdSource
Paid on chain
A Boost flowed back to the branch that sold it.
Resharer, sponsor line, reward pot: one transaction. Verify it on Polygonscan.
`, 'river')], ['proof/vas-proof-ink.png', 1200, 630, page(1200, 630, `
${MARKL(54)}ViralAdSource
Live ledger
Every ad has a source.
Every payment has a proof.
Results are rewarded, never a bare share.
`, 'ink')] ]; const ONLY = (process.env.ONLY || '').split(',').filter(Boolean); // render just these kit shapes if (ONLY.length) shots.length = 0; for (const angle of Object.keys(ANG)) for (const shape of Object.keys(SHAPES)) { if (ONLY.length && !ONLY.includes(shape)) continue; const [w, h] = SHAPES[shape]; shots.push(['kit/vas-' + angle + '-' + shape + '.png', w, h, kit(angle, shape)]); } const browser = await chromium.launch(); const pg = await browser.newPage(); for (const [file, w, h, html] of shots) { await pg.setViewportSize({ width: w, height: h }); await pg.setContent(html, { waitUntil: 'networkidle' }); await pg.screenshot({ path: path.join(ART, file), clip: { x: 0, y: 0, width: w, height: h } }); } await browser.close(); console.log('art written:', shots.length);