f26ac15712
$10 one-time DraftPosition purchases (sponsor 25%, L2-5 5%, 10% Best Coach pot, 45% company) with keeper-signed hub-line vouchers; pure draft engine with a mocked clock; no contact data anywhere; Telegram to an outbox unless TG_LIVE=1. Unit 60/60, smoke 156/156 (Playwright 1280/390). Not deployed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
100 lines
6.4 KiB
JavaScript
100 lines
6.4 KiB
JavaScript
// Promo kit (the VBB / ViralAdBlitz pattern): the ONE place the 5xYourTeam creatives and swipe copy live. Published as a public JSON
|
|
// feed, GET /api/promo-kit?u=<network username or wallet>, read by /promote and by InstantAdPay's promo center ("Network sites").
|
|
// Facts come from config.js (position price, picks on buy, split). Copy rules: a position buys a seat in the draft, not income;
|
|
// nothing is promised; no em dashes; no earnings caps; wallets = "SafePal or any other crypto wallet"; never a subscription.
|
|
// Creatives: public/art/kit/fx-<angle>-<shape>.png, rendered by tools/art.mjs (neutral names: no size tokens, no ad words).
|
|
'use strict';
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
const C = require('./config').get();
|
|
const netsites = require('./netsites');
|
|
|
|
const KIT_DIR = path.join(__dirname, 'public', 'art', 'kit');
|
|
const SHAPES = { tile: [125, 125, 'Square button'], 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 = { draft: 'The weekly draft', coach: 'Coach your picks', cards: 'Trading cards that level up' };
|
|
|
|
function copy() {
|
|
const p = C.position;
|
|
const seat = '$' + p.usd + ' one-time position gives you ' + p.picksOnBuy + ' picks right away and a draft spot every week';
|
|
return {
|
|
lines: [
|
|
'Every Monday the coaches on 5xYourTeam draft people who joined the network without a sponsor. A ' + seat + '. {{LINK}}',
|
|
'Draft order is earned: help last week\'s picks get started and you pick first next Monday. {{LINK}}',
|
|
'Your picks show up as trading cards that level up as they do: Rookie, Starter, Pro, All-Star, Hall of Fame. {{LINK}}',
|
|
'You get the right to sponsor and help, never anyone\'s contact details. Coaching happens in site messages. {{LINK}}',
|
|
'One payment in POL with SafePal or any other crypto wallet, never a subscription, split on-chain in the same transaction. {{LINK}}'
|
|
],
|
|
headlines: ['Draft Your Team Every Monday', 'Coach Them Up, Pick First', 'Five Picks Today, More Every Week'],
|
|
email: {
|
|
subject: 'A weekly draft for people who need a sponsor',
|
|
body: [
|
|
'Hi,',
|
|
'',
|
|
'People join our network every day without a sponsor. On 5xYourTeam the coaches draft them, every Monday, in rounds.',
|
|
'',
|
|
'A ' + seat + '. The draft order is earned: the coaches who helped the most of last week\'s picks get started pick first.',
|
|
'',
|
|
'Each pick shows a scouting card (last seen, the door they came in through, wallet linked, games played where that is tracked) and you coach them through site messages. Nobody\'s email is ever shown or sold.',
|
|
'',
|
|
'It is paid once in POL with SafePal or any other crypto wallet, never a subscription, and split on-chain in the same transaction.',
|
|
'',
|
|
'A position buys a seat in the draft and coaching tools, not income. Nothing is promised.',
|
|
'',
|
|
'Here is my page:',
|
|
'{{LINK}}'
|
|
].join('\n')
|
|
},
|
|
posts: [
|
|
'I coach a team on 5xYourTeam. Every Monday we draft people who joined the network without a sponsor, and draft order is earned by helping your picks get started.\n\n{{LINK}}',
|
|
'My picks are trading cards that level up as they get going. Rookie today, Pro when payouts go on. A ' + seat + '.\n\n{{LINK}}'
|
|
]
|
|
};
|
|
}
|
|
const NOTE = 'A position buys a seat in the draft and coaching tools, not income. Nothing is promised.';
|
|
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 => /^fx-[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 = 'fx-' + 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 link = ref && !/^0x/i.test(ref) ? base() + '/' + encodeURIComponent(ref) : base() + '/' + (ref ? '?ref=' + encodeURIComponent(ref) : '');
|
|
const q = ref ? '?ref=' + encodeURIComponent(ref) : '';
|
|
const fill = s => s.split('{{LINK}}').join(link);
|
|
const track = seg => netsites.tracked(C.siteId, C.siteId, { s1: ref, s2: seg });
|
|
const t = copy();
|
|
return {
|
|
v: 1, site: C.site, name: C.siteName, updated: '2026-11-15', username: ref || null,
|
|
tagline: 'The weekly draft for people who need a sponsor.',
|
|
links: [
|
|
{ key: 'page', label: 'Your coach page', url: link, tracked: track('') },
|
|
{ key: 'join', label: 'Get a position', url: base() + '/join' + q, tracked: track('join') },
|
|
{ key: 'ledger', label: 'Live ledger', url: base() + '/ledger' + q, tracked: track('ledger') }
|
|
],
|
|
linkTemplate: base() + '/{username}', trackedTemplate: netsites.tracked(C.siteId, C.siteId) + '&s1={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="5xYourTeam"></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'
|
|
};
|
|
}
|
|
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, SHAPES, ANGLES, copy, NOTE };
|