diff --git a/public/assets/games-page.js b/public/assets/games-page.js new file mode 100644 index 0000000..6dcd96a --- /dev/null +++ b/public/assets/games-page.js @@ -0,0 +1,26 @@ +// Public games page (2026-10-10): every game in the network, live ones first, then the ones with an opening date. +// Data: /api/public/games/all. Play links go to each game's own site (the game signs the visitor in with InstantAdPay). +// A ?ref= on this page is kept by the site's viral-link handling and carried onto the Join button. +(function () { + var esc = function (s) { return String(s == null ? '' : s).replace(/[&<>"']/g, function (c) { return ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c]; }); }; + var ref = ''; try { ref = new URLSearchParams(location.search).get('ref') || ''; } catch (e) {} + if (ref) { var j = document.getElementById('gJoin'); if (j) j.href = '/join?ref=' + encodeURIComponent(ref); } + function card(g) { + var soon = !g.live && g.opens; + var ribbon = g.season ? 'Limited time · ends ' + esc(g.season.ends) + '' : soon ? '' + esc(g.opens) + '' : ''; + var play = g.live && g.open ? 'Play' : '' + esc(g.opens || 'Opens soon') + ''; + var site = g.host ? '' + esc(g.host) + '' : ''; + return '
' + (g.art ? '' : '') + ribbon + '
' + + '
' + esc(g.tag || '') + '

' + esc(g.name) + '

' + esc(g.blurb || '') + '

' + + (g.pays ? '
Pays: ' + esc(g.pays) + '
' : '') + + '
' + play + site + '
'; + } + fetch('/api/public/games/all').then(function (r) { return r.json(); }).then(function (d) { + var games = (d && d.games) || []; + var live = games.filter(function (g) { return g.live; }), soon = games.filter(function (g) { return !g.live; }); + var L = document.getElementById('gLive'), S = document.getElementById('gSoon'); + if (!games.length) { document.getElementById('gEmpty').hidden = false; return; } + if (live.length) L.innerHTML = '

Open now · ' + live.length + ' game' + (live.length === 1 ? '' : 's') + '

' + live.map(card).join('') + '
'; + if (soon.length) S.innerHTML = '

Opening next

' + soon.map(card).join('') + '
'; + }).catch(function () { document.getElementById('gEmpty').hidden = false; }); +})(); diff --git a/public/games.html b/public/games.html new file mode 100644 index 0000000..d7adf7b --- /dev/null +++ b/public/games.html @@ -0,0 +1,77 @@ + + + + +Games that pay POL | InstantAdPay + + + + + + + + + + + + + + + +
+
+

InstantAdPay games

+

Play free. Get paid in POL.

+

Every game in the network, on one page. Each one signs you in with your InstantAdPay account in one tap and pays POL to the wallet on that account for the things you do inside it: first clears, levels, chapters, finds, daily puzzles.

+
+ +
How it worksCreate a free InstantAdPay account, link a Polygon wallet on your Wallet tab (one free signature), then open any game below. Rewards are small per action and paid automatically when your balance in that game reaches its payout amount. Every payout carries a transaction link.
+ +
+
+ + +
+

Not a member yet?

Join free, add a wallet, and every game on this page pays the same wallet. InstantAdPay itself is an advertising network: members run ads and get paid when the people they bring in buy packages.

+ Join free +
+ +

No income is guaranteed. Results depend on your effort. Cryptocurrency involves risk of loss. InstantAdPay sells advertising; it is not an investment. Game rewards are a marketing cost paid from a funded pool while it lasts.

