Spooky Doors (Halloween season game): hand-off, door visits, costume shop, seasonal Games card

- SD_SSO_SECRET / SD_URL (default https://spookydoors.com); sdMint/sdOpen same token shape as Drip Runner
- GET /api/my/spookydoors sign-in hand-off (?ref pass-through; iap.return spookydoors + sdshop whitelisted)
- /door page (Halloween copy of /refuel, door art backdrop) + /api/door/open|challenge|done as visit kind 'door';
  signed callback to SD_URL/api/door/callback (X-SD-Ts/X-SD-Sig) + 24 h door-receipt on ret&ok=1&r=;
  ret&none=1 when nothing to serve, ret&cap=1 at the daily cap; host = campaign owner's username
- /sd/shop (+ topup/resume/confirm) costume checkout via ads.gamePurchase('Spooky Doors: <label>'), sd-receipt
- Games tab: generic season window (Central days, admin preview before start, hidden after end) + pink
  limited-time ribbon; progress from SD_URL/api/partner/player (signed); my.js ?v bumped
- Chatbot canned answer + prompt facts; qa/door.mjs (bash qa/run.sh door) end-to-end on a throwaway local copy

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-10-02 09:40:08 -05:00
parent b6850d4342
commit 27c9d51fde
9 changed files with 534 additions and 7 deletions
+5 -1
View File
@@ -825,6 +825,9 @@
if (me.returnTo === 'driprunner' && !render.toGame) { render.toGame = true; location.href = '/api/my/driprunner'; return; }
if (me.returnTo === 'gemkingdom' && !render.toGame) { render.toGame = true; location.href = '/api/my/gemkingdom'; return; } // Gem Kingdom sent them here to sign in (2026-10-01)
if (me.returnTo === 'gkshop' && !render.toGame) { render.toGame = true; location.href = '/gk/shop/resume'; return; }
if (me.returnTo === 'spookydoors' && !render.toGame) { render.toGame = true; location.href = '/api/my/spookydoors'; return; } // Spooky Doors sent them here to sign in (2026-10-02)
if (me.returnTo === 'sdshop' && !render.toGame) { render.toGame = true; location.href = '/sd/shop/resume'; return; }
if (me.sdShop && !document.getElementById('sdBack')) { const d = document.createElement('a'); d.id = 'sdBack'; d.href = '/sd/shop/resume'; d.textContent = 'Finish your Spooky Doors costume order \u2192'; d.setAttribute('style', 'position:fixed;left:12px;right:12px;bottom:' + (me.gkShop ? '74px' : '14px') + ';z-index:9999;display:block;padding:14px 16px;border-radius:14px;background:#FF8A1F;color:#2a1200;font-weight:800;text-align:center;text-decoration:none;box-shadow:0 5px 0 #C25A06,0 10px 30px rgba(0,0,0,.45)'); document.body.appendChild(d); }
if (me.gkShop && !document.getElementById('gkBack')) { const d = document.createElement('a'); d.id = 'gkBack'; d.href = '/gk/shop/resume'; d.textContent = 'Finish your Gem Kingdom Crowns order \u2192'; d.setAttribute('style', 'position:fixed;left:12px;right:12px;bottom:14px;z-index:9999;display:block;padding:14px 16px;border-radius:14px;background:linear-gradient(180deg,#E8455A,#A8172B);color:#fff;font-weight:800;text-align:center;text-decoration:none;box-shadow:0 10px 30px rgba(0,0,0,.45)'); document.body.appendChild(d); }
if (me.returnTo === 'passivedrip' && !render.toGame) { render.toGame = true; location.href = '/api/my/passivedrip'; return; } // PassiveDrip sent them here to sign in (2026-10-01)
// arrived from an invite page: run the welcome tour and login ad once
@@ -1654,7 +1657,8 @@
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"' + (x.artPos ? ' style="object-position:' + esc(x.artPos) + ' center"' : '') + '><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) + '">' + esc(x.cta || 'Play') + '</a></div></div>').join('');
// a seasonal card (x.season, 2026-10-02) wears the pink limited-time ribbon from the Spooky Doors UI kit
el.innerHTML = list.map(x => '<div class="game-card"><img src="' + esc(x.art) + '" alt="" loading="lazy"' + (x.artPos ? ' style="object-position:' + esc(x.artPos) + ' center"' : '') + '>' + (x.season && x.season.ends ? '<span class="gc-ribbon"><i></i>Limited time \u00b7 ends ' + esc(x.season.ends) + '</span>' : '') + '<div class="gc-body"><span class="gc-tag">' + esc(x.tag || '') + '</span><h4>' + esc(x.name) + (x.preview ? '<span class="gc-pre">' + esc(x.previewNote || '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) + '">' + esc(x.cta || 'Play') + '</a></div></div>').join('');
}
async function loadReturnCard() {
const card = $('phReturn'); if (!card) return;