diff --git a/netsites.js b/netsites.js new file mode 100644 index 0000000..2536f92 --- /dev/null +++ b/netsites.js @@ -0,0 +1,40 @@ +// The network sites list for the footer's "Part of the network" line (Marty 2026-11-14 trust pack). +// One source: the hub's public GET /v1/network-sites (HUB_URL). Cached 10 minutes, refreshed in the background, never waits on a +// slow hub (2.5 s timeout), and falls back to the same built-in list. Never RM Circle, never the games. +// The same file lives in every network site (InstantAdPay, LinkSpin, Downline Banners, VBB, Stack POL). +const FALLBACK = [ + { id: 'iap', name: 'InstantAdPay', url: 'https://instantadpay.com' }, + { id: 'linkspin', name: 'LinkSpin', url: 'https://linkspin.app' }, + { id: 'dlb', name: 'Downline Banners', url: 'https://downlinebanners.com' }, + { id: 'vbb', name: 'Viral Banner Blitz', url: 'https://viralbannerblitz.com' }, + { id: 'stackpol', name: 'Stack POL', url: 'https://stackpol.com' }, + { id: 'earnerscorner', name: 'Earners Corner', url: 'https://earnerscorner.com' } +]; +const TTL = 10 * 60 * 1000; +let cache = { at: 0, list: FALLBACK, from: 'fallback' }; +let inflight = null; + +const hubUrl = () => String(process.env.HUB_URL || 'https://hub.saasy.top').trim().replace(/\/+$/, ''); +function clean(list) { + if (!Array.isArray(list)) return null; + const ok = list.filter(s => s && typeof s.name === 'string' && /^https:\/\/[a-z0-9.-]+(\/[^\s"'<>]*)?$/i.test(String(s.url || ''))) + .slice(0, 30).map(s => ({ id: String(s.id || s.name).toLowerCase().replace(/[^a-z0-9]+/g, '').slice(0, 30), name: String(s.name).slice(0, 60), url: String(s.url).replace(/\/+$/, '') })); + return ok.length ? ok : null; +} +function refresh() { + if (inflight || process.env.NETWORK_SITES_HUB === '0') return inflight; + const ac = new AbortController(); const t = setTimeout(() => ac.abort(), 2500); + inflight = fetch(hubUrl() + '/v1/network-sites', { signal: ac.signal }) + .then(r => (r.ok ? r.json() : null)) + .then(j => { const l = clean(j); if (l) cache = { at: Date.now(), list: l, from: 'hub' }; else cache.at = Date.now(); }) + .catch(() => { cache.at = Date.now() - TTL + 60 * 1000; }) // hub down: try again in a minute, keep the last good list + .finally(() => { clearTimeout(t); inflight = null; }); + return inflight; +} +function list() { if (Date.now() - cache.at > TTL) refresh(); return cache.list; } +// GET /api/network-sites: public, cacheable, the same answer on every page +function handle(req, res) { + res.writeHead(200, { 'Content-Type': 'application/json; charset=utf-8', 'Cache-Control': 'public, max-age=300', 'X-Content-Type-Options': 'nosniff' }); + res.end(JSON.stringify(list())); +} +module.exports = { list, handle, refresh, FALLBACK, _state: () => cache }; diff --git a/public/assets/common.js b/public/assets/common.js index 7f912b2..71ee3a2 100644 --- a/public/assets/common.js +++ b/public/assets/common.js @@ -37,10 +37,24 @@ 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 · Promote · My Spots
How it works · Board · Live ledger · Contract proof · Promote · My Spots
' + // trust pack (Marty 2026-11-14): legal + proof links, company line, and the network line served by the hub + + 'Terms · Earnings Disclaimer · Privacy · Contract · Ledger · Support
' + + 'TrustClickz · 615 Green Valley Drive, Moody, AL 35004
'; document.body.appendChild(f); + netLine(f.querySelector('.netline')); toasts(); } + // "Part of the network": the list comes from the hub through /api/network-sites, the built-in copy if it does not answer + const NET = [['iap', 'InstantAdPay', 'https://instantadpay.com'], ['linkspin', 'LinkSpin', 'https://linkspin.app'], ['dlb', 'Downline Banners', 'https://downlinebanners.com'], + ['vbb', 'Viral Banner Blitz', 'https://viralbannerblitz.com'], ['stackpol', 'Stack POL', 'https://stackpol.com'], ['earnerscorner', 'Earners Corner', 'https://earnerscorner.com']].map(a => ({ id: a[0], name: a[1], url: a[2] })); + function netLine(el) { + if (!el) return; + const paint = list => { el.innerHTML = 'Part of the network · One account across the network: ' + list.map(s => (s.id === 'dlb' || /downlinebanners\.com/.test(s.url)) + ? '' + esc(s.name) + '' : '' + esc(s.name) + '').join(' · '); }; + paint(NET); + fetch('/api/network-sites').then(r => r.json()).then(l => { if (Array.isArray(l) && l.length) paint(l); }).catch(() => {}); + } // one spot tile; href goes through the /go relay, which counts the click function tile(t, opts) { const a = document.createElement('a'); diff --git a/public/assets/legal.js b/public/assets/legal.js new file mode 100644 index 0000000..8819b02 --- /dev/null +++ b/public/assets/legal.js @@ -0,0 +1,2 @@ +// Terms, Earnings Disclaimer, Privacy (trust pack 2026-11-14): nav + footer only. +(async function () { await BL.renderNav(location.pathname); BL.renderFooter(); })(); diff --git a/public/assets/line.css b/public/assets/line.css index 7f68f7a..a3ceb5e 100644 --- a/public/assets/line.css +++ b/public/assets/line.css @@ -63,3 +63,8 @@ nav .links a.active{color:var(--mint-ink);background:var(--mint)} .bl-zone{display:flex;flex-direction:column;align-items:center;gap:3px;margin:16px auto;max-width:100%;overflow:hidden} .bl-zone-label{font-size:10.5px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);opacity:.7} .bl-zone-foot{margin-top:28px} +/* trust pack (2026-11-14): footer legal links, network line, legal pages */ +.bl-foot .legal-links{margin-top:12px} +.bl-foot .netline{margin-top:12px;padding-top:12px;border-top:1px solid var(--line);line-height:1.9} +.bl-foot .netline .here{color:var(--mint-ink);background:var(--mint);font-weight:700;border-radius:999px;padding:1px 9px} +.legal .card h2{font-size:21px} .legal .card p,.legal .card li{max-width:760px;color:var(--ink)} .legal .card ul{padding-left:20px} .legal .card li{margin:6px 0} diff --git a/public/board.html b/public/board.html index 20c6351..c676fb6 100644 --- a/public/board.html +++ b/public/board.html @@ -21,7 +21,7 @@ - +