// Renders the 600x300 ("wide") and 250x250 ("small") promo kit cards (member request, Marty 2026-11-18) for each display // design the kit already has: the core "Advertise & earn" card, the advertise-and-earn globe art (small only: its 600x300 // already exists), the ledger card, the team-build link card (also a 300x250 box), Wired Wednesday and Five Dollar Friday. // Run from the site dir with the qa-tester playwright: node tools/gen-card-banners.cjs // Output: public/banners/iap--.png (exact pixel sizes, DSF 1). Neutral names: no size tokens. const path = require('path'); const fs = require('fs'); const { chromium } = require('D:/Projects/MarketingAgent/qa-tester/node_modules/playwright'); const PUB = path.join(__dirname, '..', 'public'); const OUT = path.join(PUB, 'banners'); const uri = (f, t) => 'data:image/' + t + ';base64,' + fs.readFileSync(path.join(PUB, f)).toString('base64'); const LOGO = uri('logo.png', 'png'), ICON = uri('logo-icon.png', 'png'); const GLOBE = uri('banners/iap-advertise-earn-600x300.png', 'png'); // the licensed globe art, right half of the existing wide card const FONT = ''; const CSS = `*{box-sizing:border-box;margin:0}html,body{width:var(--w);height:var(--h);overflow:hidden} body{font-family:"Sora","Segoe UI",system-ui,sans-serif;color:#eef7f3;position:relative; background:radial-gradient(120% 90% at 8% 0%,#16352c 0%,#0b1512 58%,#07100d 100%)} .lines{position:absolute;inset:0;background:repeating-linear-gradient(0deg,rgba(67,232,195,.06) 0 1px,transparent 1px 26px)} .glow{position:absolute;right:-20%;top:-25%;width:75%;height:80%;border-radius:50%;background:radial-gradient(circle,rgba(67,232,195,.16),transparent 62%)} .wrap{position:absolute;inset:0;display:flex;flex-direction:column} h1{font-weight:800;letter-spacing:-.02em;line-height:1.04}h1 em{font-style:normal;color:#43e8c3} p{color:#a9c4ba;line-height:1.35} .cta{display:inline-block;background:#43e8c3;color:#03211a;font-weight:800;border-radius:999px;white-space:nowrap} .cta.amber{background:#ffb02e;color:#2a1700} .url{font-weight:700;color:#8ba69c;white-space:nowrap} .tag{display:inline-block;border:1px solid rgba(67,232,195,.45);color:#43e8c3;border-radius:999px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;white-space:nowrap} .disc{display:grid;place-items:center;border-radius:50%;background:linear-gradient(160deg,#43e8c3,#1fb894);color:#03211a;font-weight:800} .circuit{position:absolute;inset:0;opacity:.5} img.logo{display:block;mix-blend-mode:lighten}`; const CIRCUIT = (w, h) => ``; const BOLT = s => ``; const D = { core: { wide: () => `

Advertise & earn.

Paid on-chain, instantly. Every payout sits on a public ledger.

Join free →instantadpay.com
`, small: () => `

Advertise
& earn.

Paid on-chain, instantly.

Join free →
` }, earn: { small: () => `

Advertise
& earn.

Paid on-chain, instantly.

Join free →
` }, ledger: { wide: () => `
${CIRCUIT(600, 300)}

Advertising that
pays you on-chain.

Every ad package splits to real wallets, on a public ledger.

See the ledger →instantadpay.com
`, small: () => `
${CIRCUIT(250, 250)}

Advertising that pays you on-chain.

See the ledger →
` }, team: { // the team-build link card (Marty 2026-11-18: replaces the old 300x250 tiers infographic). Mechanic: whoever opens // a member's invite link is tagged to them, and the sponsor locks when the account is created (chatbot "sponsor" entry). wide: () => `
${CIRCUIT(600, 300)}

Build your team
with one link.

Everyone who joins through your invite link is placed in your team line.

Join free →Ad credits buy advertising, not income.
`, box: () => `
${CIRCUIT(300, 250)}

Build your team with one link.

Everyone who joins through your link is placed in your team line.

Join free →
`, small: () => `
${CIRCUIT(250, 250)}

One link.
Your team.

Join free →
` }, 'wired-wednesday': { wide: () => `
${CIRCUIT(600, 300)}
${BOLT(64)}

Wired Wednesday

+25% credits on any $20+ ad pack, wired in the second it settles. Every Wednesday.

Join freeinstantadpay.com
`, small: () => `
${CIRCUIT(250, 250)}
${BOLT(50)}

Wired Wednesday

+25% credits on $20+ packs

Join free
` }, 'five-dollar-friday': { wide: () => `
$5

Five Dollar Friday

+20% credits on any $5+ ad pack, every Friday. Every pack pays its line on chain.

Join freeinstantadpay.com
`, small: () => `
$5

Five Dollar Friday

+20% credits on $5+ packs

Join free
` } }; const SIZE = { wide: [600, 300], small: [250, 250], box: [300, 250] }; const ONLY = (process.argv[2] || '').split(',').filter(Boolean); // e.g. node tools/gen-card-banners.cjs team (async () => { const browser = await chromium.launch(); for (const [design, shapes] of Object.entries(D)) if (!ONLY.length || ONLY.includes(design)) for (const [shape, body] of Object.entries(shapes)) { const [w, h] = SIZE[shape]; const page = await browser.newPage({ viewport: { width: w, height: h }, deviceScaleFactor: 1 }); await page.setContent(`${FONT}${body()}`, { waitUntil: 'networkidle' }); await page.evaluate(async () => { await document.fonts.ready; await document.fonts.load('800 20px Sora'); await document.fonts.load('400 20px Sora'); }); await page.waitForFunction(() => [...document.images].every(i => i.complete && i.naturalWidth > 0)); await page.waitForTimeout(300); const file = path.join(OUT, `iap-${design}-${shape}.png`); await page.screenshot({ path: file, clip: { x: 0, y: 0, width: w, height: h } }); console.log('wrote', file); await page.close(); } await browser.close(); })();