Promo kit (Marty 2026-11-14: "get all the creatives built for downline banners and VBB, and put them in all the places they need to go"): promokit.js is the one source for the Downline Banners kit, published as GET /api/promo-kit?u=<network username or wallet> (public, CORS open, read by /promote and by InstantAdPay's Promo tools > Network sites): personal links (?ref=), 21 creatives (3 angles: $5 spot + 300 guaranteed views / 10 levels pay as spots sell after yours / no withdrawals, paid in the same transaction; each in 125x125, 468x60, 728x90, 300x250, 160x600, 1200x630, 1080x1080) at /art/kit/dlb-<angle>-<shape>.png (ad-blocker-neutral names, rendered crisp from HTML by tools/kit-art.mjs with Playwright), 5 lines, 3 headlines, 1 email, 2 posts (facts per SPEC.md + contract: sponsor 30%, 10 levels x 5.5%, splits fixed; nothing promised). /promote page (kitpage.js + promote.js + kit.css): username from sign-in, ?u= or typed; nav + footer link Promote; sitemap. server.js: one require + one hook line. common.js?v=20261114p. Smoke 106/106 (promo kit feed, every PNG at its exact size, Promote page signed in, desktop + phone screenshots; gate step now screenshots itself if it ever stalls).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@@ -0,0 +1,106 @@
|
||||
// Promo kit (Marty 2026-11-14): the ONE place the Downline Banners creatives and swipe copy live. Published as a small public JSON
|
||||
// feed, GET /api/promo-kit?u=<network username or wallet>, read by this site's /promote page and by InstantAdPay's promo center
|
||||
// ("Network sites"). Change a line or a creative here and every place that shows the kit updates.
|
||||
// Facts checked against SPEC.md + the BannerLine contract: $5 spot in POL, 300 guaranteed views within 30 days, sponsor 30%,
|
||||
// 10 levels x 5.5% to the 10 spots bought just before, 10% company, 5% momentum fund, all in the same transaction, splits fixed.
|
||||
// Copy rules: no income promises, nothing guaranteed but the views, no em dashes.
|
||||
// Creatives: public/art/kit/<site>-<angle>-<shape>.png, rendered by tools/kit-art.mjs (neutral names: no IAB size tokens).
|
||||
'use strict';
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const C = require('./config').get();
|
||||
|
||||
const KIT_DIR = path.join(__dirname, 'public', 'art', 'kit');
|
||||
const SHAPES = { tile: [125, 125, 'Square button'], strip: [468, 60, 'Strip (board size)'], leader: [728, 90, 'Leaderboard'], box: [300, 250, 'Box'],
|
||||
tower: [160, 600, 'Skyscraper'], social: [1200, 630, 'Social share'], square: [1080, 1080, 'Square post'] };
|
||||
const ANGLES = {
|
||||
spot: 'A $5 spot, 300 guaranteed views',
|
||||
line: '10 levels pay as spots sell after yours',
|
||||
instant: 'No withdrawals, paid in the same transaction'
|
||||
};
|
||||
const LINES = [
|
||||
'A $5 spot on Downline Banners puts your banner on the board for 300 guaranteed views. {{LINK}}',
|
||||
'Downline Banners pays every split on-chain in the same transaction. Nothing to withdraw, nothing to wait on. {{LINK}}',
|
||||
'One global line of $5 spots. When spots sell after yours, your spot gets a share of each of the next 10. {{LINK}}',
|
||||
'Own a spot and share your link: you get 30% of every spot your people buy, paid the moment they buy it. {{LINK}}',
|
||||
'The splits on Downline Banners are fixed in a verified Polygon contract and cannot be changed. Take a look: {{LINK}}'
|
||||
];
|
||||
const HEADLINES = [
|
||||
'A $5 Banner Spot, Paid Out On-Chain',
|
||||
'300 Guaranteed Views for Your Banner, Plus a Place in the Line',
|
||||
'No Withdrawals. Every Split Paid in the Same Transaction.'
|
||||
];
|
||||
const EMAIL = {
|
||||
subject: 'A $5 banner spot, paid out on-chain',
|
||||
body: [
|
||||
'Hi,',
|
||||
'',
|
||||
'I am using Downline Banners, a banner board that runs on Polygon.',
|
||||
'',
|
||||
'A spot is $5 in POL. It puts your 468x60 banner on the board for 300 guaranteed views and gives you a place in one global line.',
|
||||
'',
|
||||
'The $5 is split by a smart contract in the same transaction: 30% to your sponsor, 5.5% to each of the 10 spots bought before yours, and the rest to the company and a momentum fund that can only buy spots. Nothing sits in an account waiting for a withdrawal.',
|
||||
'',
|
||||
'Nothing is promised. A spot is paid only when spots sell after it.',
|
||||
'',
|
||||
'Have a look here:',
|
||||
'{{LINK}}'
|
||||
].join('\n')
|
||||
};
|
||||
const POSTS = [
|
||||
'Found a simple one: Downline Banners. $5 spot, your banner gets 300 guaranteed views, and every sale is split on-chain in the same transaction. No withdrawals to wait on.\n\n{{LINK}}',
|
||||
'How a $5 spot on Downline Banners is split: 30% to the buyer\'s sponsor, 5.5% to each of the 10 spots before it, the rest to the company and a fund that only buys spots. All on Polygon, splits fixed in the contract.\n\n{{LINK}}'
|
||||
];
|
||||
const NOTE = 'A spot buys 300 guaranteed views on the board and a place in the line. Nothing is promised: a spot is paid only when spots sell after it, and can earn back less than it cost.';
|
||||
|
||||
const REF_RE = /^(?:[A-Za-z0-9_.-]{2,40}|0x[0-9a-fA-F]{40})$/;
|
||||
const base = () => 'https://' + C.site;
|
||||
let files = null;
|
||||
function creatives() {
|
||||
if (files) return files;
|
||||
let names = []; try { names = fs.readdirSync(KIT_DIR).filter(f => /^dlb-[a-z]+-[a-z]+\.png$/.test(f)); } catch (e) {}
|
||||
const out = [];
|
||||
for (const angle of Object.keys(ANGLES)) for (const shape of Object.keys(SHAPES)) {
|
||||
const f = 'dlb-' + angle + '-' + shape + '.png'; if (!names.includes(f)) continue;
|
||||
const [w, h, label] = SHAPES[shape];
|
||||
out.push({ key: angle + '-' + shape, angle, angleLabel: ANGLES[angle], shape, label, w, h, url: base() + '/art/kit/' + f });
|
||||
}
|
||||
return (files = out);
|
||||
}
|
||||
function kit(u) {
|
||||
const ref = REF_RE.test(String(u || '')) ? String(u) : '';
|
||||
const q = ref ? '?ref=' + encodeURIComponent(ref) : '';
|
||||
const link = base() + '/' + q;
|
||||
const fill = s => s.split('{{LINK}}').join(link);
|
||||
return {
|
||||
v: 1, site: C.site, name: 'Downline Banners', updated: '2026-11-14', username: ref || null,
|
||||
tagline: 'Banner real estate in one line, paid instantly on-chain.',
|
||||
links: [
|
||||
{ key: 'home', label: 'Your link (home page)', url: link },
|
||||
{ key: 'how', label: 'How it works', url: base() + '/how' + q },
|
||||
{ key: 'join', label: 'Get a spot', url: base() + '/join' + q }
|
||||
],
|
||||
linkTemplate: base() + '/?ref={username}',
|
||||
creatives: creatives().map(c => Object.assign({}, c, { html: '<a href="' + link + '" target="_blank" rel="noopener"><img src="' + c.url + '" width="' + c.w + '" height="' + c.h + '" alt="Downline Banners"></a>' })),
|
||||
lines: LINES.map(fill), headlines: HEADLINES.slice(), email: { subject: EMAIL.subject, body: fill(EMAIL.body) }, posts: POSTS.map(fill),
|
||||
note: NOTE, promotePage: base() + '/promote'
|
||||
};
|
||||
}
|
||||
|
||||
// GET /api/promo-kit (public, CORS open: InstantAdPay reads it from the member's browser), /promote (the page) and /art/kit/<file>.png
|
||||
function handle(req, res, u, sendFile) {
|
||||
const p = u.pathname;
|
||||
if (req.method !== 'GET' && req.method !== 'HEAD' && req.method !== 'OPTIONS') return false;
|
||||
if (p === '/api/promo-kit') {
|
||||
const cors = { 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Methods': 'GET', 'Access-Control-Allow-Headers': 'Content-Type' };
|
||||
if (req.method === 'OPTIONS') { res.writeHead(204, cors); res.end(); return true; }
|
||||
res.writeHead(200, Object.assign({ 'Content-Type': 'application/json', 'Cache-Control': 'public, max-age=300', 'X-Content-Type-Options': 'nosniff' }, cors));
|
||||
res.end(JSON.stringify(kit(u.searchParams.get('u')))); return true;
|
||||
}
|
||||
if (p === '/promote' && req.method !== 'OPTIONS') { sendFile(res, path.join(__dirname, 'public', 'promote.html')); return true; }
|
||||
const m = /^\/art\/kit\/(dlb-[a-z]+-[a-z]+\.png)$/.exec(p);
|
||||
if (m) { sendFile(res, path.join(KIT_DIR, m[1]), { 'Access-Control-Allow-Origin': '*' }); return true; }
|
||||
return false;
|
||||
}
|
||||
|
||||
module.exports = { kit, handle, creatives };
|
||||
|
After Width: | Height: | Size: 66 KiB |
|
After Width: | Height: | Size: 57 KiB |
|
After Width: | Height: | Size: 439 KiB |
|
After Width: | Height: | Size: 639 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 78 KiB |
|
After Width: | Height: | Size: 66 KiB |
|
After Width: | Height: | Size: 58 KiB |
|
After Width: | Height: | Size: 437 KiB |
|
After Width: | Height: | Size: 635 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 79 KiB |
|
After Width: | Height: | Size: 65 KiB |
|
After Width: | Height: | Size: 57 KiB |
|
After Width: | Height: | Size: 433 KiB |
|
After Width: | Height: | Size: 628 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 76 KiB |
@@ -17,7 +17,7 @@ window.BL = (function () {
|
||||
async function renderNav(active) {
|
||||
const c = await getConfig().catch(() => ({}));
|
||||
const n = document.createElement('nav');
|
||||
const links = [['/', 'Home'], ['/board', 'Board'], ['/how', 'How it works'], ['/ledger', 'Ledger'], ['/join', 'Get a spot'], ['/my', 'My Spots']];
|
||||
const links = [['/', 'Home'], ['/board', 'Board'], ['/how', 'How it works'], ['/ledger', 'Ledger'], ['/join', 'Get a spot'], ['/promote', 'Promote'], ['/my', 'My Spots']];
|
||||
n.innerHTML = '<div class="wrap"><a class="brand" href="/"><img src="/art/mark.svg" alt="" width="38" height="38"><span class="logo-wrap"><span class="logo">Downline <b>Banners</b></span>'
|
||||
+ '<span class="byline">Part of the <b>Crypto Team Build</b> Network</span></span></a><div class="links">'
|
||||
+ links.map(l => '<a href="' + l[0] + '"' + (l[0] === active ? ' class="active"' : '') + '>' + l[1] + '</a>').join('') + '</div></div>';
|
||||
@@ -37,7 +37,7 @@ window.BL = (function () {
|
||||
f.className = 'bl-foot';
|
||||
f.innerHTML = '<div class="wrap"><p>Part of the Crypto Team Build Network</p>'
|
||||
+ '<p class="muted small">A spot buys 300 guaranteed views on the board and a place in the line. Nothing is promised: you are paid only when spots sell after yours, and a spot can earn back less than it cost.</p>'
|
||||
+ '<p class="small"><a href="/how">How it works</a> · <a href="/board">Board</a> · <a href="/ledger">Live ledger</a> · <a href="/contract">Contract proof</a> · <a href="/my">My Spots</a></p></div>';
|
||||
+ '<p class="small"><a href="/how">How it works</a> · <a href="/board">Board</a> · <a href="/ledger">Live ledger</a> · <a href="/contract">Contract proof</a> · <a href="/promote">Promote</a> · <a href="/my">My Spots</a></p></div>';
|
||||
document.body.appendChild(f);
|
||||
toasts();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
/* Promote page (2026-11-14). Neutral class names (kit-*), no ad/banner words. */
|
||||
.kit-who{display:flex;gap:10px;flex-wrap:wrap;margin-top:10px}
|
||||
.kit-who input{flex:1 1 220px;min-width:0;font:inherit;padding:11px 13px;border-radius:12px;border:1px solid var(--line-strong);background:var(--panel-solid);color:var(--ink)}
|
||||
.kit-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:10px 0;border-top:1px solid var(--line)}
|
||||
.kit-row:first-of-type{border-top:0}
|
||||
.kit-l{flex:1 1 260px;min-width:0;display:flex;flex-direction:column;gap:3px}
|
||||
.kit-lab{display:block;font-size:12px;color:var(--muted);text-transform:uppercase;letter-spacing:.08em}
|
||||
.kit-url{font-family:var(--mono);font-size:13.5px;overflow-wrap:anywhere;color:var(--mint)}
|
||||
.kit-txt{flex:1 1 300px;margin:0;min-width:0}
|
||||
.kit-pre{white-space:pre-wrap;font:14.5px/1.55 inherit;font-family:inherit;margin:10px 0 0;padding:12px 14px;border-radius:12px;border:1px solid var(--line);background:var(--panel-solid);overflow-wrap:anywhere}
|
||||
.kit-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:6px 0 14px}
|
||||
.kit-tab{font:600 13.5px/1 inherit;font-family:inherit;padding:9px 13px;border-radius:999px;border:1px solid var(--line-strong);background:transparent;color:var(--muted);cursor:pointer}
|
||||
.kit-tab.on{border-color:var(--mint);color:var(--mint)}
|
||||
.kit-set{display:flex;flex-wrap:wrap;gap:18px;align-items:flex-start}
|
||||
.kit-fig{margin:0;display:flex;flex-direction:column;gap:8px;max-width:100%}
|
||||
.kit-fig img{display:block;max-width:100%;height:auto;border-radius:6px;border:1px solid var(--line)}
|
||||
.kit-social img{width:600px} .kit-square img{width:360px}
|
||||
.kit-fig figcaption{font-size:13px;display:flex;flex-wrap:wrap;gap:6px;align-items:center}
|
||||
.kit-acts{display:flex;gap:6px;flex-wrap:wrap;width:100%}
|
||||
.kit-note{margin:6px 0 24px}
|
||||
@@ -0,0 +1,49 @@
|
||||
// Promote page renderer (2026-11-14). Draws a promo kit (GET /api/promo-kit) into a container: links, creatives grouped by angle,
|
||||
// swipe lines, headlines, an email and social posts, each with a copy button. Same file on Downline Banners and Viral Banner Blitz;
|
||||
// the page script decides the username and the look comes from the site's own CSS (.card, .btn, .kit-*).
|
||||
window.KitPage = (function () {
|
||||
const esc = s => String(s == null ? '' : s).replace(/[&<>"']/g, c => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
||||
async function copy(text, btn) {
|
||||
try { await navigator.clipboard.writeText(text); } catch (e) {
|
||||
const t = document.createElement('textarea'); t.value = text; document.body.appendChild(t); t.select(); try { document.execCommand('copy'); } catch (e2) {} t.remove();
|
||||
}
|
||||
if (btn) { const o = btn.textContent; btn.textContent = 'Copied'; setTimeout(() => { btn.textContent = o; }, 1400); }
|
||||
}
|
||||
const TXT = [];
|
||||
const cb = (text, label, cls) => { TXT.push(text); return '<button type="button" class="btn small ' + (cls || 'sec') + '" data-kc="' + (TXT.length - 1) + '">' + esc(label || 'Copy') + '</button>'; };
|
||||
// on the kit's own site, show creatives from this origin (same files; the copied URL stays absolute)
|
||||
function local(url, k) { try { const u = new URL(url); return u.hostname === k.site && location.hostname !== k.site ? u.pathname : url; } catch (e) { return url; } }
|
||||
function render(root, k) {
|
||||
TXT.length = 0;
|
||||
const angles = []; const by = {};
|
||||
(k.creatives || []).forEach(c => { if (!by[c.angle]) { by[c.angle] = []; angles.push(c); } by[c.angle].push(c); });
|
||||
let h = '';
|
||||
h += '<div class="card"><h3>Your links</h3>' + (k.username ? '<p class="muted small">Every link, creative and line below carries <b>' + esc(k.username) + '</b>.</p>' : '<p class="muted small">Add your network username above so these links carry it.</p>')
|
||||
+ k.links.map(l => '<div class="kit-row"><div class="kit-l"><span class="kit-lab">' + esc(l.label) + '</span><code class="kit-url">' + esc(l.url) + '</code></div>' + cb(l.url, 'Copy link', '') + '</div>').join('') + '</div>';
|
||||
h += '<div class="card"><h3>Creatives</h3><p class="muted small">Download them, or copy the HTML: it already links to you.</p><div class="kit-tabs" role="tablist">'
|
||||
+ angles.map((c, i) => '<button type="button" class="kit-tab' + (i ? '' : ' on') + '" data-ka="' + esc(c.angle) + '">' + esc(c.angleLabel) + '</button>').join('') + '</div>';
|
||||
angles.forEach((a, i) => {
|
||||
h += '<div class="kit-set" data-ks="' + esc(a.angle) + '"' + (i ? ' hidden' : '') + '>' + by[a.angle].map(c =>
|
||||
'<figure class="kit-fig kit-' + esc(c.shape) + '"><a href="' + esc(c.url) + '" target="_blank" rel="noopener"><img src="' + esc(local(c.url, k)) + '" alt="' + esc(k.name + ', ' + c.label) + '" width="' + c.w + '" height="' + c.h + '" loading="lazy"></a>'
|
||||
+ '<figcaption><b>' + esc(c.label) + '</b> <span class="muted">' + c.w + 'x' + c.h + '</span><span class="kit-acts"><a class="btn small sec" href="' + esc(c.url) + '" download>Download</a>' + cb(c.url, 'Copy URL') + cb(c.html, 'Copy HTML') + '</span></figcaption></figure>').join('') + '</div>';
|
||||
});
|
||||
h += '</div>';
|
||||
h += '<div class="card"><h3>Short lines</h3><p class="muted small">For chats, comments, text ads and signatures.</p>' + k.lines.map(t => '<div class="kit-row"><p class="kit-txt">' + esc(t) + '</p>' + cb(t) + '</div>').join('') + '</div>';
|
||||
h += '<div class="card"><h3>Headlines</h3>' + k.headlines.map(t => '<div class="kit-row"><p class="kit-txt"><b>' + esc(t) + '</b></p>' + cb(t) + '</div>').join('') + '</div>';
|
||||
h += '<div class="card"><h3>Email</h3><div class="kit-row"><p class="kit-txt"><span class="kit-lab">Subject</span>' + esc(k.email.subject) + '</p>' + cb(k.email.subject, 'Copy subject') + '</div>'
|
||||
+ '<pre class="kit-pre">' + esc(k.email.body) + '</pre><div class="kit-row" style="justify-content:flex-end">' + cb(k.email.body, 'Copy email') + '</div></div>';
|
||||
h += '<div class="card"><h3>Social posts</h3>' + k.posts.map(t => '<div class="kit-post"><pre class="kit-pre">' + esc(t) + '</pre><div class="kit-row" style="justify-content:flex-end">' + cb(t, 'Copy post') + '</div></div>').join('') + '</div>';
|
||||
if (k.note) h += '<p class="muted small kit-note">' + esc(k.note) + '</p>';
|
||||
root.innerHTML = h;
|
||||
root.querySelectorAll('[data-kc]').forEach(b => b.addEventListener('click', () => copy(TXT[Number(b.dataset.kc)], b)));
|
||||
root.querySelectorAll('[data-ka]').forEach(b => b.addEventListener('click', () => {
|
||||
root.querySelectorAll('[data-ka]').forEach(x => x.classList.toggle('on', x === b));
|
||||
root.querySelectorAll('[data-ks]').forEach(s => { s.hidden = s.dataset.ks !== b.dataset.ka; });
|
||||
}));
|
||||
}
|
||||
async function load(root, u) {
|
||||
const r = await fetch('/api/promo-kit' + (u ? '?u=' + encodeURIComponent(u) : ''), { cache: 'no-store' });
|
||||
const k = await r.json(); render(root, k); return k;
|
||||
}
|
||||
return { render, load, copy };
|
||||
})();
|
||||
@@ -0,0 +1,25 @@
|
||||
// Promote page (2026-11-14): the promo kit from /api/promo-kit with the member's network username in every link.
|
||||
// Username: ?u= first, then the signed-in member's (My Spots), then the last one typed here (this browser only).
|
||||
(async function () {
|
||||
await BL.renderNav('/promote'); BL.renderFooter();
|
||||
const $ = BL.$; const RE = /^(?:[A-Za-z0-9_.-]{2,40}|0x[0-9a-fA-F]{40})$/;
|
||||
let u = new URLSearchParams(location.search).get('u') || '';
|
||||
let signed = false;
|
||||
if (!RE.test(u)) {
|
||||
u = '';
|
||||
try { const me = await BL.getJSON('/api/me'); if (me.signedIn) { const d = await BL.getJSON('/api/my'); if (d && !d.error) { u = d.username || d.address || ''; signed = true; } } } catch (e) {}
|
||||
}
|
||||
if (!u) { try { u = localStorage.getItem('kit.u') || ''; } catch (e) {} if (!RE.test(u)) u = ''; }
|
||||
$('whoIn').value = u;
|
||||
if (signed) $('whoNote').textContent = 'Signed in: your links below use ' + (u.startsWith('0x') ? 'your wallet (no network username found yet)' : '@' + u) + '.';
|
||||
async function show(name) {
|
||||
try { await KitPage.load($('kit'), name); BL.status(''); } catch (e) { BL.status('Could not load the kit. Try again in a moment.', 'err'); }
|
||||
}
|
||||
$('whoForm').addEventListener('submit', e => {
|
||||
e.preventDefault(); const v = $('whoIn').value.trim().replace(/^@/, '');
|
||||
if (v && !RE.test(v)) return BL.status('That does not look like a username: letters, numbers, dot, dash or underscore.', 'err');
|
||||
try { localStorage.setItem('kit.u', v); } catch (e2) {}
|
||||
show(v);
|
||||
});
|
||||
show(u);
|
||||
})();
|
||||
@@ -31,7 +31,7 @@
|
||||
<div class="card"><h3>The line so far</h3><div id="stats" class="grid2"></div></div>
|
||||
<div id="status" class="note" hidden></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=20261114a"></script>
|
||||
<script src="/assets/common.js?v=20261114p"></script>
|
||||
<script src="/assets/board.js?v=1"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
<li>Open any sale in the <a href="/ledger">live ledger</a> and look at its <b>Logs</b>: one SpotBought event, then one Paid event per payment.</li></ol></div>
|
||||
<div id="zContract"></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=20261114a"></script>
|
||||
<script src="/assets/common.js?v=20261114p"></script>
|
||||
<script src="/assets/contract.js?v=z1"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
<div class="card"><h3>The momentum fund</h3><p>When no spot has sold for 4 hours, the fund buys one (at most 12 a day). It gifts the spot to an active member who owns a paid spot and has not had a gift in 7 days, members who referred someone recently first. If nobody qualifies, the fund keeps the spot and its line money goes back into the fund.</p></div>
|
||||
<div class="card"><h3>The rest of the network</h3><p>Open board slots show network sites such as InstantAdPay and LinkSpin. On InstantAdPay, ad credits buy advertising, not income.</p></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=20261114a"></script>
|
||||
<script src="/assets/common.js?v=20261114p"></script>
|
||||
<script src="/assets/how.js?v=z1"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
</section>
|
||||
<div id="status" class="note" hidden></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=20261114a"></script>
|
||||
<script src="/assets/common.js?v=20261114p"></script>
|
||||
<script src="/assets/gate.js?v=1"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
<div id="status" class="note" hidden></div>
|
||||
<div class="card" id="doneCard" hidden><h3>Your spot is in the line</h3><p>Next: add your image and link in My Spots. One free signature signs you in (it cannot move funds).</p><div class="row"><button class="btn" id="toMyBtn">Open My Spots</button></div><p class="small mono" id="txLink"></p><div id="zBought"></div></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=20261114a"></script>
|
||||
<script src="/assets/common.js?v=20261114p"></script>
|
||||
<script src="/assets/wallet.js?v=1"></script>
|
||||
<script src="/assets/join.js?v=20261114h"></script>
|
||||
</body>
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<div class="card"><div class="row" style="justify-content:space-between"><h3 style="margin:0">Spot sales</h3><span class="muted small" id="upd"></span></div>
|
||||
<div id="rows"><p class="muted">Loading the ledger...</p></div><div id="zLedger"></div><div id="rows2"></div></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=20261114a"></script>
|
||||
<script src="/assets/common.js?v=20261114p"></script>
|
||||
<script src="/assets/ledger.js?v=z1"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
</div>
|
||||
<div id="status" class="note" hidden></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=20261114a"></script>
|
||||
<script src="/assets/common.js?v=20261114p"></script>
|
||||
<script src="/assets/wallet.js?v=1"></script>
|
||||
<script src="/assets/my.js?v=z1"></script>
|
||||
</body>
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>Promote | Downline Banners</title>
|
||||
<meta name="description" content="Promote Downline Banners: your personal links, ready-made creatives in every common size, short lines, headlines, an email and social posts.">
|
||||
<link rel="canonical" href="https://downlinebanners.com/promote">
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:site_name" content="Downline Banners">
|
||||
<meta property="og:title" content="Promote | Downline Banners">
|
||||
<meta property="og:description" content="Promote Downline Banners: your personal links, ready-made creatives in every common size, short lines, headlines, an email and social posts.">
|
||||
<meta property="og:url" content="https://downlinebanners.com/promote">
|
||||
<meta property="og:image" content="https://downlinebanners.com/art/og-share.png">
|
||||
<meta property="og:image:width" content="1200">
|
||||
<meta property="og:image:height" content="630">
|
||||
<meta property="og:image:alt" content="Downline Banners: banner real estate in one line, paid instantly on-chain">
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:title" content="Promote | Downline Banners">
|
||||
<meta name="twitter:description" content="Promote Downline Banners: your personal links, ready-made creatives in every common size, short lines, headlines, an email and social posts.">
|
||||
<meta name="twitter:image" content="https://downlinebanners.com/art/og-share.png">
|
||||
<link rel="icon" type="image/svg+xml" href="/art/mark.svg"><link rel="icon" type="image/png" href="/logo-icon.png">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700;12..96,800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap">
|
||||
<link rel="stylesheet" href="/assets/site.css?v=2">
|
||||
<link rel="stylesheet" href="/assets/line.css?v=7">
|
||||
<link rel="stylesheet" href="/assets/kit.css?v=1">
|
||||
</head>
|
||||
<body>
|
||||
<main class="wrap">
|
||||
<section class="hero"><h1>Promote Downline Banners</h1><p class="lead">Your links, creatives in every common size, and copy you can paste anywhere. Everything carries your network username.</p></section>
|
||||
<div class="card" id="who"><h3>Your network username</h3>
|
||||
<p class="muted small" id="whoNote">Your InstantAdPay or LinkSpin username works here too. Sign in on <a href="/my">My Spots</a> and it fills in by itself.</p>
|
||||
<form class="kit-who" id="whoForm"><input id="whoIn" autocomplete="off" spellcheck="false" maxlength="42" placeholder="your username"><button class="btn" type="submit">Use it</button></form></div>
|
||||
<div id="status" class="note" hidden></div>
|
||||
<div id="kit"><p class="muted">Loading the kit...</p></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=20261114p"></script>
|
||||
<script src="/assets/kitpage.js?v=1"></script>
|
||||
<script src="/assets/promote.js?v=1"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -126,6 +126,30 @@ async function main() {
|
||||
const qq = await u.json('/api/quote'); ok(qq.wei === q.toString() && qq.source === 'contract.quoteWei', '/api/quote reads quoteWei()', qq);
|
||||
for (const p of ['/', '/board', '/join', '/my', '/how', '/assets/site.css', '/art/house-line.svg']) { const r = await u.req(p); ok(r.status === 200, 'GET ' + p + ' 200'); }
|
||||
const r404 = await u.req('/nope'); ok(r404.status === 404, 'unknown path 404');
|
||||
// promo kit (2026-11-14): one public feed read by /promote and by InstantAdPay's promo center
|
||||
{
|
||||
const kr = await u.req('/api/promo-kit?u=alpha'); const k = await kr.json();
|
||||
ok(kr.status === 200 && kr.headers.get('access-control-allow-origin') === '*', 'promo kit: GET /api/promo-kit 200 with CORS open', kr.status);
|
||||
ok(k.username === 'alpha' && k.links.length === 3 && k.links.every(l => l.url.startsWith('https://downlinebanners.com/') && l.url.endsWith('?ref=alpha')), 'promo kit: every link carries ?ref=<username>', k.links);
|
||||
ok(k.lines.length === 5 && k.headlines.length === 3 && k.posts.length === 2 && k.email && k.email.body.includes('?ref=alpha'), 'promo kit: 5 lines, 3 headlines, 1 email, 2 posts, link filled in');
|
||||
const words = JSON.stringify([k.lines, k.headlines, k.email, k.posts, k.note, k.tagline]);
|
||||
ok(!/[—–]/.test(words) && !/passive income|guaranteed (income|returns|profit|earnings)|earn (cash|money)|make money/i.test(words) && /300 guaranteed views/.test(words) && /30%/.test(words) && /5\.5%/.test(words), 'promo kit copy: no dashes, no income promises, facts match the contract (300 views, 30%, 5.5%)');
|
||||
ok(k.creatives.length === 21 && new Set(k.creatives.map(c => c.angle)).size === 3, 'promo kit: 21 creatives in 3 angles', k.creatives.length);
|
||||
const badName = k.creatives.filter(c => /\d{2,4}x\d{2,4}|banner|[-_/]ads?[-_./]/i.test(c.url.replace('https://downlinebanners.com', '')));
|
||||
ok(badName.length === 0, 'promo kit: creative paths are ad-blocker neutral', badName.map(c => c.url));
|
||||
const bad = [];
|
||||
for (const c of k.creatives) {
|
||||
const rr = await u.req(new URL(c.url).pathname); const buf = Buffer.from(await rr.arrayBuffer());
|
||||
if (rr.status !== 200 || rr.headers.get('content-type') !== 'image/png' || buf.readUInt32BE(16) !== c.w || buf.readUInt32BE(20) !== c.h) bad.push(c.key + ' ' + rr.status);
|
||||
if (!c.html.includes('href="https://downlinebanners.com/?ref=alpha"')) bad.push(c.key + ' html');
|
||||
}
|
||||
ok(bad.length === 0, 'promo kit: every creative served as PNG at its exact size, HTML links to the member', bad);
|
||||
ok((await u.req('/art/kit/../server.js')).status !== 200 && (await u.req('/art/kit/nope.png')).status === 404, 'promo kit: /art/kit serves kit files only');
|
||||
const k2 = await (await u.req('/api/promo-kit?u=' + encodeURIComponent('<b>'))).json();
|
||||
ok(k2.username === null && k2.links[0].url === 'https://downlinebanners.com/', 'promo kit: a bad username is ignored', k2.links[0]);
|
||||
const pr = await u.req('/promote'); const ph = await pr.text(); ok(pr.status === 200 && /id="kit"/.test(ph), 'GET /promote serves the Promote page');
|
||||
ok((await (await u.req('/sitemap.xml')).text()).includes('/promote'), 'sitemap lists /promote');
|
||||
}
|
||||
const myHdr = await u.req('/my'); ok(myHdr.headers.get('x-frame-options') === 'DENY' && !(await u.req('/')).headers.get('x-frame-options'), '/my not frameable, / frameable');
|
||||
|
||||
// ---- 3. gate (HTTP) ----
|
||||
@@ -246,12 +270,16 @@ async function main() {
|
||||
const watch = (pg, name) => { pg.on('console', msg => { if (msg.type() === 'error') errors.push(name + ': ' + msg.text() + ' @ ' + ((msg.location() || {}).url || '')); }); pg.on('pageerror', e => errors.push(name + ': ' + e.message)); };
|
||||
// member context: signed in, gate skipped
|
||||
const ctxM = await browser.newContext(); await ctxM.addCookies([{ name: 'bl.sid', value: m.jar['bl.sid'], url: BASE }]);
|
||||
for (const p of ['/', '/board', '/how', '/join', '/my']) {
|
||||
for (const p of ['/', '/board', '/how', '/join', '/my', '/promote']) {
|
||||
const pg = await ctxM.newPage(); watch(pg, 'member ' + p);
|
||||
await pg.goto(BASE + p, { waitUntil: 'networkidle' });
|
||||
await pg.screenshot({ path: path.join(OUT, 'member' + (p === '/' ? '-home' : p.replace('/', '-')) + '.png'), fullPage: true });
|
||||
const foot = await pg.textContent('footer').catch(() => ''); ok(/Part of the Crypto Team Build Network/.test(foot || ''), 'member ' + p + ' renders with footer');
|
||||
if (p === '/my') { await pg.waitForSelector('#dash:not([hidden])', { timeout: 8000 }).catch(() => {}); ok(await pg.isVisible('#dash'), '/my dashboard visible'); ok((await pg.$$('.spot-ed')).length >= 3, '/my spot editors listed'); }
|
||||
if (p === '/promote') { await pg.waitForSelector('#kit .kit-fig img', { timeout: 8000 }).catch(() => {}); const kt = await pg.textContent('#kit'); const who = await pg.inputValue('#whoIn');
|
||||
ok(!!who && kt.includes('?ref=' + who) && (await pg.$$('#kit .kit-set:not([hidden]) .kit-fig')).length === 7, '/promote shows the kit with the signed-in member link (' + who + ')'); ok(!!(await pg.$('nav a[href="/promote"]')), 'nav links to Promote');
|
||||
await pg.waitForTimeout(500); await pg.screenshot({ path: path.join(OUT, 'member-promote.png'), fullPage: true });
|
||||
await pg.setViewportSize({ width: 390, height: 844 }); await pg.waitForTimeout(300); await pg.screenshot({ path: path.join(OUT, 'member-promote-phone.png'), fullPage: true }); }
|
||||
if (p === '/join') { await pg.waitForSelector('#buyCard:not([hidden])', { timeout: 8000 }).catch(() => {}); const price = await pg.textContent('#price'); ok(/^0\.0025/.test(price), '/join shows price ' + price); }
|
||||
const em = await pg.evaluate(() => document.body.innerText.includes('\u2014')); ok(!em, p + ' has no em dash');
|
||||
await pg.close();
|
||||
@@ -261,7 +289,8 @@ async function main() {
|
||||
await pg.goto(BASE + '/?ref=' + addr[B], { waitUntil: 'domcontentloaded' });
|
||||
await pg.waitForSelector('#gate:not([hidden])');
|
||||
for (let i = 0; i < 8; i++) {
|
||||
await pg.waitForSelector('#gNext:not([hidden])', { timeout: 20000 });
|
||||
try { await pg.waitForSelector('#gNext:not([hidden])', { timeout: 20000 }); }
|
||||
catch (e) { await pg.screenshot({ path: path.join(OUT, 'visitor-gate-stuck.png'), fullPage: true }).catch(() => {}); console.log(' gate stuck at step', i, JSON.stringify(await pg.evaluate(() => ({ what: (document.getElementById('gWhat') || {}).textContent, status: (document.getElementById('status') || {}).textContent })).catch(() => null))); throw e; }
|
||||
const label = await pg.textContent('#gNext'); await pg.click('#gNext');
|
||||
if (label === 'Continue') break;
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ const dlbnas = require('./dlbnas'); // Network Ad Space: standing house banner +
|
||||
const refuelspots = require('./refuelspots'); // refuel spots: $50+ Monthly Refuels earn a spot, engine wallet pays (2026-11-13)
|
||||
const tgproof = require('./tgproof'); // payment proof in the Telegram payments topic, one message per spot sale (2026-11-13)
|
||||
const hubreport = require('./hubreport'); // network hub, shadow mode: members reported by wallet (2026-11-13), off unless HUB_ENABLED
|
||||
const promokit = require('./promokit'); // promo kit feed /api/promo-kit, the /promote page, /art/kit/* creatives (2026-11-14)
|
||||
const networksso = require('./networksso'); // network sign-in: arrive signed in from InstantAdPay or LinkSpin (2026-11-13), see networksso.js
|
||||
const SEL = { buy: iface.getFunction('buy').selector, buyFor: iface.getFunction('buyFor').selector }; // the browser builds calldata from these (ABI stays in abi.js)
|
||||
|
||||
@@ -274,6 +275,7 @@ const server = http.createServer(async (req, res) => {
|
||||
|
||||
// -- network sign-in (2026-11-13): /sso/start, /sso/in, /api/sso/status
|
||||
if (req.method === 'GET' && (p.startsWith('/sso/') || p === '/api/sso/status') && await networksso.handle(req, res, u)) return;
|
||||
if ((p === '/api/promo-kit' || p === '/promote' || p.startsWith('/art/kit/')) && promokit.handle(req, res, u, sendFile)) return;
|
||||
|
||||
// -- pages
|
||||
if (req.method === 'GET' || req.method === 'HEAD') {
|
||||
@@ -297,7 +299,7 @@ const server = http.createServer(async (req, res) => {
|
||||
// sitemap (2026-11-13, SEO): the public pages only
|
||||
if (p === '/sitemap.xml') {
|
||||
const day = new Date().toISOString().slice(0, 10);
|
||||
const urls = ['/', '/board', '/how', '/ledger', '/contract', '/join'].map(u => '<url><loc>https://' + C.site + u + '</loc><lastmod>' + day + '</lastmod></url>').join('');
|
||||
const urls = ['/', '/board', '/how', '/ledger', '/contract', '/join', '/promote'].map(u => '<url><loc>https://' + C.site + u + '</loc><lastmod>' + day + '</lastmod></url>').join('');
|
||||
res.writeHead(200, headers({ 'Content-Type': 'application/xml; charset=utf-8', 'Cache-Control': 'public, max-age=3600' }));
|
||||
return res.end('<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' + urls + '</urlset>');
|
||||
}
|
||||
|
||||
@@ -0,0 +1,196 @@
|
||||
// Promo kit art for Downline Banners and Viral Banner Blitz (2026-11-14). Renders every creative from HTML with Playwright so
|
||||
// the text is crisp, at the exact pixel size of each slot. Same file in both repos (banner-line/app/tools, vbb/app/tools).
|
||||
// node tools/kit-art.mjs dlb|vbb|all
|
||||
// Output: <app>/public/art/kit/<site>-<angle>-<shape>.png. Neutral names on purpose: no IAB size tokens, no "banner"/"ad"
|
||||
// (EasyList hides those). The copy here must match the facts in each app (DLB SPEC.md + contract, VBB config.js + how.html).
|
||||
import { pathToFileURL } from 'url';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
const PW = process.env.PLAYWRIGHT || 'D:/Projects/MarketingAgent/qa-tester/node_modules/playwright/index.js';
|
||||
const pwm = await import(pathToFileURL(PW).href); const chromium = pwm.chromium || (pwm.default && pwm.default.chromium);
|
||||
|
||||
const ROOT = 'D:/Projects/HighRisk';
|
||||
const SHAPES = { tile: [125, 125], strip: [468, 60], leader: [728, 90], box: [300, 250], tower: [160, 600], social: [1200, 630], square: [1080, 1080] };
|
||||
|
||||
const SITES = {
|
||||
dlb: {
|
||||
out: ROOT + '/banner-line/app/public/art/kit', domain: 'downlinebanners.com', name: ['Downline', 'Banners'],
|
||||
mark: fs.readFileSync(ROOT + '/banner-line/app/public/art/mark.svg', 'utf8'),
|
||||
fonts: 'family=Bricolage+Grotesque:opsz,wght@12..96,700;12..96,800&family=Inter:wght@500;600;700',
|
||||
angles: {
|
||||
spot: { eyebrow: '$5 spot', h1: 'A $5 spot.', h2: '300 guaranteed views.', line: 'A $5 spot. 300 guaranteed views.', sub: 'Your banner on the board, paid on-chain on Polygon.', cta: 'Get a spot', tA: '$5 spot', tB: '300 views', chips: ['$5 spot', '300 guaranteed views', 'Paid on-chain'] },
|
||||
line: { eyebrow: '10 levels', h1: '10 levels pay', h2: 'as spots sell after yours.', line: '10 levels pay as spots sell after yours', sub: 'Sponsor 30%. Each of 10 levels 5.5%. Fixed in the contract.', cta: 'See the line', tA: '10 levels', tB: 'paid on-chain', chips: ['Sponsor 30%', '10 levels x 5.5%', 'Splits fixed on-chain'] },
|
||||
instant: { eyebrow: 'Nothing to withdraw', h1: 'No withdrawals.', h2: 'Paid in the same transaction.', line: 'No withdrawals. Paid in the same transaction.', sub: 'A Polygon contract splits every $5 spot the moment it sells.', cta: 'See how', tA: 'No withdrawals', tB: 'paid same tx', chips: ['Same-transaction payouts', 'Verified contract', '$5 spot'] }
|
||||
}
|
||||
},
|
||||
vbb: {
|
||||
out: ROOT + '/vbb/app/public/art/kit', domain: 'viralbannerblitz.com', name: ['Viral Banner', 'Blitz'],
|
||||
mark: fs.readFileSync(ROOT + '/vbb/app/public/art/mark.svg', 'utf8'),
|
||||
fonts: 'family=Bricolage+Grotesque:opsz,wght@12..96,700;12..96,800&family=DM+Sans:wght@500;700&family=Space+Mono:wght@700',
|
||||
angles: {
|
||||
free: { eyebrow: 'Free daily post', h1: 'Post a banner', h2: 'free every day.', line: 'Post a banner free every day', sub: 'InstantAdPay and LinkSpin members get a free post credit each day they sign in.', cta: 'Post yours', tA: 'FREE', tB: 'daily post', chips: ['125x125 banners', 'Free daily post', 'No subscription'] },
|
||||
loop: { eyebrow: 'Real visitors only', h1: 'Every visitor', h2: 'pushes the loop.', line: 'Every visitor pushes the loop', sub: 'Real visitors move every banner forward. Ride out and earn network ad views.', cta: 'Join the loop', tA: 'Every visit', tB: 'moves it', chips: ['Verified visitors', 'Bots do not count', 'Network ad views'] },
|
||||
prize: { eyebrow: 'Weekly leaderboards', h1: 'Send visitors.', h2: 'Climb the weekly board.', line: 'Weekly prizes, at least $20 a week', sub: 'Prize pot of at least $20 a week, paid in POL to the top three on each board.', cta: 'See the leaders', tA: 'Weekly', tB: 'prizes', chips: ['At least $20 a week', 'Paid in POL', 'Two leaderboards'] }
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const esc = s => String(s).replace(/[&<>"]/g, c => ({ '&': '&', '<': '<', '>': '>', '"': '"' }[c]));
|
||||
// shrink every .fit element until its text fits its box (one line or the box height)
|
||||
const FIT = `<script>window.__fit=()=>{document.querySelectorAll('.fit').forEach(el=>{let s=parseFloat(getComputedStyle(el).fontSize);let n=0;while((el.scrollWidth>el.clientWidth+1||el.scrollHeight>el.clientHeight+s*0.2)&&s>6&&n++<200){s-=0.5;el.style.fontSize=s+'px';}});};</script>`;
|
||||
|
||||
function dlbCss() {
|
||||
return `
|
||||
:root{--bg:#0b0913;--ink:#f3f1fa;--muted:#a29cbc;--lime:#c6f432;--mint:#7ef0c8;--cyan:#6fd8ff;--vio:#9b7bff}
|
||||
*{box-sizing:border-box;margin:0;padding:0}
|
||||
html,body{width:var(--w);height:var(--h);overflow:hidden}
|
||||
body{font-family:Inter,system-ui,sans-serif;color:var(--ink);background:
|
||||
radial-gradient(55% 70% at 18% 20%,rgba(155,123,255,.32),transparent 70%),radial-gradient(45% 60% at 85% 85%,rgba(198,244,50,.16),transparent 70%),
|
||||
linear-gradient(160deg,#1c1733 0%,#0b0913 70%);position:relative}
|
||||
body::after{content:"";position:absolute;inset:0;border:1px solid rgba(155,123,255,.45);pointer-events:none}
|
||||
.g{background:linear-gradient(92deg,var(--lime) 5%,var(--mint) 55%,var(--cyan));-webkit-background-clip:text;background-clip:text;color:transparent}
|
||||
.disp{font-family:"Bricolage Grotesque",system-ui,sans-serif;font-weight:800;letter-spacing:-.03em;line-height:1.02}
|
||||
.mark svg{width:100%;height:100%;display:block}
|
||||
.wm{font-family:"Bricolage Grotesque";font-weight:800;letter-spacing:-.03em;white-space:nowrap}
|
||||
.eb{display:inline-block;font-weight:700;text-transform:uppercase;letter-spacing:.12em;color:var(--lime);border:1.5px solid var(--lime);border-radius:999px;white-space:nowrap}
|
||||
.cta{display:inline-flex;align-items:center;justify-content:center;font-family:"Bricolage Grotesque";font-weight:800;color:#0b0913;background:linear-gradient(92deg,var(--lime),var(--mint));border-radius:999px;white-space:nowrap}
|
||||
.chip{display:inline-block;color:var(--muted);border:1.5px solid rgba(162,156,188,.35);border-radius:999px;font-weight:600;white-space:nowrap}
|
||||
.chip:first-child{color:var(--lime);border-color:var(--lime)}
|
||||
.sub{color:#cfc9e6}
|
||||
.fit{white-space:nowrap;overflow:hidden;flex:none}
|
||||
.h .g,.h .hot{width:fit-content;max-width:100%}`;
|
||||
}
|
||||
function vbbCss() {
|
||||
return `
|
||||
:root{--bg:#fff4dc;--ink:#14121f;--hot:#ff2d87;--sky:#2b59ff;--amber:#ffd400;--mint:#14d9a0;--muted:#4d4862}
|
||||
*{box-sizing:border-box;margin:0;padding:0}
|
||||
html,body{width:var(--w);height:var(--h);overflow:hidden}
|
||||
body{font-family:"DM Sans",system-ui,sans-serif;color:var(--ink);background:var(--bg);position:relative;
|
||||
background-image:radial-gradient(rgba(255,45,135,.18) 1.4px,transparent 1.6px),radial-gradient(rgba(43,89,255,.13) 1.4px,transparent 1.6px);
|
||||
background-size:22px 22px,22px 22px;background-position:0 0,11px 11px}
|
||||
body::after{content:"";position:absolute;inset:0;border:var(--edge,3px) solid var(--ink);pointer-events:none}
|
||||
.disp{font-family:"Bricolage Grotesque",system-ui,sans-serif;font-weight:800;letter-spacing:-.03em;line-height:1}
|
||||
.hot{color:var(--hot);-webkit-text-stroke:var(--stroke,1px) var(--ink);text-shadow:var(--ts,3px) var(--ts,3px) 0 var(--amber)}
|
||||
.mark svg{width:100%;height:100%;display:block}
|
||||
.wm{font-family:"Bricolage Grotesque";font-weight:800;letter-spacing:-.03em;white-space:nowrap}
|
||||
.wm b{color:var(--hot);-webkit-text-stroke:.6px var(--ink)}
|
||||
.eb{display:inline-block;font-family:"Space Mono",monospace;font-weight:700;text-transform:uppercase;letter-spacing:.1em;background:var(--mint);border:2.5px solid var(--ink);border-radius:999px;box-shadow:3px 3px 0 var(--ink);transform:rotate(-1.5deg);white-space:nowrap}
|
||||
.cta{display:inline-flex;align-items:center;justify-content:center;font-family:"Bricolage Grotesque";font-weight:800;color:#fff;background:var(--hot);border:2.5px solid var(--ink);border-radius:12px;box-shadow:4px 4px 0 var(--ink);white-space:nowrap}
|
||||
.chip{display:inline-block;font-weight:700;border:2.5px solid var(--ink);border-radius:999px;background:#fff;box-shadow:3px 3px 0 var(--ink);white-space:nowrap}
|
||||
.chip:nth-child(1){background:var(--amber)} .chip:nth-child(2){background:#dbe4ff} .chip:nth-child(3){background:#c9f7e6}
|
||||
.sub{color:var(--muted)}
|
||||
.fit{white-space:nowrap;overflow:hidden}
|
||||
.tiles{position:absolute;display:grid;grid-template-columns:repeat(3,1fr);gap:var(--tg,14px)}
|
||||
.tiles i{display:block;aspect-ratio:1;border:3px solid var(--ink);border-radius:12px;box-shadow:5px 5px 0 var(--ink)}`;
|
||||
}
|
||||
const VBB_TILE_COLORS = ['#ff2d87', '#2b59ff', '#ffd400', '#14d9a0', '#ffffff', '#ff2d87', '#14d9a0', '#2b59ff', '#ffffff', '#ffd400', '#2b59ff', '#ff2d87'];
|
||||
const vTiles = (n, rot) => '<div class="tiles">' + Array.from({ length: n }, (_, i) => '<i style="background:' + VBB_TILE_COLORS[i % 12] + ';transform:rotate(' + (((i * 37) % 7) - 3) * (rot || 1) + 'deg)"></i>').join('') + '</div>';
|
||||
|
||||
function body(site, a, shape) {
|
||||
const S = SITES[site]; const m = '<div class="mark">' + S.mark + '</div>'; const d = site === 'dlb';
|
||||
const wm = d ? '<span class="wm">Downline <span class="g">Banners</span></span>' : '<span class="wm">Viral Banner <b>Blitz</b></span>';
|
||||
const h2 = d ? '<span class="g">' + esc(a.h2) + '</span>' : '<span class="hot">' + esc(a.h2) + '</span>';
|
||||
const chips = a.chips.map(c => '<span class="chip">' + esc(c) + '</span>').join('');
|
||||
switch (shape) {
|
||||
case 'tile': return `<style>
|
||||
.t{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:8px;gap:3px}
|
||||
.t .mark{width:30px;height:30px;margin-bottom:3px}
|
||||
.t .a{font-size:27px;width:109px;line-height:1.05} .t .b{font-size:15px;width:109px;font-weight:800;font-family:"Bricolage Grotesque"}
|
||||
.t .c{font-size:9.5px;font-weight:700;width:109px;opacity:.85;margin-top:2px}
|
||||
${d ? '' : 'body{--edge:3px} .t .a{color:var(--ink)} .t .b{display:inline-block;width:auto;background:var(--hot);color:#fff;border:2px solid var(--ink);border-radius:8px;padding:1px 7px;box-shadow:2px 2px 0 var(--ink);transform:rotate(-2deg)}'}
|
||||
</style><div class="t">${m}<div class="a disp fit">${esc(a.tA)}</div><div class="b fit ${d ? 'g' : ''}">${esc(a.tB)}</div><div class="c fit">${esc(S.domain)}</div></div>`;
|
||||
case 'strip': return `<style>
|
||||
.s{position:absolute;inset:0;display:flex;align-items:center;gap:10px;padding:0 10px}
|
||||
.s .mark{width:40px;height:40px;flex:none}
|
||||
.s .mid{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
|
||||
.s .h{font-size:19px;width:100%} .s .w{font-size:11px;font-weight:600;opacity:.8;width:100%}
|
||||
.s .cta{font-size:13px;padding:8px 12px;flex:none} ${d ? '' : 'body{--edge:2.5px} .s .cta{box-shadow:2px 2px 0 var(--ink);border-width:2px;border-radius:9px}'}
|
||||
</style><div class="s">${m}<div class="mid"><div class="h disp fit">${esc(a.line)}</div><div class="w fit">${esc(S.name.join(' '))} · ${esc(S.domain)}</div></div><span class="cta">${esc(a.cta)}</span></div>`;
|
||||
case 'leader': return `<style>
|
||||
.l{position:absolute;inset:0;display:flex;align-items:center;gap:16px;padding:0 18px}
|
||||
.l .mark{width:58px;height:58px;flex:none}
|
||||
.l .mid{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px}
|
||||
.l .h{font-size:28px;width:100%} .l .w{font-size:13.5px;width:100%}
|
||||
.l .cta{font-size:17px;padding:12px 20px;flex:none} ${d ? '' : 'body{--edge:3px;--stroke:.6px;--ts:2px}'}
|
||||
</style><div class="l">${m}<div class="mid"><div class="h disp fit">${esc(a.h1)} ${h2}</div><div class="w sub fit">${esc(a.sub)}</div></div><span class="cta">${esc(a.cta)}</span></div>`;
|
||||
case 'box': return `<style>
|
||||
.b{position:absolute;inset:0;display:flex;flex-direction:column;padding:16px 18px;gap:9px}
|
||||
.b .top{display:flex;align-items:center;gap:8px} .b .mark{width:34px;height:34px;flex:none} .b .wm{font-size:17px}
|
||||
.b .eb{font-size:10px;padding:4px 9px;align-self:flex-start}
|
||||
.b .h{font-size:28px;width:100%;white-space:normal;max-height:62px} .b .h span{display:block;white-space:nowrap}
|
||||
.b .sub{font-size:12.5px;line-height:1.35}
|
||||
.b .cta{font-size:15px;padding:10px 16px;margin-top:auto;align-self:flex-start} ${d ? '' : 'body{--edge:3px;--stroke:.5px;--ts:1.5px}'}
|
||||
</style><div class="b"><div class="top">${m}${wm}</div><span class="eb">${esc(a.eyebrow)}</span><div class="h disp fit"><span>${esc(a.h1)}</span>${h2.replace('<span class="', '<span class="') }</div><div class="sub">${esc(a.sub)}</div><span class="cta">${esc(a.cta)} →</span></div>`;
|
||||
case 'tower': return `<style>
|
||||
.v{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;text-align:center;padding:22px 12px 20px;gap:12px}
|
||||
.v .mark{width:64px;height:64px} .v .wm{font-size:17px;white-space:normal;line-height:1.05}
|
||||
.v .eb{font-size:9px;padding:4px 8px}
|
||||
.v .h{font-size:30px;line-height:1.05;white-space:normal;width:140px;overflow-wrap:normal} .v .h span{display:block}
|
||||
.v .sub{font-size:13px;line-height:1.4}
|
||||
.v .cta{font-size:15px;padding:11px 14px;margin-top:auto} .v .dom{font-size:10.5px;font-weight:700;opacity:.8}
|
||||
${d ? '' : 'body{--edge:3px;--stroke:.6px;--ts:2px} .v .wm b{display:block}'}
|
||||
</style><div class="v">${m}${d ? '<span class="wm">Downline<br><span class="g">Banners</span></span>' : '<span class="wm">Viral Banner <b>Blitz</b></span>'}<span class="eb">${esc(a.eyebrow)}</span><div class="h disp fit"><span>${esc(a.h1)}</span>${h2}</div><div class="sub">${esc(a.sub)}</div><span class="cta">${esc(a.cta)}</span><div class="dom">${esc(S.domain)}</div></div>`;
|
||||
case 'social': return d ? `<style>
|
||||
.o{position:absolute;inset:0;padding:64px 80px;display:flex;flex-direction:column}
|
||||
.o .top{display:flex;align-items:center;gap:26px} .o .mark{width:118px;height:118px} .o .wm{font-size:60px}
|
||||
.o .eb{font-size:17px;padding:8px 16px;align-self:flex-start;margin:44px 0 18px}
|
||||
.o .h{font-size:78px;width:1040px} .o .h span{display:block;white-space:nowrap}
|
||||
.o .sub{font-size:27px;margin-top:20px;max-width:980px}
|
||||
.o .chips{margin-top:auto;display:flex;gap:14px} .o .chip{font-size:22px;padding:10px 20px}
|
||||
</style><div class="o"><div class="top">${m}${wm}</div><span class="eb">${esc(a.eyebrow)}</span><div class="h disp fit"><span>${esc(a.h1)}</span>${h2}</div><div class="sub">${esc(a.sub)}</div><div class="chips">${chips}<span class="chip">${esc(S.domain)}</span></div></div>`
|
||||
: `<style>
|
||||
body{--edge:0px}
|
||||
.o{position:absolute;inset:0;padding:64px 0 56px 72px;display:flex;flex-direction:column;width:690px}
|
||||
.o .eb{font-size:17px;padding:9px 18px;align-self:flex-start}
|
||||
.o .h{font-size:76px;margin-top:30px;width:620px;white-space:normal;--stroke:2px;--ts:5px} .o .h span{display:block;white-space:nowrap}
|
||||
.o .sub{font-size:26px;margin-top:24px;line-height:1.35;color:var(--ink)}
|
||||
.o .bot{margin-top:auto;display:flex;align-items:center;gap:16px} .o .mark{width:62px;height:62px} .o .dom{font:800 32px "Bricolage Grotesque"}
|
||||
.tiles{right:-30px;top:84px;width:430px;--tg:16px} .tiles i{border-radius:14px}
|
||||
</style>${vTiles(12)}<div class="o"><span class="eb">${esc(a.eyebrow)}</span><div class="h disp fit"><span>${esc(a.h1)}</span>${h2}</div><div class="sub">${esc(a.sub)}</div><div class="bot">${m}<span class="dom">${esc(S.domain)}</span></div></div>`;
|
||||
case 'square': return d ? `<style>
|
||||
.q{position:absolute;inset:0;padding:84px 86px;display:flex;flex-direction:column}
|
||||
.q .top{display:flex;align-items:center;gap:26px} .q .mark{width:120px;height:120px} .q .wm{font-size:60px}
|
||||
.q .eb{font-size:22px;padding:10px 20px;align-self:flex-start;margin:96px 0 26px}
|
||||
.q .h{font-size:104px;width:908px;white-space:normal} .q .h span{display:block}
|
||||
.q .sub{font-size:34px;line-height:1.35;margin-top:34px}
|
||||
.q .chips{margin-top:auto;display:flex;flex-wrap:wrap;gap:14px} .q .chip{font-size:26px;padding:12px 22px}
|
||||
.q .dom{font:800 40px "Bricolage Grotesque";margin-top:26px}
|
||||
</style><div class="q"><div class="top">${m}${wm}</div><span class="eb">${esc(a.eyebrow)}</span><div class="h disp"><span>${esc(a.h1)}</span>${h2}</div><div class="sub">${esc(a.sub)}</div><div class="chips">${chips}</div><div class="dom g">${esc(S.domain)}</div></div>`
|
||||
: `<style>
|
||||
body{--edge:0px}
|
||||
.q{position:absolute;inset:0;padding:80px 84px;display:flex;flex-direction:column}
|
||||
.q .top{display:flex;align-items:center;gap:20px} .q .mark{width:96px;height:96px} .q .wm{font-size:50px}
|
||||
.q .eb{font-size:22px;padding:11px 22px;align-self:flex-start;margin-top:64px}
|
||||
.q .h{font-size:104px;margin-top:36px;white-space:normal;--stroke:2.5px;--ts:6px} .q .h span{display:block}
|
||||
.q .sub{font-size:33px;margin-top:30px;line-height:1.35;color:var(--ink);max-width:880px}
|
||||
.q .chips{margin-top:auto;display:flex;flex-wrap:wrap;gap:16px} .q .chip{font-size:26px;padding:12px 22px}
|
||||
.tiles{right:-50px;top:-40px;width:330px;--tg:14px;grid-template-columns:repeat(3,1fr)}
|
||||
</style>${vTiles(6)}<div class="q"><div class="top">${m}${wm}</div><span class="eb">${esc(a.eyebrow)}</span><div class="h disp"><span>${esc(a.h1)}</span>${h2}</div><div class="sub">${esc(a.sub)}</div><div class="chips">${chips}<span class="chip" style="background:var(--hot);color:#fff">${esc(S.domain)}</span></div></div>`;
|
||||
}
|
||||
}
|
||||
|
||||
function page(site, angle, shape) {
|
||||
const S = SITES[site]; const [w, h] = SHAPES[shape];
|
||||
return `<!doctype html><html><head><meta charset="utf-8"><link rel="stylesheet" href="https://fonts.googleapis.com/css2?${S.fonts}&display=block">
|
||||
<style>:root{--w:${w}px;--h:${h}px}${site === 'dlb' ? dlbCss() : vbbCss()}</style>${FIT}</head><body>${body(site, S.angles[angle], shape)}</body></html>`;
|
||||
}
|
||||
|
||||
const which = process.argv[2] || 'all';
|
||||
const browser = await chromium.launch();
|
||||
const made = []; let file0;
|
||||
for (const site of Object.keys(SITES)) {
|
||||
if (which !== 'all' && which !== site) continue;
|
||||
const S = SITES[site]; fs.mkdirSync(S.out, { recursive: true });
|
||||
for (const angle of Object.keys(S.angles)) for (const shape of Object.keys(SHAPES)) {
|
||||
const [w, h] = SHAPES[shape];
|
||||
const pg = await browser.newPage({ viewport: { width: w, height: h }, deviceScaleFactor: 1 });
|
||||
await pg.setContent(page(site, angle, shape), { waitUntil: 'networkidle' });
|
||||
if (process.env.DBG) console.log(file0 = shape, await pg.evaluate(async () => { await document.fonts.ready; return [...document.querySelectorAll('.fit')].map(el => [el.className, el.scrollWidth, el.clientWidth, el.scrollHeight, el.clientHeight]); }));
|
||||
await pg.evaluate(async () => { await document.fonts.ready; window.__fit(); });
|
||||
const file = path.join(S.out, site + '-' + angle + '-' + shape + '.png');
|
||||
await pg.screenshot({ path: file, clip: { x: 0, y: 0, width: w, height: h } });
|
||||
await pg.close(); made.push(file);
|
||||
}
|
||||
}
|
||||
await browser.close();
|
||||
console.log(made.length + ' files\n' + made.join('\n'));
|
||||