Promo kit (Marty 2026-11-14: "get all the creatives built ... and put them in all the places they need to go"): promokit.js is the one source for the VBB kit, published as GET /api/promo-kit?u=<network username or wallet> (public, CORS open, read by /promote and InstantAdPay's promo center): personal links (?ref=), 21 creatives (3 angles: free daily post / every visitor pushes the loop / weekly prizes, in 125x125, 468x60, 728x90, 300x250, 160x600, 1200x630, 1080x1080) at /art/kit/vbb-<angle>-<shape>.png (ad-blocker-neutral names, rendered by tools/kit-art.mjs with Playwright), 5 lines, 3 headlines, 1 email, 2 posts built from config (perShift, viewsPerCycle, prize floor shown as "at least", never the cap). /promote page (kitpage.js + promote.js + kit.css): username from sign-in, ?u= or typed. Nav + footer link Promote. Network zones wired like DLB (common.js ZONES: footer wide/phone, Leaderboards, My Banners, How it works; 404 in server.js ZONE_404), never on the loop page; ids empty until the LinkSpin zones exist. CSP admits linkspin.app. common.js?v=2, vbb.css?v=3. Smoke 160/160 on this commit alone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@@ -0,0 +1,106 @@
|
||||
// Promo kit (Marty 2026-11-14): the ONE place the Viral Banner Blitz 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 come from config.js (free post credit per day for network members, visitors per shift, network ad views per cycle, prize
|
||||
// floor). The prize pot is shown only as "at least" the floor: the cap is internal and never shown. Packages are coming soon, so
|
||||
// nothing here sells anything. Copy rules: advertising, not income; no em dashes.
|
||||
// Creatives: public/art/kit/vbb-<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 (loop size)'], strip: [468, 60, 'Strip'], leader: [728, 90, 'Leaderboard'], box: [300, 250, 'Box'],
|
||||
tower: [160, 600, 'Skyscraper'], social: [1200, 630, 'Social share'], square: [1080, 1080, 'Square post'] };
|
||||
const ANGLES = { free: 'Free daily banner post', loop: 'Every visitor pushes the loop', prize: 'Weekly leaderboard prizes' };
|
||||
|
||||
function copy() {
|
||||
const n = x => Number(x || 0).toLocaleString('en-US');
|
||||
const floor = '$' + n(C.prizePot.floorUsd);
|
||||
const shift = C.perShift === 1 ? 'Every verified visitor shifts' : 'Every ' + n(C.perShift) + ' verified visitors shift';
|
||||
const views = n(C.viewsPerCycle) + ' network ad views';
|
||||
return {
|
||||
lines: [
|
||||
'InstantAdPay or LinkSpin member? Post a 125x125 banner on Viral Banner Blitz free every day you sign in. {{LINK}}',
|
||||
'Every real visitor pushes the Viral Banner Blitz loop forward. When your banner rides out, it earns network ad views. {{LINK}}',
|
||||
'Weekly leaderboards for the most visitors sent. The prize pot is at least ' + floor + ' a week, paid in POL. {{LINK}}',
|
||||
'No subscription. Sign in with InstantAdPay or LinkSpin, post your banner, share your link. {{LINK}}',
|
||||
'One shared loop of 125x125 banners. Real visitors only, bots and repeat visits do not count. {{LINK}}'
|
||||
],
|
||||
headlines: ['Post a Banner Free Every Day', 'Every Visitor Pushes the Loop', 'Send Visitors, Climb the Weekly Leaderboard'],
|
||||
email: {
|
||||
subject: 'Post your banner free every day',
|
||||
body: [
|
||||
'Hi,',
|
||||
'',
|
||||
'Viral Banner Blitz is one shared loop of 125x125 banners, and every visitor moves it.',
|
||||
'',
|
||||
'If you are an InstantAdPay or LinkSpin member, you get a free post credit every day you sign in. Post a banner and a link and it joins the loop.',
|
||||
'',
|
||||
shift + ' every banner one place. When yours rides out the end, it has cycled and earns ' + views + '. Bots and repeat visits do not count.',
|
||||
'',
|
||||
'There are weekly leaderboards too, for the most visitors sent and the most traffic sources. The prize pot is at least ' + floor + ' a week, paid in POL to the top three on each board.',
|
||||
'',
|
||||
'It is advertising, not an income program, and there is no subscription.',
|
||||
'',
|
||||
'Here is my link:',
|
||||
'{{LINK}}'
|
||||
].join('\n')
|
||||
},
|
||||
posts: [
|
||||
'If you are on InstantAdPay or LinkSpin, you can post a 125x125 banner on Viral Banner Blitz free every day. Real visitors push the loop, and when your banner rides out it earns network ad views.\n\n{{LINK}}',
|
||||
'Viral Banner Blitz has weekly leaderboards: most visitors sent and most traffic sources. The prize pot is at least ' + floor + ' a week, paid in POL. Share your link and climb.\n\n{{LINK}}'
|
||||
]
|
||||
};
|
||||
}
|
||||
const NOTE = 'A banner that cycles earns advertising across the network, not cash. Nothing here is an income opportunity.';
|
||||
|
||||
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 => /^vbb-[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 = 'vbb-' + 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);
|
||||
const t = copy();
|
||||
return {
|
||||
v: 1, site: C.site, name: C.siteName, updated: '2026-11-14', username: ref || null,
|
||||
tagline: 'One shared loop of 125x125 banners. Real visitors push it.',
|
||||
links: [
|
||||
{ key: 'home', label: 'Your link (the loop)', url: link },
|
||||
{ key: 'how', label: 'How it works', url: base() + '/how' + q },
|
||||
{ key: 'leaders', label: 'Weekly leaderboards', url: base() + '/leaders' + 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="Viral Banner Blitz"></a>' })),
|
||||
lines: t.lines.map(fill), headlines: t.headlines, email: { subject: t.email.subject, body: fill(t.email.body) }, posts: t.posts.map(fill),
|
||||
note: NOTE, promotePage: base() + '/promote'
|
||||
};
|
||||
}
|
||||
|
||||
// GET /api/promo-kit: public, CORS open (InstantAdPay reads it from the member's browser). /art/kit/* is served by the /art/ route.
|
||||
// GET /promote: the member Promote page (public/promote.html).
|
||||
function handle(req, res, u, sendFile) {
|
||||
if (u.pathname === '/promote' && (req.method === 'GET' || req.method === 'HEAD') && sendFile) { sendFile(res, path.join(__dirname, 'public', 'promote.html')); return true; }
|
||||
if (u.pathname !== '/api/promo-kit') return false;
|
||||
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; }
|
||||
if (req.method !== 'GET' && req.method !== 'HEAD') return false;
|
||||
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;
|
||||
}
|
||||
|
||||
module.exports = { kit, handle, creatives };
|
||||
@@ -22,7 +22,7 @@
|
||||
<meta name="theme-color" content="#ffd400">
|
||||
<link rel="icon" type="image/svg+xml" href="/art/mark.svg"><link rel="icon" type="image/png" href="/art/icon-192.png"><link rel="apple-touch-icon" href="/art/icon-192.png">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,700;12..96,800&family=DM+Sans:wght@400;500;700&family=Space+Mono:wght@400;700&display=swap">
|
||||
<link rel="stylesheet" href="/assets/vbb.css?v=2">
|
||||
<link rel="stylesheet" href="/assets/vbb.css?v=3">
|
||||
</head>
|
||||
<body>
|
||||
<main class="wrap">
|
||||
@@ -35,7 +35,7 @@
|
||||
</div>
|
||||
<div id="status" class="note" hidden></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=1"></script>
|
||||
<script src="/assets/common.js?v=2"></script>
|
||||
<script src="/assets/admin.js?v=1"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 103 KiB |
|
After Width: | Height: | Size: 132 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 6.3 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 104 KiB |
|
After Width: | Height: | Size: 136 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 7.3 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 109 KiB |
|
After Width: | Height: | Size: 155 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 6.8 KiB |
|
After Width: | Height: | Size: 36 KiB |
@@ -13,7 +13,7 @@ window.VBB = (function () {
|
||||
|
||||
function renderNav(active) {
|
||||
const nav = document.createElement('nav'); nav.className = 'top';
|
||||
const links = [['/', 'The loop'], ['/leaders', 'Leaderboards'], ['/how', 'How it works'], ['/packages', 'Packages'], ['/my', 'My Banners']];
|
||||
const links = [['/', 'The loop'], ['/leaders', 'Leaderboards'], ['/how', 'How it works'], ['/packages', 'Packages'], ['/promote', 'Promote'], ['/my', 'My Banners']];
|
||||
nav.innerHTML = '<div class="wrap"><a class="brand" href="/"><img src="/art/mark.svg" alt="" width="36" height="36"><span><span class="wm">Viral Banner <b>Blitz</b></span>'
|
||||
+ '<span class="by">Part of the Crypto Team Build Network</span></span></a><div class="links">'
|
||||
+ links.map(l => '<a href="' + l[0] + '"' + (l[0] === active ? ' class="on" aria-current="page"' : '') + '>' + l[1] + '</a>').join('') + '</div></div>';
|
||||
@@ -21,11 +21,33 @@ window.VBB = (function () {
|
||||
// inside a traffic-exchange frame, the member page opens in a new tab
|
||||
if (framed) document.querySelectorAll('nav a[href="/my"]').forEach(a => { a.target = '_blank'; a.rel = 'noopener'; });
|
||||
}
|
||||
// network ad zones (Marty 2026-11-14, the Downline Banners pattern): LinkSpin zones on Marty's account, one per placement, each
|
||||
// mounted once with a small 'Network' label. Footer (wide / phone), Leaderboards, My Banners, How it works; the 404 zone is in
|
||||
// server.js. NEVER on the loop page (/) or admin. An empty id = that placement stays off.
|
||||
const ZONES = { footWide: '', footPhone: '', leaders: '', my: '', how: '' };
|
||||
function zone(el, key) {
|
||||
if (!el || el.dataset.zoned || !ZONES[key]) return; el.dataset.zoned = '1'; el.classList.add('net-zone');
|
||||
const lab = document.createElement('div'); lab.className = 'net-zone-label'; lab.textContent = 'Network';
|
||||
const s = document.createElement('script'); s.async = true; s.src = 'https://linkspin.app/z.js'; s.setAttribute('data-zone', ZONES[key]);
|
||||
el.appendChild(lab); el.appendChild(s);
|
||||
}
|
||||
function slot(after) { if (!after || !after.parentNode) return null; const d = document.createElement('div'); d.className = 'net-zone-slot'; after.parentNode.insertBefore(d, after.nextSibling); return d; }
|
||||
function pageZones() {
|
||||
const p = location.pathname.replace(/\/$/, '') || '/';
|
||||
if (p === '/' || p === '/admin') return;
|
||||
const card = id => { const el = $(id); return el ? el.closest('.card') : null; };
|
||||
if (p === '/leaders') zone(slot(card('lbVisitors')), 'leaders');
|
||||
if (p === '/my') zone(slot($('stats')), 'my');
|
||||
if (p === '/how') zone(slot(document.querySelectorAll('main .card')[1]), 'how');
|
||||
const za = document.createElement('div'); za.className = 'wrap net-zone-foot'; document.body.appendChild(za);
|
||||
zone(za, window.innerWidth >= 760 ? 'footWide' : 'footPhone');
|
||||
}
|
||||
function renderFooter() {
|
||||
pageZones();
|
||||
const f = document.createElement('footer'); f.className = 'foot';
|
||||
f.innerHTML = '<div class="wrap"><p><b>Viral Banner Blitz</b>, part of the Crypto Team Build Network</p>'
|
||||
+ '<p>A banner that cycles earns advertising across the network, not cash. Nothing here is an income opportunity.</p>'
|
||||
+ '<p><a href="/">The loop</a> · <a href="/leaders">Leaderboards</a> · <a href="/how">How it works</a> · <a href="/packages">Packages</a> · <a href="/my">My Banners</a></p></div>';
|
||||
+ '<p><a href="/">The loop</a> · <a href="/leaders">Leaderboards</a> · <a href="/how">How it works</a> · <a href="/packages">Packages</a> · <a href="/promote">Promote</a> · <a href="/my">My Banners</a></p></div>';
|
||||
document.body.appendChild(f);
|
||||
toasts();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
/* Promote page (2026-11-14), pop-art look. 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;background:var(--bg2);border:var(--edge);border-radius:10px;padding:11px 12px;color:var(--ink);font:14px var(--mono)}
|
||||
.kit-who input:focus{outline:3px solid var(--sky);outline-offset:1px}
|
||||
.kit-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:10px 0;border-top:2px dashed 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:700 11px var(--mono);color:var(--muted);text-transform:uppercase;letter-spacing:.1em}
|
||||
.kit-url{font-family:var(--mono);font-size:13.5px;overflow-wrap:anywhere;color:var(--sky);font-weight:700}
|
||||
.kit-txt{flex:1 1 300px;margin:0;min-width:0}
|
||||
.kit-pre{white-space:pre-wrap;font-family:var(--body);font-size:14.5px;line-height:1.55;margin:10px 0 0;padding:12px 14px;border-radius:12px;border:var(--edge);background:var(--bg2);overflow-wrap:anywhere}
|
||||
.kit-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:6px 0 16px}
|
||||
.kit-tab{font:800 14px/1 var(--disp);padding:9px 13px;border-radius:999px;border:2.5px solid var(--ink);background:var(--panel);color:var(--ink);cursor:pointer;box-shadow:var(--shadow-sm)}
|
||||
.kit-tab.on{background:var(--amber)}
|
||||
.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}
|
||||
.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 Banners), then the last one typed here (this browser only).
|
||||
(async function () {
|
||||
VBB.renderNav('/promote'); VBB.renderFooter();
|
||||
const $ = VBB.$; 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 VBB.getJSON('/api/me'); if (me.signedIn) { u = me.username || me.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); VBB.status(''); } catch (e) { VBB.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 VBB.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);
|
||||
})();
|
||||
@@ -155,3 +155,6 @@ footer.foot a{color:var(--amber)} footer.foot p{margin:6px 0}
|
||||
.toast.in{opacity:1;transform:rotate(-1deg)} .toast span{color:var(--muted);font-size:12.5px}
|
||||
[hidden]{display:none!important}
|
||||
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
|
||||
/* network zones (2026-11-14): neutral class names, centered, small label */
|
||||
.net-zone{display:flex;flex-direction:column;align-items:center;gap:4px;margin:18px auto;max-width:100%;overflow:hidden}
|
||||
.net-zone-label{font:700 10.5px var(--mono);letter-spacing:.1em;text-transform:uppercase;color:var(--faint)}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<meta name="theme-color" content="#ffd400">
|
||||
<link rel="icon" type="image/svg+xml" href="/art/mark.svg"><link rel="icon" type="image/png" href="/art/icon-192.png"><link rel="apple-touch-icon" href="/art/icon-192.png">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,700;12..96,800&family=DM+Sans:wght@400;500;700&family=Space+Mono:wght@400;700&display=swap">
|
||||
<link rel="stylesheet" href="/assets/vbb.css?v=2">
|
||||
<link rel="stylesheet" href="/assets/vbb.css?v=3">
|
||||
</head>
|
||||
<body>
|
||||
<main class="wrap">
|
||||
@@ -49,7 +49,7 @@
|
||||
</div>
|
||||
<div id="status" class="note" hidden></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=1"></script>
|
||||
<script src="/assets/common.js?v=2"></script>
|
||||
<script src="/assets/static.js?v=1"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<meta name="theme-color" content="#ffd400">
|
||||
<link rel="icon" type="image/svg+xml" href="/art/mark.svg"><link rel="icon" type="image/png" href="/art/icon-192.png"><link rel="apple-touch-icon" href="/art/icon-192.png">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,700;12..96,800&family=DM+Sans:wght@400;500;700&family=Space+Mono:wght@400;700&display=swap">
|
||||
<link rel="stylesheet" href="/assets/vbb.css?v=2">
|
||||
<link rel="stylesheet" href="/assets/vbb.css?v=3">
|
||||
</head>
|
||||
<body>
|
||||
<main class="wrap">
|
||||
@@ -55,7 +55,7 @@
|
||||
</div>
|
||||
<div id="status" class="note" hidden></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=1"></script>
|
||||
<script src="/assets/common.js?v=2"></script>
|
||||
<script src="/assets/splash.js?v=1"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<meta name="theme-color" content="#ffd400">
|
||||
<link rel="icon" type="image/svg+xml" href="/art/mark.svg"><link rel="icon" type="image/png" href="/art/icon-192.png"><link rel="apple-touch-icon" href="/art/icon-192.png">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,700;12..96,800&family=DM+Sans:wght@400;500;700&family=Space+Mono:wght@400;700&display=swap">
|
||||
<link rel="stylesheet" href="/assets/vbb.css?v=2">
|
||||
<link rel="stylesheet" href="/assets/vbb.css?v=3">
|
||||
</head>
|
||||
<body>
|
||||
<main class="wrap">
|
||||
@@ -32,7 +32,7 @@
|
||||
<div class="card"><h2>Most traffic sources</h2><p class="muted small">Different websites your visitors came from (the referring site), so spreading your link widely counts.</p><div class="scroll" id="lbSources"></div></div>
|
||||
<div id="status" class="note" hidden></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=1"></script>
|
||||
<script src="/assets/common.js?v=2"></script>
|
||||
<script src="/assets/leaders.js?v=2"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<meta name="theme-color" content="#ffd400">
|
||||
<link rel="icon" type="image/svg+xml" href="/art/mark.svg"><link rel="icon" type="image/png" href="/art/icon-192.png"><link rel="apple-touch-icon" href="/art/icon-192.png">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,700;12..96,800&family=DM+Sans:wght@400;500;700&family=Space+Mono:wght@400;700&display=swap">
|
||||
<link rel="stylesheet" href="/assets/vbb.css?v=2">
|
||||
<link rel="stylesheet" href="/assets/vbb.css?v=3">
|
||||
</head>
|
||||
<body>
|
||||
<main class="wrap">
|
||||
@@ -73,7 +73,7 @@
|
||||
</div>
|
||||
<div id="status" class="note" hidden></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=1"></script>
|
||||
<script src="/assets/common.js?v=2"></script>
|
||||
<script src="/assets/wallet.js?v=1"></script>
|
||||
<script src="/assets/my.js?v=1"></script>
|
||||
</body>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<meta name="theme-color" content="#ffd400">
|
||||
<link rel="icon" type="image/svg+xml" href="/art/mark.svg"><link rel="icon" type="image/png" href="/art/icon-192.png"><link rel="apple-touch-icon" href="/art/icon-192.png">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,700;12..96,800&family=DM+Sans:wght@400;500;700&family=Space+Mono:wght@400;700&display=swap">
|
||||
<link rel="stylesheet" href="/assets/vbb.css?v=2">
|
||||
<link rel="stylesheet" href="/assets/vbb.css?v=3">
|
||||
</head>
|
||||
<body>
|
||||
<main class="wrap">
|
||||
@@ -40,7 +40,7 @@
|
||||
<div class="card center"><p>Until packages open, every network member (InstantAdPay or LinkSpin) gets one free post credit each day they sign in.</p><a class="btn" href="/my">Use my free credit</a></div>
|
||||
<div id="status" class="note" hidden></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=1"></script>
|
||||
<script src="/assets/common.js?v=2"></script>
|
||||
<script src="/assets/static.js?v=2"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">
|
||||
<title>Promote | Viral Banner Blitz</title>
|
||||
<meta name="description" content="Promote Viral Banner Blitz: your personal links, ready-made creatives in every common size, short lines, headlines, an email and social posts.">
|
||||
<link rel="canonical" href="https://viralbannerblitz.com/promote">
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:site_name" content="Viral Banner Blitz">
|
||||
<meta property="og:title" content="Promote | Viral Banner Blitz">
|
||||
<meta property="og:description" content="Promote Viral Banner Blitz: your personal links, ready-made creatives in every common size, short lines, headlines, an email and social posts.">
|
||||
<meta property="og:url" content="https://viralbannerblitz.com/promote">
|
||||
<meta property="og:image" content="https://viralbannerblitz.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="Viral Banner Blitz: a community banner loop that moves with every verified visitor">
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:title" content="Promote | Viral Banner Blitz">
|
||||
<meta name="twitter:description" content="Promote Viral Banner Blitz: your personal links, ready-made creatives in every common size, short lines, headlines, an email and social posts.">
|
||||
<meta name="twitter:image" content="https://viralbannerblitz.com/art/og-share.png">
|
||||
|
||||
<meta name="theme-color" content="#ffd400">
|
||||
<link rel="icon" type="image/svg+xml" href="/art/mark.svg"><link rel="icon" type="image/png" href="/art/icon-192.png"><link rel="apple-touch-icon" href="/art/icon-192.png">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,700;12..96,800&family=DM+Sans:wght@400;500;700&family=Space+Mono:wght@400;700&display=swap">
|
||||
<link rel="stylesheet" href="/assets/vbb.css?v=3">
|
||||
<link rel="stylesheet" href="/assets/kit.css?v=1">
|
||||
</head>
|
||||
<body>
|
||||
<main class="wrap">
|
||||
<section class="hero"><span class="eyebrow"><i></i>Share the loop</span><h1>Promote <em>Viral Banner Blitz</em></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. Sign in on <a href="/my">My Banners</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=2"></script>
|
||||
<script src="/assets/kitpage.js?v=1"></script>
|
||||
<script src="/assets/promote.js?v=1"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -155,6 +155,34 @@ async function main() {
|
||||
ok(sp.loopSize === 5 && sp.perShift === 3 && sp.progress === 0 && sp.loop.length === 0 && sp.waiting === 0, 'empty loop at start', sp);
|
||||
for (const pth of ['/leaders', '/how', '/packages', '/robots.txt', '/sitemap.xml', '/art/mark.svg', '/assets/vbb.css', '/assets/splash.js']) { r = await anon.req(pth); ok(r.status === 200, 'GET ' + pth + ' 200', r.status); }
|
||||
r = await anon.req('/my'); ok(r.status === 200 && r.headers.get('x-frame-options') === 'DENY', '/my served, never framed');
|
||||
// promo kit (2026-11-14): one public feed read by /promote and by InstantAdPay's promo center
|
||||
{
|
||||
const kr = await anon.req('/api/promo-kit?u=smokeleader'); 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 === 'smokeleader' && k.links.length === 3 && k.links.every(l => l.url.startsWith('https://viralbannerblitz.com/') && l.url.endsWith('?ref=smokeleader')), '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.subject && k.email.body.includes('?ref=smokeleader'), '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) && !/\$50|passive income|guaranteed (income|returns|profit)|earn (cash|money)|make money/i.test(words) && /at least \$20/.test(words), 'promo kit copy: no dashes, no cap, no income promises, pot shown as at least $20');
|
||||
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://viralbannerblitz.com', '')));
|
||||
ok(badName.length === 0, 'promo kit: creative paths are ad-blocker neutral (no size tokens, no banner/ad words)', badName.map(c => c.url));
|
||||
let dimOk = true; const dimBad = [];
|
||||
for (const c of k.creatives) {
|
||||
const rr = await anon.req(new URL(c.url).pathname); const buf = Buffer.from(await rr.arrayBuffer());
|
||||
const w = buf.readUInt32BE(16), h = buf.readUInt32BE(20);
|
||||
if (rr.status !== 200 || rr.headers.get('content-type') !== 'image/png' || w !== c.w || h !== c.h) { dimOk = false; dimBad.push(c.key + ' ' + rr.status + ' ' + w + 'x' + h); }
|
||||
if (!c.html.includes('href="https://viralbannerblitz.com/?ref=smokeleader"')) { dimOk = false; dimBad.push(c.key + ' html'); }
|
||||
}
|
||||
ok(dimOk, 'promo kit: every creative is served as PNG at its exact size, HTML links to the member', dimBad);
|
||||
const k2 = await (await anon.req('/api/promo-kit?u=' + encodeURIComponent('<b>x</b>'))).json();
|
||||
ok(k2.username === null && k2.links[0].url === 'https://viralbannerblitz.com/', 'promo kit: a bad username is ignored (plain links)', k2.links[0]);
|
||||
r = await anon.req('/promote'); const ph = await r.text();
|
||||
ok(r.status === 200 && /id="kit"/.test(ph) && /kitpage\.js/.test(ph), 'GET /promote serves the Promote page');
|
||||
r = await anon.req('/no-such-page'); const nf = await r.text();
|
||||
ok(r.status === 404 && /Back to the loop/.test(nf), '404 page served');
|
||||
ok(/script-src[^;]*https:\/\/linkspin\.app/.test(r.headers.get('content-security-policy') || ''), 'CSP admits linkspin.app (network zones)');
|
||||
r = await anon.req('/sitemap.xml'); ok((await r.text()).includes('/promote'), 'sitemap lists /promote');
|
||||
}
|
||||
r = await anon.req('/api/my'); ok(r.status === 401, '/api/my needs sign-in');
|
||||
|
||||
console.log('4. members: wallet sign-in and network sign-in');
|
||||
@@ -405,6 +433,13 @@ async function main() {
|
||||
await pg.goto(BASE + '/my', { waitUntil: 'domcontentloaded' }); await pg.waitForSelector('#dash:not([hidden])', { timeout: 8000 });
|
||||
ok((await pg.inputValue('#share')).endsWith('?ref=smokeleader'), name + ': My Banners shows the share link');
|
||||
await pg.screenshot({ path: path.join(OUT, 'my-' + name + '.png'), fullPage: true });
|
||||
// Promote page, signed in: the kit fills in the member's username
|
||||
await pg.goto(BASE + '/promote', { waitUntil: 'domcontentloaded' }); await pg.waitForSelector('#kit .kit-fig img', { timeout: 8000 });
|
||||
ok((await pg.textContent('#kit')).includes('?ref=smokeleader') && (await pg.inputValue('#whoIn')) === 'smokeleader', name + ': Promote page shows the kit with the member links');
|
||||
ok(!!(await pg.$('nav a[href="/promote"]')), name + ': nav links to Promote');
|
||||
await pg.waitForTimeout(600); await pg.screenshot({ path: path.join(OUT, 'promote-' + name + '.png'), fullPage: true });
|
||||
await pg.goto(BASE + '/', { waitUntil: 'domcontentloaded' }); await pg.waitForTimeout(300);
|
||||
ok(!(await pg.$('script[src*="linkspin.app/z.js"]')), name + ': no network zone on the loop page');
|
||||
await ctx.close();
|
||||
}
|
||||
ok(errs.length === 0, 'no page errors', errs);
|
||||
|
||||
@@ -19,6 +19,7 @@ const loop = require('./loop');
|
||||
const safety = require('./safety');
|
||||
const networksso = require('./networksso');
|
||||
const shop = require('./shop');
|
||||
const promokit = require('./promokit'); // promo kit feed /api/promo-kit + the /promote page (2026-11-14)
|
||||
const hubreport = require('./hubreport'); // network hub report by wallet (off unless HUB_ENABLED)
|
||||
|
||||
const PUB = path.join(__dirname, 'public');
|
||||
@@ -37,8 +38,8 @@ const hash = s => crypto.createHmac('sha256', SECRET).update(s).digest('hex').sl
|
||||
// ---- http helpers ----
|
||||
const MIME = { '.html': 'text/html; charset=utf-8', '.css': 'text/css', '.js': 'text/javascript', '.png': 'image/png', '.jpg': 'image/jpeg',
|
||||
'.gif': 'image/gif', '.svg': 'image/svg+xml', '.ico': 'image/x-icon', '.json': 'application/json', '.txt': 'text/plain; charset=utf-8', '.xml': 'application/xml' };
|
||||
const CSP = "default-src 'self'; script-src 'self' https://cdn.jsdelivr.net; worker-src 'self' blob:; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; "
|
||||
+ "img-src 'self' data: blob: https:; connect-src 'self' https://*.walletconnect.com wss://*.walletconnect.com https://*.walletconnect.org wss://*.walletconnect.org "
|
||||
const CSP = "default-src 'self'; script-src 'self' https://cdn.jsdelivr.net https://linkspin.app; worker-src 'self' blob:; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; "
|
||||
+ "img-src 'self' data: blob: https:; connect-src 'self' https://linkspin.app https://*.walletconnect.com wss://*.walletconnect.com https://*.walletconnect.org wss://*.walletconnect.org "
|
||||
+ "https://*.reown.com wss://*.reown.com https://*.reown.org wss://*.reown.org https://*.web3modal.org https://*.drpc.org https://*.publicnode.com https://*.coinbase.com; "
|
||||
+ "font-src 'self' data: https://fonts.gstatic.com https://fonts.reown.com; form-action 'self'; frame-src https: 'self'";
|
||||
function headers(extra) { return Object.assign({ 'Content-Security-Policy': CSP, 'X-Content-Type-Options': 'nosniff', 'Referrer-Policy': 'strict-origin-when-cross-origin' }, extra || {}); }
|
||||
@@ -207,6 +208,9 @@ function oldLink(u) {
|
||||
return net ? '/?ref=' + encodeURIComponent(net) : '/';
|
||||
}
|
||||
|
||||
// network ad zone on the 404 page (LinkSpin zone on Marty's account, 300x250; the page zones live in public/assets/common.js ZONES). '' = none
|
||||
const ZONE_404 = '';
|
||||
|
||||
const PAGES = { '/': 'index.html', '/my': 'my.html', '/leaders': 'leaders.html', '/how': 'how.html', '/packages': 'packages.html', '/admin': 'admin.html' };
|
||||
const challenges = new Map();
|
||||
const clickSeen = new Map();
|
||||
@@ -217,6 +221,7 @@ const server = http.createServer(async (req, res) => {
|
||||
if (C.isProd && host !== C.site && host.endsWith('.' + C.site)) { res.writeHead(301, { Location: 'https://' + C.site + req.url, 'Cache-Control': 'no-store' }); return res.end(); } }
|
||||
try {
|
||||
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') && promokit.handle(req, res, u, sendFile)) return;
|
||||
|
||||
if (req.method === 'GET' || req.method === 'HEAD') {
|
||||
if (p === '/health') return json(res, 200, { ok: true, store: docstore.isOn() ? 'mysql' : 'files' });
|
||||
@@ -231,7 +236,7 @@ const server = http.createServer(async (req, res) => {
|
||||
if (/^\/r\/[^/]+$/.test(p)) { res.writeHead(302, { Location: '/?ref=' + encodeURIComponent(decodeURIComponent(p.slice(3))) }); return res.end(); }
|
||||
if (p === '/sitemap.xml') {
|
||||
const day = new Date().toISOString().slice(0, 10);
|
||||
const urls = ['/', '/leaders', '/how', '/packages'].map(x => '<url><loc>https://' + C.site + x + '</loc><lastmod>' + day + '</lastmod></url>').join('');
|
||||
const urls = ['/', '/leaders', '/how', '/packages', '/promote'].map(x => '<url><loc>https://' + C.site + x + '</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>');
|
||||
}
|
||||
@@ -411,7 +416,8 @@ const server = http.createServer(async (req, res) => {
|
||||
|
||||
if (p.startsWith('/api/')) return json(res, 404, { error: 'Not found' });
|
||||
res.writeHead(404, headers({ 'Content-Type': 'text/html; charset=utf-8' }));
|
||||
return res.end('<!doctype html><meta name="viewport" content="width=device-width,initial-scale=1"><title>Not found</title><body style="background:#fff4dc;color:#14121f;font-family:sans-serif;text-align:center;padding:40px 16px"><p>Not found. <a style="color:#ff2d87;font-weight:700" href="/">Back to the loop</a></p></body>');
|
||||
return res.end('<!doctype html><meta name="viewport" content="width=device-width,initial-scale=1"><title>Not found</title><body style="background:#fff4dc;color:#14121f;font-family:sans-serif;text-align:center;padding:40px 16px"><p>Not found. <a style="color:#ff2d87;font-weight:700" href="/">Back to the loop</a></p>'
|
||||
+ (ZONE_404 ? '<p style="color:#4d4862;font-size:11px;margin:24px 0 4px">Network</p><script async src="https://linkspin.app/z.js" data-zone="' + ZONE_404 + '"></script>' : '') + '</body>');
|
||||
} catch (e) {
|
||||
console.error('request', p, e.message);
|
||||
if (!res.headersSent) json(res, 500, { error: 'Server error' });
|
||||
|
||||
@@ -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'));
|
||||