Games hub: one Games menu entry and pane with a card per game (registry in server.js, live list = site config gamesLive, default polhunter; admin sees unlaunched games as previews), Drip Runner card with the player's own progress via a signed read; chatbot knows Games + Drip Runner (KNOWLEDGE_DATE 2026-10-01); QA walk covers the pane
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+12
-2
@@ -758,9 +758,9 @@
|
||||
}
|
||||
|
||||
// ── back-office menu: hash-routed panes ───────────────
|
||||
const PANES = ['overview', 'line', 'pipeline', 'buy', 'campaigns', 'earn', 'earnings', 'promo', 'training', 'wallet', 'profile'];
|
||||
const PANES = ['overview', 'line', 'pipeline', 'buy', 'campaigns', 'earn', 'earnings', 'promo', 'training', 'games', 'wallet', 'profile'];
|
||||
const TITLES = { overview: 'Overview', line: 'My line', pipeline: 'Pipeline', buy: 'Buy packages', campaigns: 'Campaigns',
|
||||
earn: 'Earn credits', earnings: 'Earnings', promo: 'Promo tools', training: 'Training',
|
||||
earn: 'Earn credits', earnings: 'Earnings', promo: 'Promo tools', training: 'Training', games: 'Games',
|
||||
wallet: 'Wallet & account', profile: 'Profile' };
|
||||
function setPane(name) {
|
||||
if (!PANES.includes(name)) name = 'overview';
|
||||
@@ -781,6 +781,7 @@
|
||||
if (name === 'campaigns') ['cTarget', 'cImage', 'cVideoUrl'].forEach(id => { if ($(id)) $(id).value = ''; }); // no residual URL between visits
|
||||
if (name === 'training') loadTraining();
|
||||
if (name === 'pipeline') loadPipeline();
|
||||
if (name === 'games') loadGames();
|
||||
document.getElementById('memberArea').classList.remove('side-open'); // close mobile drawer
|
||||
if (location.hash !== '#' + name) history.replaceState(null, '', '#' + name);
|
||||
}
|
||||
@@ -813,6 +814,7 @@
|
||||
if ($('mcFinish')) $('mcFinish').hidden = !walletOnly;
|
||||
if (!signedIn) return;
|
||||
if ($('adminLink')) $('adminLink').hidden = !me.isAdmin; // admin portal link, only for ADMIN_EMAIL
|
||||
if (!render.gamesChecked) { render.gamesChecked = true; fetch('/api/my/games').then(r => r.json()).then(g => { if ($('gamesNav')) $('gamesNav').hidden = !(g.games && g.games.length); }).catch(() => {}); } // Games appears once any game is live (admin sees previews)
|
||||
// REQUIRED first step (Marty, 2026-09-12): no username, nothing else. The modal cannot be
|
||||
// skipped or dismissed; it resolves only when a username is saved, then the area renders.
|
||||
if (!me.username) {
|
||||
@@ -1635,6 +1637,14 @@
|
||||
}
|
||||
launchReveal(); setInterval(launchReveal, 30000);
|
||||
// came from PolHunter (iap.return cookie): one card at the top of the Overview that sends them back
|
||||
// Games hub (2026-10-01): one card per game, the player's own progress where the game reports it
|
||||
async function loadGames() {
|
||||
const el = $('gamesGrid'); if (!el) return;
|
||||
let g = null; try { g = await (await fetch('/api/my/games')).json(); } catch (e) {}
|
||||
const list = (g && g.games) || [];
|
||||
if (!list.length) { el.innerHTML = '<p class="muted small">No games are open yet. Check back soon.</p>'; return; }
|
||||
el.innerHTML = list.map(x => '<div class="game-card"><img src="' + esc(x.art) + '" alt="" loading="lazy"><div class="gc-body"><span class="gc-tag">' + esc(x.tag || '') + '</span><h4>' + esc(x.name) + (x.preview ? '<span class="gc-pre">preview, not live</span>' : '') + '</h4><p class="muted small" style="margin:0">' + esc(x.blurb) + '</p>' + (x.progress && x.progress.line ? '<div class="gc-prog">' + esc(x.progress.line) + '</div>' : '') + '<p class="muted small" style="margin:0">Pays: ' + esc(x.pays || 'POL') + '</p><a class="btn" href="' + esc(x.play) + '">Play</a></div></div>').join('');
|
||||
}
|
||||
async function loadReturnCard() {
|
||||
const card = $('phReturn'); if (!card) return;
|
||||
if (cardHidden('phReturn')) { card.hidden = true; return; }
|
||||
|
||||
Reference in New Issue
Block a user