YourProgramBuilder, the Seed Bed (Marty 2026-11-17: "keep fleshing it out"): STAGING build

Plant a program free (referral link with {id}, link check green / yellow / red, daily recheck, reports), members save their
referral IDs in its packet, a sponsor-first link (member page / ?r= / the hub sponsor line, then the planter), the sprout meter
to REVIEW_SAVES (DEFAULT 25) -> Marty's review queue -> approved packets exported for the CTB builder / DownlineHydra wild heads
with every saved ID. Dormant old programs confirmed by their owner, old-link redirects (oldrefs), Spotlight on YPBShop (NOT
deployed; DEFAULT $10 / 1,000 views, 20/5/5/5/5, company 60), verified views with Spotlight delivery, trust pack (ledger,
contract, toasts, Telegram card, terms / disclaimer / privacy, TrustClickz only), network footer row, chatbot, promo kit,
Guides, PolHunter slot, LinkSpin tracked-link and zone hooks, AI writer through the hub. Seed-catalog look from the approved
mockup. Tests: qa/unit.test.cjs 33/33, qa/e2e.mjs 121/121 on a local anvil chain.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-17 09:30:59 -06:00
commit a8a1a8eec7
104 changed files with 7632 additions and 0 deletions
+57
View File
@@ -0,0 +1,57 @@
// Renders the site art with Playwright (local only) in the seed-catalog look: the mark (svg + 192 png), the OG share image, the
// Telegram proof cards (public/art/proof/ypb-proof-{plate,bed}.png) and the promo kit (public/art/kit/ypb-<angle>-<shape>.png,
// 3 angles x 8 shapes, ad-blocker-neutral names). The hero (licensed kie art) and paper grain (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/webp;base64,' + b64('hero-botanical-illustration.webp'), GRAIN = 'data:image/jpeg;base64,' + b64('paper-grain.jpg');
const ICONS = JSON.parse(fs.readFileSync(path.join(APP, 'public', 'assets', 'icons.js'), 'utf8').replace(/^[\s\S]*?window\.YPBI = /, '').replace(/;\s*$/, ''));
const MARK = s => `<svg width="${s}" height="${s}" viewBox="0 0 34 34" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="1" width="32" height="32" rx="8" fill="#22844A"/><path d="M17 27V15" stroke="#F6FAF1" stroke-width="3" stroke-linecap="round"/><path d="M17 17c0-5 4-8 9-8 0 5-4 8-9 8z" fill="#FFE6A0"/><path d="M17 20c0-4-3-6-8-6 0 4 3 6 8 6z" fill="#F6FAF1"/></svg>`;
fs.writeFileSync(path.join(ART, 'mark.svg'), MARK(34));
const FONTS = '<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Young+Serif&family=Atkinson+Hyperlegible:wght@400;700&family=Martian+Mono:wght@600&display=swap">';
const CSS = `*{box-sizing:border-box;margin:0}html,body{width:100%;height:100%;overflow:hidden}
body{font-family:'Atkinson Hyperlegible',sans-serif;color:#12291F;background:#F6FAF1 url(${GRAIN});background-size:620px}
.h{font-family:'Young Serif',serif;line-height:1.04}.h em{font-style:normal;color:#C24A08}
.m{font-family:'Martian Mono',monospace;font-weight:600;letter-spacing:.1em;text-transform:uppercase}
.plate{background:linear-gradient(90deg,rgba(246,250,241,.96) 0%,rgba(246,250,241,.9) 38%,rgba(246,250,241,0) 66%),url(${HERO}) right center/cover no-repeat}
.ink{background:#12291F;color:#F6FAF1}.ink .h em{color:#FFB27A}
.butter{background:#FFE6A0}
.btn{display:inline-block;background:#F2620F;color:#fff;border-radius:999px;font-weight:700;white-space:nowrap}
.ic svg{width:100%;height:100%;display:block}.ic{color:#22844A}
.wm{font-family:'Young Serif',serif;white-space:nowrap;display:flex;align-items:center;gap:.35em}`;
const page = (w, h, body, cls) => `<!doctype html><html><head>${FONTS}<style>${CSS}</style></head><body class="${cls || ''}" style="width:${w}px;height:${h}px">${body}</body></html>`;
const ic = (k, s) => `<span class="ic" style="display:inline-block;width:${s}px;height:${s}px">${ICONS[k]}</span>`;
const ANG = {
plant: { kick: 'Open to every program', h: 'Bring your program. <em>The network grows it.</em>', s: 'Plant it free in the Seed Bed', cta: 'Plant it free', icon: 'iconGardening', cls: 'plate' },
grow: { kick: 'The Seed Bed', h: 'Save your ID. <em>Your link first.</em>', s: 'Everyone you bring sees your referral link first', cta: 'Save my IDs', icon: 'iconSprout', cls: 'ink' },
spot: { kick: 'One-time, paid in POL', h: 'Spotlight <em>a packet.</em>', s: '1,000 guaranteed views at the top of the Seed Bed', cta: 'Spotlight it', icon: 'iconEvolution', cls: 'butter' }
};
function creative(a, shape) {
const [w, h] = SHAPES[shape]; const A = ANG[a]; const k = Math.min(w, h);
const wm = sz => `<div class="wm" style="font-size:${sz}px">${MARK(Math.round(sz * 1.3))}YourProgramBuilder</div>`;
if (shape === 'tile') return page(w, h, `<div style="padding:9px;display:flex;flex-direction:column;justify-content:space-between;height:100%">${MARK(30)}<div class="h" style="font-size:17px">${A.h.replace(/<em>.*<\/em>/, '')}</div><div class="btn" style="font-size:11px;padding:5px 8px;text-align:center">${A.cta}</div></div>`, A.cls === 'plate' ? '' : A.cls);
if (h <= 90) return page(w, h, `<div style="display:flex;align-items:center;gap:14px;height:100%;padding:0 14px">${MARK(h - 26)}<div style="flex:1;min-width:0"><div class="h" style="font-size:${h < 70 ? 19 : 26}px;white-space:nowrap;overflow:hidden">${A.h}</div>${h >= 90 ? `<div style="font-size:14px;opacity:.8">${A.s}</div>` : ''}</div><div class="btn" style="font-size:${h < 70 ? 13 : 16}px;padding:${h < 70 ? '8px 12px' : '11px 18px'}">${A.cta}</div></div>`, A.cls === 'plate' ? '' : A.cls);
if (shape === 'tower') return page(w, h, `<div style="padding:18px 14px;display:flex;flex-direction:column;gap:16px;height:100%">${MARK(44)}<div class="m" style="font-size:10px;color:#22844A">${A.kick}</div><div class="h" style="font-size:30px">${A.h}</div>${ic(A.icon, 90)}<div style="font-size:15px">${A.s}</div><div style="margin-top:auto" class="btn" style="font-size:14px;padding:10px 14px;text-align:center">${A.cta}</div></div>`, A.cls === 'plate' ? '' : A.cls);
const big = w >= 1000; const fs1 = big ? (shape === 'square' ? 88 : 66) : Math.round(k / 8.5);
return page(w, h, `<div style="padding:${Math.round(k / 14)}px;display:flex;flex-direction:column;justify-content:center;gap:${Math.round(k / 30)}px;height:100%;max-width:${A.cls === 'plate' ? Math.round(w * .62) : w}px">
${wm(Math.round(k / (big ? 22 : 15)))}<div class="m" style="font-size:${Math.round(k / (big ? 42 : 26))}px;color:${A.cls === 'ink' ? '#7FD8A0' : '#1B6E3C'}">${A.kick}</div>
<div class="h" style="font-size:${fs1}px">${A.h}</div><div style="font-size:${Math.round(k / (big ? 26 : 17))}px;opacity:.85">${A.s}</div>
<div><span class="btn" style="font-size:${Math.round(k / (big ? 28 : 18))}px;padding:${Math.round(k / 50)}px ${Math.round(k / 25)}px">${A.cta}</span></div></div>`, A.cls);
}
const b = await chromium.launch(); const ctx = await b.newContext({ deviceScaleFactor: 1 }); const pg = await ctx.newPage();
async function shot(html, w, h, out) { await pg.setViewportSize({ width: w, height: h }); await pg.setContent(html, { waitUntil: 'networkidle' }); await pg.evaluate(() => document.fonts.ready); await pg.screenshot({ path: out, type: 'png' }); }
await shot(page(192, 192, `<div style="display:grid;place-items:center;height:100%;background:#F6FAF1">${MARK(160)}</div>`), 192, 192, path.join(ART, 'icon-192.png'));
await shot(page(1200, 630, `<div style="padding:70px 64px;display:flex;flex-direction:column;justify-content:center;gap:22px;height:100%;max-width:760px"><div class="wm" style="font-size:40px">${MARK(52)}YourProgramBuilder</div><div class="h" style="font-size:72px">Bring your program. <em>The network grows it.</em></div><div style="font-size:28px;color:#35503F">Plant it free in the Seed Bed. Members save their IDs. The ones that grow move into the builder.</div></div>`, 'plate'), 1200, 630, path.join(ART, 'og-share.png'));
for (const [n, cls] of [['plate', 'plate'], ['bed', 'ink']]) await shot(page(1200, 630, `<div style="padding:70px 64px;display:flex;flex-direction:column;justify-content:center;gap:20px;height:100%;max-width:${cls === 'plate' ? 760 : 1100}px"><div class="wm" style="font-size:40px">${MARK(52)}YourProgramBuilder</div><div class="m" style="font-size:22px;color:${cls === 'ink' ? '#7FD8A0' : '#1B6E3C'}">A Spotlight was just bought</div><div class="h" style="font-size:76px">Split on chain, <em>in the same transaction.</em></div><div style="font-size:28px;opacity:.85">20% sponsor, 5% each levels 2 to 5. Verify it on Polygonscan.</div></div>`, cls), 1200, 630, path.join(ART, 'proof', 'ypb-proof-' + n + '.png'));
let n = 0; for (const a of Object.keys(ANG)) for (const s of Object.keys(SHAPES)) { const [w, h] = SHAPES[s]; await shot(creative(a, s), w, h, path.join(ART, 'kit', 'ypb-' + a + '-' + s + '.png')); n++; }
await b.close(); console.log('art written:', n, 'kit creatives + icon, og, 2 proof cards');