// 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 netsites = require('./netsites'); // tracked links: LinkSpin network link for this site, ?src= (2026-11-14) 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); // the same page through LinkSpin (Marty 2026-11-14: each network site its own traffic source): counted under this site, lands with ?ref= const track = seg => netsites.tracked('dlb', 'dlb', { s1: ref, s2: seg }); 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, tracked: track('') }, { key: 'how', label: 'How it works', url: base() + '/how' + q, tracked: track('how') }, { key: 'join', label: 'Get a spot', url: base() + '/join' + q, tracked: track('join') } ], linkTemplate: base() + '/?ref={username}', trackedTemplate: netsites.tracked('dlb', 'dlb') + '&s1={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 };