// Renders the site art with Playwright (local only, nothing is uploaded): the icon, the OG share image, the Telegram sale proof // cards (public/art/proof/fx-proof-{navy,gold,field}.png), the promo kit (public/art/kit/fx--.png, 3 angles x 8 // shapes, ad-blocker-neutral names), the five trading-card tiers and a sample coach card (public/art/cards/), and, with // node tools/art.mjs --draftday http://127.0.0.1:3561 2026-11-16 // (node tools/art.mjs --only panel renders only those kit shapes, comma list, and leaves the other art alone) // the Draft Day results card for that week from a running app (public/art/draftday/week-.png, the Telegram image). // Copy facts come from config.js; the look is the approved draft-night mockup (navy, gold, red tag, Oswald + Inter). 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'); for (const d of ['kit', 'proof', 'cards', 'draftday']) fs.mkdirSync(path.join(ART, d), { recursive: true }); const FONTS = ''; const BASE = `*{box-sizing:border-box;margin:0}html,body{width:100%;height:100%;overflow:hidden} body{background:#0b1530;color:#fff;font-family:Inter,sans-serif;position:relative} .wm{font-family:Oswald,Impact,sans-serif;font-weight:700;letter-spacing:1px;white-space:nowrap}.wm b{color:#ffc93c} .d{font-family:Oswald,Impact,sans-serif;font-weight:700;text-transform:uppercase;line-height:.95} .g{color:#ffc93c}.tag{display:inline-block;background:#ff4d4d;color:#fff;font-family:Oswald,sans-serif;letter-spacing:2px;white-space:nowrap} .cta{display:inline-block;background:#ffc93c;color:#0b1530;font-family:Oswald,sans-serif;letter-spacing:1px;text-transform:uppercase;white-space:nowrap} .stripes{position:absolute;inset:0;background:repeating-linear-gradient(90deg,transparent 0 9.5%,rgba(255,255,255,.045) 9.5% 10%);pointer-events:none} `; const WM = px => `5XYOURTEAM`; const TIERS = { rookie: ['ROOKIE', '#e5e9f4', '#9aa6c4', '#0b1530', '#c6cde0', '#4a587e', 'Drafted'], starter: ['STARTER', '#eaf6ef', '#1f8a5b', '#fff', '#bfe3cf', '#1f5c40', 'Wallet linked'], pro: ['PRO', '#e8eefc', '#2f5be0', '#fff', '#c3d2fa', '#1d3a96', 'Payouts switched on'], allstar: ['ALL-STAR', '#fff7df', '#ffc93c', '#0b1530', '#ffe8a3', '#7a5a00', 'First purchase'], hof: ['HALL OF FAME', '#1a1030', '#ffc93c', '#0b1530', '#2a1a4a', '#ffc93c', 'Built a team of their own'] }; // one trading card at scale f (base 220 wide, 2:3): the same front as the site's FX.card (public/assets/common.js), with the // card CSS lifted from public/assets/fx.css and its /art/tc images inlined as data URIs (setContent pages have no origin) const FXCSS = fs.readFileSync(path.join(APP, 'public', 'assets', 'fx.css'), 'utf8'); const CARDCSS = ':root{--disp:Oswald,Impact,sans-serif;--gold:#ffc93c;--red:#ff4d4d}' + FXCSS.slice(FXCSS.indexOf('/* Art (public/art/tc'), FXCSS.indexOf('/* Champiun')) .replace(/url\((\/art\/tc\/[\w.-]+)\)/g, (m, u) => 'url(data:image/' + (u.endsWith('.png') ? 'png' : 'jpeg') + ';base64,' + fs.readFileSync(path.join(APP, 'public', u)).toString('base64') + ')'); const ini = u => String(u || '').replace(/[^A-Za-z0-9]/g, '').slice(0, 2).toUpperCase() || '?'; function tcard(tier, name, team, f) { const [lab, , , , , , ms] = TIERS[tier]; return `
${lab}
${ini(name)}
@${name}Team @${team}${ms}
`; } const ANG = { draft: { k: 'EVERY MONDAY', h1: 'Draft your team', h2: 'every Monday', s: 'Coaches draft people who joined the network without a sponsor. Draft order is earned.', cta: 'Get a position' }, coach: { k: 'EARN YOUR DRAFT SPOT', h1: 'Coach them up', h2: 'pick first', s: 'Get last week\'s picks going and you pick first next Monday. Coaching through site messages.', cta: 'Start coaching' }, cards: { k: 'TRADING CARDS', h1: 'Rookie to', h2: 'Hall of Fame', s: 'Your picks are cards that level up as they do. $' + C.position.usd + ' once, ' + C.position.picksOnBuy + ' picks today.', cta: 'See the cards' } }; const fan = f => `
${tcard('starter', 'surfqueen', 'you', .55 * f)}${tcard('allstar', 'gamerdad', 'you', .68 * f)}${tcard('pro', 'lunaclicks', 'you', .55 * f)}
`; function kitHtml(angle, shape, w, h) { const a = ANG[angle]; const m = Math.min(w, h); if (shape === 'tile') return `
${WM(13)}
${angle === 'cards' ? 'Level' : angle === 'coach' ? 'Coach' : 'Draft'}
${angle === 'cards' ? 'them up' : angle === 'coach' ? 'them up' : 'Monday'}
5xyourteam.com
`; if (shape === 'strip' || shape === 'leader') { const big = shape === 'leader'; return `
${WM(big ? 24 : 15)}
${a.k}
${a.h1} ${a.h2}
${a.cta}`; } if (shape === 'tower') return `
${WM(19)}${a.k}
${a.h1}
${a.h2}
${a.s}
${tcard('allstar', 'gamerdad', 'you', .45)}
${a.cta}
5xyourteam.com
`; const f = m / 250; const wide = shape === 'social' || shape === 'square'; return `
${WM(Math.round(17 * f))}${a.k}
${a.h1}
${a.h2}
${a.s}
${a.cta}5xyourteam.com
${wide ? `
${fan(shape === 'square' ? f * .8 : f * .75)}
` : ''}
`; } function proofHtml(v) { const V = { navy: ['#0b1530', '#ffc93c'], gold: ['#13214a', '#ffc93c'], field: ['#0e3b2a', '#ffc93c'] }[v]; return `
${WM(48)}PAID ON-CHAIN
A coach just
joined The Draft
${tcard('rookie', 'newcoach', 'draft', 1.15)}
Sponsor 25%Levels 2-5: 5% eachBest Coach pot 10%Same transaction.
The contract keeps nothing.
Every position and every payout: 5xyourteam.com/ledger
`; } const ogHtml = () => `
${WM(40)}THE DRAFT ยท EVERY MONDAY
Draft your team
every Monday
$${C.position.usd} once: ${C.position.picksOnBuy} picks today,
a draft spot every week.
${fan(1.25)}
`; const iconHtml = () => `
5X
`; const tiersHtml = () => `${Object.keys(TIERS).map((t, i) => tcard(t, ['newbie77', 'surfqueen', 'lunaclicks', 'gamerdad', 'cryptomike'][i], 'martbost', 1)).join('')}`; const coachHtml = () => `
COACH@martbostCoach since November 2026${WM(30)}
${tcard('pro', 'lunaclicks', 'martbost', .8)}${tcard('starter', 'surfqueen', 'martbost', .8)}${tcard('rookie', 'newbie77', 'martbost', .8)}
`; async function shot(browser, html, file, w, h, fonts) { const pg = await browser.newPage({ viewport: { width: w, height: h } }); await pg.setContent('' + (fonts ? FONTS : '') + '' + html + '', { waitUntil: 'load' }); await pg.evaluate(() => document.fonts && document.fonts.ready).catch(() => {}); await pg.screenshot({ path: file, clip: { x: 0, y: 0, width: w, height: h } }); await pg.close(); } const browser = await chromium.launch(); const ddIdx = process.argv.indexOf('--draftday'); if (ddIdx > 0) { const base = process.argv[ddIdx + 1], week = process.argv[ddIdx + 2]; const pg = await browser.newPage({ viewport: { width: 1080, height: 1080 } }); await pg.goto(base + '/draftday/' + week, { waitUntil: 'load' }); await pg.waitForSelector('body[data-ready="1"]', { timeout: 10000 }).catch(() => {}); await pg.evaluate(() => document.fonts && document.fonts.ready).catch(() => {}); const out = path.join(ART, 'draftday', 'week-' + week + '.png'); await pg.screenshot({ path: out, clip: { x: 0, y: 0, width: 1080, height: 1080 } }); console.log('draft day card', out); await browser.close(); process.exit(0); } const oi = process.argv.indexOf('--only'); const ONLY = oi > 0 ? process.argv[oi + 1].split(',') : null; if (!ONLY) { await shot(browser, iconHtml(), path.join(ART, 'icon-192.png'), 192, 192, true); await shot(browser, ogHtml(), path.join(ART, 'og-share.png'), 1200, 630, true); for (const v of ['navy', 'gold', 'field']) await shot(browser, proofHtml(v), path.join(ART, 'proof', 'fx-proof-' + v + '.png'), 1080, 1080, true); await shot(browser, tiersHtml(), path.join(ART, 'cards', 'fx-tiers.png'), 1280, 460, true); await shot(browser, coachHtml(), path.join(ART, 'cards', 'fx-coach-card.png'), 1200, 420, true); } for (const angle of Object.keys(ANG)) for (const [shape, [w, h]] of Object.entries(SHAPES)) if (!ONLY || ONLY.includes(shape)) await shot(browser, kitHtml(angle, shape, w, h), path.join(ART, 'kit', 'fx-' + angle + '-' + shape + '.png'), w, h, true); await browser.close(); console.log('art rendered');