diff --git a/promokit.js b/promokit.js index 2492dcf..b5d009a 100644 --- a/promokit.js +++ b/promokit.js @@ -11,7 +11,8 @@ const netsites = require('./netsites'); const KIT_DIR = path.join(__dirname, 'public', 'art', 'kit'); const SHAPES = { tile: [125, 125, 'Square button'], strip: [468, 60, 'Strip'], leader: [728, 90, 'Leaderboard'], box: [300, 250, 'Box'], panel: [336, 280, 'Large box'], - tower: [160, 600, 'Skyscraper'], social: [1200, 630, 'Social share'], square: [1080, 1080, 'Square post'] }; + tower: [160, 600, 'Skyscraper'], social: [1200, 630, 'Social share'], square: [1080, 1080, 'Square post'], + wide: [600, 300, 'Wide card'], small: [250, 250, 'Small square'] }; const ANGLES = { plant: 'Bring your program', grow: 'Save your ID, grow the bed', spot: 'Spotlight a packet' }; function copy() { diff --git a/public/art/kit/ypb-grow-small.png b/public/art/kit/ypb-grow-small.png new file mode 100644 index 0000000..e340fbb Binary files /dev/null and b/public/art/kit/ypb-grow-small.png differ diff --git a/public/art/kit/ypb-grow-wide.png b/public/art/kit/ypb-grow-wide.png new file mode 100644 index 0000000..ab0a218 Binary files /dev/null and b/public/art/kit/ypb-grow-wide.png differ diff --git a/public/art/kit/ypb-plant-small.png b/public/art/kit/ypb-plant-small.png new file mode 100644 index 0000000..8213605 Binary files /dev/null and b/public/art/kit/ypb-plant-small.png differ diff --git a/public/art/kit/ypb-plant-wide.png b/public/art/kit/ypb-plant-wide.png new file mode 100644 index 0000000..03f6058 Binary files /dev/null and b/public/art/kit/ypb-plant-wide.png differ diff --git a/public/art/kit/ypb-spot-small.png b/public/art/kit/ypb-spot-small.png new file mode 100644 index 0000000..8b0f905 Binary files /dev/null and b/public/art/kit/ypb-spot-small.png differ diff --git a/public/art/kit/ypb-spot-wide.png b/public/art/kit/ypb-spot-wide.png new file mode 100644 index 0000000..fc8b655 Binary files /dev/null and b/public/art/kit/ypb-spot-wide.png differ diff --git a/tools/art.mjs b/tools/art.mjs index 5b8d490..f65faf6 100644 --- a/tools/art.mjs +++ b/tools/art.mjs @@ -32,15 +32,20 @@ body{font-family:'Atkinson Hyperlegible',sans-serif;color:#12291F;background:#F6 const page = (w, h, body, cls) => `${FONTS}${body}`; const ic = (k, s) => `${ICONS[k]}`; const ANG = { - plant: { kick: 'Open to every program', h: 'Bring your program. The network grows it.', 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. Your link first.', 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 a packet.', s: '1,000 guaranteed views at the top of the Seed Bed', cta: 'Spotlight it', icon: 'iconEvolution', cls: 'butter' } + plant: { kick: 'Open to every program', h: 'Bring your program. The network grows it.', s: 'Plant it free in the Seed Bed', t: 'Plant your program free.', cta: 'Plant it free', icon: 'iconGardening', cls: 'plate' }, + grow: { kick: 'The Seed Bed', h: 'Save your ID. Your link first.', s: 'Everyone you bring sees your referral link first', t: 'Save your ID. Your link first.', cta: 'Save my IDs', icon: 'iconSprout', cls: 'ink' }, + spot: { kick: 'One-time, paid in POL', h: 'Spotlight a packet.', s: '1,000 guaranteed views at the top of the Seed Bed', t: 'Spotlight a packet.', 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 => `
${MARK(Math.round(sz * 1.3))}YourProgramBuilder
`; if (shape === 'tile') return page(w, h, `
${MARK(30)}
${A.h.replace(/.*<\/em>/, '')}
${A.cta}
`, A.cls === 'plate' ? '' : A.cls); if (h <= 90) return page(w, h, `
${MARK(h - 26)}
${A.h}
${h >= 90 ? `
${A.s}
` : ''}
${A.cta}
`, A.cls === 'plate' ? '' : A.cls); + if (shape === 'wide') return page(w, h, `
+ ${wm(19)}
${A.kick}
${A.h}
+
${A.s}
${A.cta}
${A.cls === 'plate' ? '' : `
${ic(A.icon, 150)}
`}`, A.cls); + if (shape === 'small') return page(w, h, `
+ ${wm(15)}
${A.t}
${A.cta}
`, A.cls === 'plate' ? '' : A.cls); if (shape === 'tower') return page(w, h, `
${MARK(44)}
${A.kick}
${A.h}
${ic(A.icon, 90)}
${A.s}
${A.cta}
`, 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, `
@@ -50,8 +55,11 @@ function creative(a, shape) { } 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' }); } +const ONLY = (process.env.ONLY || '').split(',').filter(Boolean); +if (!ONLY.length) { await shot(page(192, 192, `
${MARK(160)}
`), 192, 192, path.join(ART, 'icon-192.png')); await shot(page(1200, 630, `
${MARK(52)}YourProgramBuilder
Bring your program. The network grows it.
Plant it free in the Seed Bed. Members save their IDs. The ones that grow move into the builder.
`, 'plate'), 1200, 630, path.join(ART, 'og-share.png')); for (const [n, cls] of [['plate', 'plate'], ['bed', 'ink']]) await shot(page(1200, 630, `
${MARK(52)}YourProgramBuilder
A Spotlight was just bought
Split on chain, in the same transaction.
20% sponsor, 5% each levels 2 to 5. Verify it on Polygonscan.
`, 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++; } +} +let n = 0; for (const a of Object.keys(ANG)) for (const s of Object.keys(SHAPES)) { if (ONLY.length && !ONLY.includes(s)) continue; 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');