diff --git a/promokit.js b/promokit.js new file mode 100644 index 0000000..e57b078 --- /dev/null +++ b/promokit.js @@ -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=, 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/--.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: 'Downline Banners' })), + 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/.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 }; diff --git a/public/art/kit/dlb-instant-box.png b/public/art/kit/dlb-instant-box.png new file mode 100644 index 0000000..2a19a6e Binary files /dev/null and b/public/art/kit/dlb-instant-box.png differ diff --git a/public/art/kit/dlb-instant-leader.png b/public/art/kit/dlb-instant-leader.png new file mode 100644 index 0000000..fba0b79 Binary files /dev/null and b/public/art/kit/dlb-instant-leader.png differ diff --git a/public/art/kit/dlb-instant-social.png b/public/art/kit/dlb-instant-social.png new file mode 100644 index 0000000..c265eac Binary files /dev/null and b/public/art/kit/dlb-instant-social.png differ diff --git a/public/art/kit/dlb-instant-square.png b/public/art/kit/dlb-instant-square.png new file mode 100644 index 0000000..9637e92 Binary files /dev/null and b/public/art/kit/dlb-instant-square.png differ diff --git a/public/art/kit/dlb-instant-strip.png b/public/art/kit/dlb-instant-strip.png new file mode 100644 index 0000000..3d97fa2 Binary files /dev/null and b/public/art/kit/dlb-instant-strip.png differ diff --git a/public/art/kit/dlb-instant-tile.png b/public/art/kit/dlb-instant-tile.png new file mode 100644 index 0000000..c0d0259 Binary files /dev/null and b/public/art/kit/dlb-instant-tile.png differ diff --git a/public/art/kit/dlb-instant-tower.png b/public/art/kit/dlb-instant-tower.png new file mode 100644 index 0000000..0d6c3e3 Binary files /dev/null and b/public/art/kit/dlb-instant-tower.png differ diff --git a/public/art/kit/dlb-line-box.png b/public/art/kit/dlb-line-box.png new file mode 100644 index 0000000..18d63c6 Binary files /dev/null and b/public/art/kit/dlb-line-box.png differ diff --git a/public/art/kit/dlb-line-leader.png b/public/art/kit/dlb-line-leader.png new file mode 100644 index 0000000..32e7fe4 Binary files /dev/null and b/public/art/kit/dlb-line-leader.png differ diff --git a/public/art/kit/dlb-line-social.png b/public/art/kit/dlb-line-social.png new file mode 100644 index 0000000..34e0a5f Binary files /dev/null and b/public/art/kit/dlb-line-social.png differ diff --git a/public/art/kit/dlb-line-square.png b/public/art/kit/dlb-line-square.png new file mode 100644 index 0000000..c6ca1da Binary files /dev/null and b/public/art/kit/dlb-line-square.png differ diff --git a/public/art/kit/dlb-line-strip.png b/public/art/kit/dlb-line-strip.png new file mode 100644 index 0000000..025f95d Binary files /dev/null and b/public/art/kit/dlb-line-strip.png differ diff --git a/public/art/kit/dlb-line-tile.png b/public/art/kit/dlb-line-tile.png new file mode 100644 index 0000000..5856715 Binary files /dev/null and b/public/art/kit/dlb-line-tile.png differ diff --git a/public/art/kit/dlb-line-tower.png b/public/art/kit/dlb-line-tower.png new file mode 100644 index 0000000..0578c29 Binary files /dev/null and b/public/art/kit/dlb-line-tower.png differ diff --git a/public/art/kit/dlb-spot-box.png b/public/art/kit/dlb-spot-box.png new file mode 100644 index 0000000..223c8e8 Binary files /dev/null and b/public/art/kit/dlb-spot-box.png differ diff --git a/public/art/kit/dlb-spot-leader.png b/public/art/kit/dlb-spot-leader.png new file mode 100644 index 0000000..a44f351 Binary files /dev/null and b/public/art/kit/dlb-spot-leader.png differ diff --git a/public/art/kit/dlb-spot-social.png b/public/art/kit/dlb-spot-social.png new file mode 100644 index 0000000..4786110 Binary files /dev/null and b/public/art/kit/dlb-spot-social.png differ diff --git a/public/art/kit/dlb-spot-square.png b/public/art/kit/dlb-spot-square.png new file mode 100644 index 0000000..22b2d6e Binary files /dev/null and b/public/art/kit/dlb-spot-square.png differ diff --git a/public/art/kit/dlb-spot-strip.png b/public/art/kit/dlb-spot-strip.png new file mode 100644 index 0000000..9400149 Binary files /dev/null and b/public/art/kit/dlb-spot-strip.png differ diff --git a/public/art/kit/dlb-spot-tile.png b/public/art/kit/dlb-spot-tile.png new file mode 100644 index 0000000..e59226b Binary files /dev/null and b/public/art/kit/dlb-spot-tile.png differ diff --git a/public/art/kit/dlb-spot-tower.png b/public/art/kit/dlb-spot-tower.png new file mode 100644 index 0000000..3968784 Binary files /dev/null and b/public/art/kit/dlb-spot-tower.png differ diff --git a/public/assets/common.js b/public/assets/common.js index 97e1cc3..7f912b2 100644 --- a/public/assets/common.js +++ b/public/assets/common.js @@ -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 = ''; @@ -37,7 +37,7 @@ window.BL = (function () { f.className = 'bl-foot'; f.innerHTML = '

Part of the Crypto Team Build Network

' + '

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.

' - + '

How it works · Board · Live ledger · Contract proof · My Spots

'; + + '

How it works · Board · Live ledger · Contract proof · Promote · My Spots

'; document.body.appendChild(f); toasts(); } diff --git a/public/assets/kit.css b/public/assets/kit.css new file mode 100644 index 0000000..0010e9f --- /dev/null +++ b/public/assets/kit.css @@ -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} diff --git a/public/assets/kitpage.js b/public/assets/kitpage.js new file mode 100644 index 0000000..cc1aa80 --- /dev/null +++ b/public/assets/kitpage.js @@ -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 ''; }; + // 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 += '

Your links

' + (k.username ? '

Every link, creative and line below carries ' + esc(k.username) + '.

' : '

Add your network username above so these links carry it.

') + + k.links.map(l => '
' + esc(l.label) + '' + esc(l.url) + '
' + cb(l.url, 'Copy link', '') + '
').join('') + '
'; + h += '

Creatives

Download them, or copy the HTML: it already links to you.

' + + angles.map((c, i) => '').join('') + '
'; + angles.forEach((a, i) => { + h += '
' + by[a.angle].map(c => + '
' + esc(k.name + ', ' + c.label) + '' + + '
' + esc(c.label) + ' ' + c.w + 'x' + c.h + 'Download' + cb(c.url, 'Copy URL') + cb(c.html, 'Copy HTML') + '
').join('') + '
'; + }); + h += '
'; + h += '

Short lines

For chats, comments, text ads and signatures.

' + k.lines.map(t => '

' + esc(t) + '

' + cb(t) + '
').join('') + '
'; + h += '

Headlines

' + k.headlines.map(t => '

' + esc(t) + '

' + cb(t) + '
').join('') + '
'; + h += '

Email

Subject' + esc(k.email.subject) + '

' + cb(k.email.subject, 'Copy subject') + '
' + + '
' + esc(k.email.body) + '
' + cb(k.email.body, 'Copy email') + '
'; + h += '

Social posts

' + k.posts.map(t => '
' + esc(t) + '
' + cb(t, 'Copy post') + '
').join('') + '
'; + if (k.note) h += '

' + esc(k.note) + '

'; + 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 }; +})(); diff --git a/public/assets/promote.js b/public/assets/promote.js new file mode 100644 index 0000000..6b37e41 --- /dev/null +++ b/public/assets/promote.js @@ -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); +})(); diff --git a/public/board.html b/public/board.html index 2b8eec3..20c6351 100644 --- a/public/board.html +++ b/public/board.html @@ -31,7 +31,7 @@

The line so far

- + diff --git a/public/contract.html b/public/contract.html index 9a20ce4..989d3e4 100644 --- a/public/contract.html +++ b/public/contract.html @@ -35,7 +35,7 @@
  • Open any sale in the live ledger and look at its Logs: one SpotBought event, then one Paid event per payment.
  • - + diff --git a/public/how.html b/public/how.html index f3e1638..0c9fc70 100644 --- a/public/how.html +++ b/public/how.html @@ -39,7 +39,7 @@

    The momentum fund

    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.

    The rest of the network

    Open board slots show network sites such as InstantAdPay and LinkSpin. On InstantAdPay, ad credits buy advertising, not income.

    - + diff --git a/public/index.html b/public/index.html index dd0ad96..2096162 100644 --- a/public/index.html +++ b/public/index.html @@ -52,7 +52,7 @@ - + diff --git a/public/join.html b/public/join.html index 8d20f24..5630228 100644 --- a/public/join.html +++ b/public/join.html @@ -48,7 +48,7 @@ - + diff --git a/public/ledger.html b/public/ledger.html index 7d8171e..0d327dc 100644 --- a/public/ledger.html +++ b/public/ledger.html @@ -30,7 +30,7 @@

    Spot sales

    Loading the ledger...

    - + diff --git a/public/my.html b/public/my.html index 0d9f114..21392f3 100644 --- a/public/my.html +++ b/public/my.html @@ -41,7 +41,7 @@ - + diff --git a/public/promote.html b/public/promote.html new file mode 100644 index 0000000..1b9f0a0 --- /dev/null +++ b/public/promote.html @@ -0,0 +1,40 @@ + + + + +Promote | Downline Banners + + + + + + + + + + + + + + + + + + + + + + +
    +

    Promote Downline Banners

    Your links, creatives in every common size, and copy you can paste anywhere. Everything carries your network username.

    +

    Your network username

    +

    Your InstantAdPay or LinkSpin username works here too. Sign in on My Spots and it fills in by itself.

    +
    + +

    Loading the kit...

    +
    + + + + + diff --git a/qa/smoke.mjs b/qa/smoke.mjs index d0a4720..5091a04 100644 --- a/qa/smoke.mjs +++ b/qa/smoke.mjs @@ -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=', 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(''))).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; } diff --git a/server.js b/server.js index 4f1e919..b649d6b 100644 --- a/server.js +++ b/server.js @@ -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 => 'https://' + C.site + u + '' + day + '').join(''); + const urls = ['/', '/board', '/how', '/ledger', '/contract', '/join', '/promote'].map(u => 'https://' + C.site + u + '' + day + '').join(''); res.writeHead(200, headers({ 'Content-Type': 'application/xml; charset=utf-8', 'Cache-Control': 'public, max-age=3600' })); return res.end('' + urls + ''); } diff --git a/tools/kit-art.mjs b/tools/kit-art.mjs new file mode 100644 index 0000000..c1b0c2a --- /dev/null +++ b/tools/kit-art.mjs @@ -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: /public/art/kit/--.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 = ``; + +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) => '
    ' + Array.from({ length: n }, (_, i) => '').join('') + '
    '; + +function body(site, a, shape) { + const S = SITES[site]; const m = '
    ' + S.mark + '
    '; const d = site === 'dlb'; + const wm = d ? 'Downline Banners' : 'Viral Banner Blitz'; + const h2 = d ? '' + esc(a.h2) + '' : '' + esc(a.h2) + ''; + const chips = a.chips.map(c => '' + esc(c) + '').join(''); + switch (shape) { + case 'tile': return `
    ${m}
    ${esc(a.tA)}
    ${esc(a.tB)}
    ${esc(S.domain)}
    `; + case 'strip': return `
    ${m}
    ${esc(a.line)}
    ${esc(S.name.join(' '))} · ${esc(S.domain)}
    ${esc(a.cta)}
    `; + case 'leader': return `
    ${m}
    ${esc(a.h1)} ${h2}
    ${esc(a.sub)}
    ${esc(a.cta)}
    `; + case 'box': return `
    ${m}${wm}
    ${esc(a.eyebrow)}
    ${esc(a.h1)}${h2.replace('
    ${esc(a.sub)}
    ${esc(a.cta)} →
    `; + case 'tower': return `
    ${m}${d ? 'Downline
    Banners
    ' : 'Viral Banner Blitz'}${esc(a.eyebrow)}
    ${esc(a.h1)}${h2}
    ${esc(a.sub)}
    ${esc(a.cta)}
    ${esc(S.domain)}
    `; + case 'social': return d ? `
    ${m}${wm}
    ${esc(a.eyebrow)}
    ${esc(a.h1)}${h2}
    ${esc(a.sub)}
    ${chips}${esc(S.domain)}
    ` + : `${vTiles(12)}
    ${esc(a.eyebrow)}
    ${esc(a.h1)}${h2}
    ${esc(a.sub)}
    ${m}${esc(S.domain)}
    `; + case 'square': return d ? `
    ${m}${wm}
    ${esc(a.eyebrow)}
    ${esc(a.h1)}${h2}
    ${esc(a.sub)}
    ${chips}
    ${esc(S.domain)}
    ` + : `${vTiles(6)}
    ${m}${wm}
    ${esc(a.eyebrow)}
    ${esc(a.h1)}${h2}
    ${esc(a.sub)}
    ${chips}${esc(S.domain)}
    `; + } +} + +function page(site, angle, shape) { + const S = SITES[site]; const [w, h] = SHAPES[shape]; + return ` + ${FIT}${body(site, S.angles[angle], shape)}`; +} + +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'));