Tell members when the free game allowance is used up (Marty 2026-11-03): the polgrant answer carries waiting (every game's progress POL held for the account), the member view carries caps.lifetime.done/waiting, lastCapHit records lifetime. The Overview card says "You have used your free 2 POL in the games", what the Pass gives and the POL held, with a Get the Game Pass button, and shows to anyone whose allowance is used (not only after a recent cap hit). Chatbot knows both messages. Short banner links fall back to this page's origin (http locally) when no share domain is set; my.js and promo.js ?v=20261103gp. QA member 0 bugs; gamepass the 7 known date-pinned failures, nothing new

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-03 13:15:29 -06:00
parent 0865a4967b
commit fb2383ffae
5 changed files with 27 additions and 9 deletions
+14 -1
View File
@@ -2160,9 +2160,22 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
const card = $('gpNudge'); if (!card) return;
if (cardHidden('gpnudge')) { card.hidden = true; return; }
let gp = null; try { gp = await (await fetch('/api/my/gamepass')).json(); } catch (e) {}
if (!gp || !gp.enabled || gp.active || !gp.lastCapHit || gp.lastCapHit.pass) { card.hidden = true; return; }
const allowanceDone = !!(gp && gp.caps && gp.caps.lifetime && gp.caps.lifetime.done && gp.caps.enforced);
if (!gp || !gp.enabled || gp.active || (!allowanceDone && (!gp.lastCapHit || gp.lastCapHit.pass))) { card.hidden = true; return; }
const NAMES = { polhunter: 'PolHunter', gemkingdom: 'Gem Kingdom', spellwheel: 'SpellWheel', spookydoors: 'Spooky Doors', polywarriors: 'PolyWarriors', clutterhunt: 'ClutterHunt', polybreak: 'PolyBreak', polminer: 'POL Miner', warpwares: 'Warp & Wares', turkeydrop: 'Turkey Drop', driprunner: 'Drip Runner', roadagent: 'Road Agent' };
card.hidden = false;
const lt = gp.caps && gp.caps.lifetime;
if (lt && lt.done) { // the free allowance is used up (Marty 2026-11-03): only the Pass pays from here, and what it unlocks
const fmt = n => String(Math.round(n * 100) / 100);
card.innerHTML = '<div class="card-head"><h3>\u{1F39F}\uFE0F You have used your free ' + fmt(lt.cap) + ' POL in the games</h3><span class="sub">the Game Pass keeps them paying</span></div>'
+ '<p>Every member gets ' + fmt(lt.cap) + ' POL of game rewards free, and yours is used. The games stay free to play, but from here rewards pay only with the <b>Game Pass</b>: ' + (gp.days || 7) + ' days for $' + (gp.usd || 5) + ', paid with a new package, with full rewards in every game, the weekly Pass Tournament and a perk in each game.'
+ (lt.waiting > 0 ? ' <b>' + fmt(lt.waiting) + ' POL</b> you have earned since is saved and pays out once your Pass is active.' : '') + '</p>'
+ '<button class="btn" type="button" id="gpNudgeGo">Get the Game Pass</button>';
$('gpNudgeGo').addEventListener('click', () => setPane('games?pass=1'));
try { localStorage.setItem('iap-hide-gpnudge', String(Date.now())); } catch (e) {}
cardDismiss(card, 'gpnudge');
return;
}
card.innerHTML = '<div class="card-head"><h3>\u{1F39F}\uFE0F You reached today\u2019s free cap in ' + esc(NAMES[gp.lastCapHit.game] || 'the games') + '</h3><span class="sub">free play keeps paying; the Pass plays more</span></div>'
+ '<p>Every member earns real POL in the games up to the daily cap. The <b>Game Pass</b> raises the caps across all the games for ' + (gp.days || 7) + ' days ($' + (gp.usd || 5) + ', paid with a new package), adds the weekly Pass Tournament and a perk in every game.</p>'
+ '<button class="btn" type="button" id="gpNudgeGo">See the Game Pass</button>';
+2 -2
View File
@@ -289,7 +289,7 @@ window.IAPPromo = (function () {
const enc = encodeURIComponent;
// short image host (2026-11-03, Michael Camire via Marty): /b/<slug>/<file> on the share domain serves the game-banners CDN files in
// place; the ~105-character CDN URLs were cut off by exchange and safelist image fields. 728x90.png expands to <slug>-728x90.png.
const CDN = 'https://' + ((typeof SHARE_DOMAIN === 'string' && SHARE_DOMAIN) || location.host) + '/b/';
const CDN = ((typeof SHARE_DOMAIN === 'string' && SHARE_DOMAIN) ? 'https://' + SHARE_DOMAIN : location.origin) + '/b/';
const preLaunch = (y, m, d) => Date.now() < Date.UTC(y, m - 1, d, 5); // before midnight Central on that day
const GAMES = [
// the public games page (2026-10-10, Marty: "make sure that's in the promo tools for everyone"): every game on one page, with the member's referral on the Join button
@@ -458,7 +458,7 @@ window.IAPPromo = (function () {
{ name: 'Partner angle', net: 'LinkedIn', text: 'BixPay pays partners on every card and on card spending, ten levels deep. If you\'re building a team anyway, this fits right in: {L}' }
];
const BIX_SWIPE = { subject: 'A Visa card for the crypto you already earn', body: 'Hey,\n\nQuick one, because this solved something for me.\n\nI earn crypto in a few places, and for a long time the awkward part was spending it. Exchange, bank, waiting, fees. BixPay took that out of the loop: it is a self-custody wallet with a Visa card in one app. You send USDT or USDC to it on Polygon, load the card, and pay wherever Visa is accepted, Apple Pay and Google Pay included.\n\nThe parts I liked:\n- The keys stay with you. It is your wallet, not an account someone else holds.\n- No load fee. 3% per purchase, and BIX\'s terms cover the rest.\n- A virtual card is $9.99 and you can be using it the same day.\n- If you build a team, BixPay pays partners on every card and on card spending, ten levels deep.\n\nUS note: it is open in 31 states so far. If yours is not on the list yet, you can still get the wallet and build.\n\nHere is my link: {L}\n\nBixPay is a separate company. BIX issues the wallet and the card through its banking partners and sets its own fees, limits, eligibility and terms. Crypto assets can lose value.\n\nTalk soon,' };
const BIX_CDN = 'https://' + ((typeof SHARE_DOMAIN === 'string' && SHARE_DOMAIN) || location.host) + '/b/bixpay/'; // short image host, same files as the game-banners CDN (2026-11-03)
const BIX_CDN = ((typeof SHARE_DOMAIN === 'string' && SHARE_DOMAIN) ? 'https://' + SHARE_DOMAIN : location.origin) + '/b/bixpay/'; // short image host, same files as the game-banners CDN (2026-11-03)
const BIX_SIZES = [['728x90', 'Leaderboard'], ['300x250', 'Medium rectangle'], ['468x60', 'Banner'], ['600x300', 'Traffic exchange / splash page']];
function fillBix(me) {
const b = (me && me.bix) || {}; const sec = $('promo-bixpay'); if (!sec) return;
+2 -2
View File
@@ -1261,9 +1261,9 @@
</div>
<script src="/assets/common.js?v=20261101th"></script><script src="/assets/welcome.js?v=20261101th"></script>
<script src="/assets/wallet.js?v=20260911a"></script>
<script src="/assets/promo.js?v=20261103b"></script>
<script src="/assets/promo.js?v=20261103gp"></script>
<script src="/assets/support.js?v=20261101th"></script>
<script src="/assets/my.js?v=20261102tt"></script>
<script src="/assets/my.js?v=20261103gp"></script>
<script src="/assets/fuel.js?v=20261025ff"></script>
<script src="/assets/engine-room.js?v=20261101th"></script>
<script src="/assets/chat.js?v=20261016n"></script>