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>
This commit is contained in:
martbost
2026-11-14 09:41:50 -06:00
parent 840161b367
commit a6a9b3cace
37 changed files with 522 additions and 18 deletions
+25
View File
@@ -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);
})();