// Renders the site art with Playwright (local only): the icon, the OG share image, the Telegram proof cards // (public/art/proof/vab-proof-{amber,cream,green}.png) and the promo kit (public/art/kit/vab--.png, 3 angles x 7 // shapes, ad-blocker-neutral names). Copy facts come from config.js (Boost price + views) and promokit.js (angles, shapes). // 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 C = require(path.join(APP, 'config.js')).get(); 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 FONTS = ''; const BASE = `*{box-sizing:border-box;margin:0}html,body{width:100%;height:100%;overflow:hidden}body{background:#0a1712;color:#e8efe9;font-family:'IBM Plex Sans',sans-serif} .wm{font-family:'Playfair Display',Georgia,serif;font-weight:900;color:#f4efe3;letter-spacing:-.02em}.mono{font-family:'IBM Plex Mono',monospace}.amber{color:#ffb000} .tick{background:#000;border-bottom:2px solid #ffb000;color:#ffb000;font-family:'IBM Plex Mono',monospace;white-space:nowrap;overflow:hidden} .paper{background:#f4efe3;color:#13201a;border-top:6px solid #ffb000}.cta{background:#ffb000;color:#1a1200;font-weight:600;display:inline-block}`; const views = Number(C.boost.views).toLocaleString('en-US'); const ANG = { free: { k: 'FREE FOR NETWORK MEMBERS', h: 'Post your text ad free', s: 'It runs on your page and your team\'s pages.', cta: 'Post my free ad' }, spread: { k: 'FIVE LEVELS DEEP', h: 'Your ad on your whole team\'s pages', s: 'Everyone you bring in shows your ad, five levels down.', cta: 'Get my page' }, boost: { k: 'ONE-TIME BOOST', h: '$' + C.boost.usd + ' for ' + views + ' guaranteed views', s: 'Starred on the live ticker. Never a subscription.', cta: 'Boost my ad' } }; const TICK = '▲ FREE TRAFFIC THAT CONVERTS · ★ BOOSTED: ONE LINK FOR EVERY OFFER · ▲ BUILD A LIST WITH ZERO BUDGET · ▲ '; function kitHtml(angle, shape, w, h) { const a = ANG[angle]; const m = Math.min(w, h); if (shape === 'tile') return `
ViralAdBlitz
${angle === 'boost' ? '$' + C.boost.usd + ' = ' + views + ' views' : angle === 'free' ? 'Free text ad' : '5 levels deep'}
viraladblitz.com
`; if (shape === 'strip' || shape === 'leader') { const big = shape === 'leader'; return `
ViralAdBlitz
${a.k}
${a.h}
${a.cta}
`; } if (shape === 'tower') return `
${TICK}
ViralAdBlitz
${a.k}
${a.h}
${a.s}
Your headline
Your two lines. Your link.
${a.cta}
viraladblitz.com
`; // box, social, square const f = m / 250; return `
${TICK + TICK}
ViralAdBlitzLIVE
${a.k}
${a.h}
${a.s}
${a.cta}viraladblitz.com
`; } function proofHtml(variant) { const bg = { amber: '#0a1712', cream: '#f4efe3', green: '#0b5d3b' }[variant]; const ink = variant === 'cream' ? '#13201a' : '#f4efe3'; const acc = variant === 'green' ? '#ffd166' : '#ffb000'; return `
${TICK + TICK}
ViralAdBlitzPAID ON-CHAIN
A Boost was just paid out on-chain
up to 5 sponsor levels x 10% · same transaction
Every Boost and every payout: viraladblitz.com/ledger
`; } const ogHtml = () => `
${TICK + TICK}
THE NETWORK'S TEXT AD WIRE
Your ad runs on your whole team's pages. Five levels deep.
Post your free text adViralAdBlitz
`; const iconHtml = () => ``; const browser = await chromium.launch(); let made = 0; async function shot(html, w, h, out) { const pg = await browser.newPage({ viewport: { width: w, height: h } }); await pg.setContent('' + FONTS + '' + html + '', { waitUntil: 'networkidle' }); await pg.evaluate(() => document.fonts.ready); await pg.screenshot({ path: out, clip: { x: 0, y: 0, width: w, height: h } }); await pg.close(); made++; } await shot(iconHtml(), 192, 192, path.join(ART, 'icon-192.png')); await shot(ogHtml(), 1200, 630, path.join(ART, 'og-share.png')); for (const v of ['amber', 'cream', 'green']) await shot(proofHtml(v), 1200, 630, path.join(ART, 'proof', 'vab-proof-' + v + '.png')); for (const angle of Object.keys(ANG)) for (const [shape, [w, h]] of Object.entries(SHAPES)) await shot(kitHtml(angle, shape, w, h), w, h, path.join(ART, 'kit', 'vab-' + angle + '-' + shape + '.png')); await browser.close(); console.log(made + ' images rendered');