+ +
+ + + diff --git a/server.js b/server.js index 433cadb..57d3439 100644 --- a/server.js +++ b/server.js @@ -59,7 +59,7 @@ const pdsync = require('./pdsync'); // PassiveDrip PTC bridge: our visit campaig const snapshot = require('./snapshot'); // daily growth snapshot -> Telegram payments feed (Marty, 2026-09-15) const pipeline = require('./pipeline'); // sponsor follow-up board (coming soon until site setting pipelineMode = on) (Marty, 2026-09-15) const videomaker = require('./videomaker'); // Circuit tool: promo videos with the member's own end card (ffmpeg in the image) // badge-gated promo toolkit + AI Copy Engine (Surge and up) (Marty, 2026-09-14) // referral contest: /leaderboard, Overview card, weekly + monthly winners (Marty, 2026-09-14) // release notes + roadmap: /whats-new, Overview card, Admin > Releases (Marty, 2026-09-14) // blog -> Blotato -> X + Instagram on publish (Marty, 2026-09-13) // admin member card: search, drilldown, edits (Marty, 2026-09-13) // admin-written coaching articles, server-rendered public /blog with SEO metadata (Marty, 2026-09-12) -const TRAFFIC_PAGES = new Set(['/', '/ledger', '/contract', '/shorts', '/plays', '/wallets', '/launch', '/partners', '/earning', '/blog', '/whats-new', '/leaderboard', '/friday', '/wednesday']); +const TRAFFIC_PAGES = new Set(['/', '/ledger', '/contract', '/shorts', '/plays', '/wallets', '/launch', '/partners', '/earning', '/games', '/blog', '/whats-new', '/leaderboard', '/friday', '/wednesday']); let tankWaitCache = null; // dashboard: who is waiting for a sponsor (refreshed every minute) const geo = require('./geo'); // viewer country -> tier (DB-IP lite), for campaign targeting const burner = require('./burner'); // automatic on-chain credit burns (inert without ENGINE_KEY) @@ -3424,6 +3424,21 @@ const server = http.createServer(async (req, res) => { return json(res, 200, Object.assign({ ok: true, posted, host, credits, ret: t.doneRet }, house, gold)); } // -- cross-promo strip (2026-10-03): the list every game reads, and the counted hop between games + // -- the public games page (2026-10-10, Marty: a page to send people): every game, open ones first, dated ones after + if (p === '/api/public/games/all' && req.method === 'GET') { + const sc = siteConfig(); const live = new Set(String(sc.gamesLive == null ? 'polhunter' : sc.gamesLive).split(',').map(x => x.trim().toLowerCase()).filter(Boolean)); + const day = todayCT(), S = STRIP(); const lbl = (d, back) => { const t = new Date(d + 'T12:00:00Z'); if (back) t.setUTCDate(t.getUTCDate() - 1); return t.toLocaleDateString('en-US', { month: 'short', day: 'numeric', timeZone: 'UTC' }); }; + const out = []; + for (const g of GAMES()) { + if (g.season && day >= g.season.end) continue; // a finished season is gone + const soon = !!(g.soon && day < g.soon.opens), preSeason = !!(g.season && day < g.season.start); + const isLive = !soon && !preSeason && live.has(g.slug); + if (!isLive && !soon && !preSeason) continue; // not live and no date: not announced yet + out.push({ slug: g.slug, name: g.name, tag: g.tag, blurb: g.blurb, pays: g.pays, art: /^https?:/.test(g.art) ? g.art : 'https://instantadpay.com' + g.art, artPos: g.artPos || 'center', live: isLive, + opens: soon ? g.soon.label : preSeason ? 'Opens ' + lbl(g.season.start) : null, season: g.season && isLive ? { ends: lbl(g.season.end, true) } : null, open: S[g.slug] ? S[g.slug].open : null, host: S[g.slug] ? S[g.slug].host : null }); + } + return json(res, 200, { games: out }, { 'Access-Control-Allow-Origin': '*', 'Cache-Control': 'public, max-age=300' }); + } if (p === '/api/public/games' && req.method === 'GET') return json(res, 200, { games: stripGames() }, { 'Access-Control-Allow-Origin': '*', 'Cache-Control': 'public, max-age=300' }); { const mg = /^\/g\/([a-z]{3,20})$/.exec(p); if (mg && req.method === 'GET') { const g = GAMES().find(x => x.slug === mg[1]); const S = STRIP()[mg[1]]; @@ -4594,7 +4609,8 @@ const server = http.createServer(async (req, res) => { if (p === '/shorts') return sendFile(res, path.join(PUBLIC_DIR, 'shorts.html')); if (p === '/plays') return sendFile(res, path.join(PUBLIC_DIR, 'plays.html')); if (p === '/partners') return sendFile(res, path.join(PUBLIC_DIR, 'partners.html')); // site-owner kit (Marty, 2026-09-12) - if (p === '/earning') return sendFile(res, path.join(PUBLIC_DIR, 'earning.html')); // member guide: how earning works (2026-09-12) + if (p === '/earning') return sendFile(res, path.join(PUBLIC_DIR, 'earning.html')); + if (p === '/games') return sendFile(res, path.join(PUBLIC_DIR, 'games.html')); // public games list (2026-10-10) // member guide: how earning works (2026-09-12) // -- badge share page + image: /b// (OG preview = the member's composed badge) (Marty, 2026-09-13) m = /^\/badge-img\/([a-z0-9_]{3,20})\/(payouts|firstBuyer|level2|level3)\.jpg$/.exec(p); if (m) return sendFile(res, path.join(UPLOADS_DIR, 'badge-' + m[1] + '-' + m[2] + '.jpg'));