Promo kit: add 336x280 (Large box) for every angle (Marty 2026-11-16, Network Ad Space gaps)
New kit shapes rendered from HTML in the site's own look by tools/art.mjs (a shape list now renders only those shapes and leaves the other art alone). Listed in promokit.js SHAPES, so /promote, /api/promo-kit and InstantAdPay's Network sites tab show them. Smoke test counts updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+11
-7
@@ -1,8 +1,9 @@
|
||||
// Renders the site art with Playwright (local only): the icon, the OG share image, the Telegram proof cards
|
||||
// (public/art/proof/vab-proof-{royal,daylight,navy}.png) and the promo kit (public/art/kit/vab-<angle>-<shape>.png, 3 angles x 7
|
||||
// (public/art/proof/vab-proof-{royal,daylight,navy}.png) and the promo kit (public/art/kit/vab-<angle>-<shape>.png, 3 angles x 8
|
||||
// shapes, ad-blocker-neutral names). Copy facts come from config.js (Boost price + views) and promokit.js (angles, shapes).
|
||||
// The look is the site's "daylight cyberpunk" (approved 2026-11-14): royal blue panels, gold, red pill CTA, slanted condensed type.
|
||||
// node tools/art.mjs (PLAYWRIGHT = path to the playwright package)
|
||||
// node tools/art.mjs --only panel (only those kit shapes, comma list; the icon, OG and proof art are left alone)
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import { createRequire } from 'node:module';
|
||||
@@ -50,7 +51,7 @@ function kitHtml(angle, shape, w, h) {
|
||||
return `<body style="display:flex;align-items:center;gap:${big ? 16 : 9}px;padding:0 ${big ? 16 : 9}px;border-bottom:3px solid #FFC21A">${NET}<div style="flex:0 0 auto">${WM(big ? 20 : 13, true)}</div><div style="flex:1;min-width:0"><div class="mono" style="font-size:${big ? 11 : 8}px;letter-spacing:1px;color:#7DB2FF">${a.k}</div><div class="disp" style="font-size:${big ? 36 : 22}px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis"><span class="sh">${a.h1}</span> <span class="gold shg">${a.h2}</span></div></div><span class="pill" style="font-size:${big ? 21 : 13}px;padding:${big ? '6px 16px' : '3px 9px'};flex:0 0 auto;border-width:${big ? 3 : 2}px">${a.cta} »</span></body>`;
|
||||
}
|
||||
if (shape === 'tower') return `<body style="display:flex;flex-direction:column">${NET}<div class="tick" style="font-size:10px;padding:6px 4px">${TICK}</div><div style="padding:14px 12px;display:flex;flex-direction:column;gap:14px;flex:1">${WM(17, true)}<div class="mono" style="font-size:10px;letter-spacing:1px;color:#7DB2FF">${a.k}</div><div class="disp" style="font-size:38px"><span class="sh">${a.h1}</span><br><span class="gold shg">${a.h2}</span></div><div style="font-size:13px;color:#E3EBFF;line-height:1.4">${a.s}</div>${screens(.62)}<div style="margin-top:auto;text-align:center"><span class="pill" style="font-size:19px;padding:6px 12px;display:block">${a.cta} »</span><div class="mono" style="font-size:10px;margin-top:10px">viraladblitz.com</div></div></div></body>`;
|
||||
// box, social, square
|
||||
// box, panel (336x280, scaled from the box), social, square
|
||||
const f = m / 250; const wide = shape === 'social';
|
||||
return `<body style="display:flex;flex-direction:column">${NET}<div class="tick" style="font-size:${Math.round(10 * f)}px;padding:${Math.round(6 * f)}px ${Math.round(8 * f)}px">${TICK + TICK}</div>
|
||||
<div style="flex:1;padding:${Math.round(14 * f)}px ${Math.round(16 * f)}px;display:flex;gap:${Math.round(16 * f)}px;align-items:center">
|
||||
@@ -78,16 +79,19 @@ const ogHtml = () => `<body style="display:flex;flex-direction:column">${NET}<di
|
||||
<div style="flex:1">${screens(2.1)}</div></div></body>`;
|
||||
const iconHtml = () => `<body style="display:flex;align-items:center;justify-content:center;background:#EAF0FF"><img src="data:image/svg+xml;base64,${Buffer.from(fs.readFileSync(path.join(ART, 'mark.svg'))).toString('base64')}" style="width:192px;height:192px"></body>`;
|
||||
|
||||
const oi = process.argv.indexOf('--only'); const ONLY = oi > 0 ? process.argv[oi + 1].split(',') : null;
|
||||
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('<!doctype html><html><head><meta charset="utf-8">' + FONTS + '<style>' + BASE + '</style></head>' + html + '</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 ['royal', 'daylight', 'navy']) await shot(proofHtml(v), 1200, 630, path.join(ART, 'proof', 'vab-proof-' + v + '.png'));
|
||||
for (const old of ['amber', 'cream', 'green']) { try { fs.unlinkSync(path.join(ART, 'proof', 'vab-proof-' + old + '.png')); } catch (e) {} }
|
||||
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'));
|
||||
if (!ONLY) {
|
||||
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 ['royal', 'daylight', 'navy']) await shot(proofHtml(v), 1200, 630, path.join(ART, 'proof', 'vab-proof-' + v + '.png'));
|
||||
for (const old of ['amber', 'cream', 'green']) { try { fs.unlinkSync(path.join(ART, 'proof', 'vab-proof-' + old + '.png')); } catch (e) {} }
|
||||
}
|
||||
for (const angle of Object.keys(ANG)) for (const [shape, [w, h]] of Object.entries(SHAPES)) if (!ONLY || ONLY.includes(shape)) 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');
|
||||
|
||||
Reference in New Issue
Block a user