From 5a39b2599f34a0510bed6d4ae6e45a1075c705e3 Mon Sep 17 00:00:00 2001 From: martbost Date: Tue, 6 Oct 2026 07:52:17 -0500 Subject: [PATCH] Promo tools: Game banners section (7 games x 10 standard sizes on banners.adrotate.xyz, embed code linked to the member) Co-Authored-By: Claude Opus 5.5 --- public/assets/my.js | 2 +- public/assets/promo.js | 26 ++++++++++++++++++++++++++ public/my.html | 12 ++++++++++-- 3 files changed, 37 insertions(+), 3 deletions(-) diff --git a/public/assets/my.js b/public/assets/my.js index c4a9e39..6bc3f22 100644 --- a/public/assets/my.js +++ b/public/assets/my.js @@ -2189,7 +2189,7 @@ if ($('tkGo')) { $('tkGo').addEventListener('click', tkGenerate); $('tkAgain').addEventListener('click', tkGenerate); $('tkCopy').addEventListener('click', async () => { try { await navigator.clipboard.writeText($('tkText').value); IAP.status('Copied.', 'ok'); } catch (e) { $('tkText').select(); } }); $('tkSendBc').addEventListener('click', tkSendBroadcast); } // promo tools: pill menu switches between posts / swipes / banners / wall / videos function setPromoSub(name) { - const ids = ['toolkit', 'posts', 'text', 'swipe', 'banners', 'wall', 'objections', 'videos', 'viral', 'polhunter', 'spookydoors']; + const ids = ['toolkit', 'posts', 'text', 'swipe', 'banners', 'wall', 'objections', 'videos', 'viral', 'polhunter', 'gamebanners', 'spookydoors']; if (name === 'toolkit') loadToolkit(); const pill = document.querySelector('.promo-pills [data-promo="' + name + '"]'); if (!ids.includes(name) || !pill || pill.hidden) name = 'posts'; diff --git a/public/assets/promo.js b/public/assets/promo.js index 04c9e37..fe012d1 100644 --- a/public/assets/promo.js +++ b/public/assets/promo.js @@ -273,6 +273,32 @@ window.IAPPromo = (function () { const d = document.createElement('div'); d.className = 'promo-block'; d.innerHTML = '
' + s + ' ' + esc(n) + '
' + s + '
' + esc(code) + '
'; const row = document.createElement('div'); row.className = 'pb-actions'; row.appendChild(copyBtn(code, 'Copy embed code')); row.appendChild(linkBtn(src, 'Open image')); d.appendChild(row); bg.appendChild(d); } } + // Game banners (2026-10-06): every network game in 10 standard sizes, hosted on banners.adrotate.xyz, each embed linked to + // the member (PolHunter takes ?r=, the other games ?ref=). Seasonal games stay listed; their banners carry no dates. + const gbs = $('promo-gamebanners'); + if (gbs && token && gbs.dataset.filled !== token) { + gbs.dataset.filled = token; + const enc = encodeURIComponent, CDN = 'https://banners.adrotate.xyz/game-banners/'; + const GAMES = [ + { slug: 'polywarriors', name: 'PolyWarriors', link: 'https://www.polywarriors.com/?ref=' }, { slug: 'gemkingdom', name: 'Gem Kingdom', link: 'https://gemkingdom.app/?ref=' }, + { slug: 'driprunner', name: 'Drip Runner', link: 'https://driprunner.app/?ref=' }, { slug: 'clutterhunt', name: 'ClutterHunt', link: 'https://clutterhunt.com/?ref=' }, + { slug: 'spellwheel', name: 'SpellWheel', link: 'https://spellwheel.app/?ref=' }, { slug: 'spookydoors', name: 'Spooky Doors', link: 'https://spookydoors.com/?ref=' }, + { slug: 'polhunter', name: 'PolHunter', link: 'https://polhunter.com/?r=' }]; + const SIZES = [['728x90', 'Leaderboard'], ['468x60', 'Banner'], ['320x50', 'Mobile banner'], ['300x250', 'Medium rectangle'], ['336x280', 'Large rectangle'], ['250x250', 'Square'], ['125x125', 'Button'], ['160x600', 'Wide skyscraper'], ['120x600', 'Skyscraper'], ['300x600', 'Half page']]; + let cur = GAMES[0]; + const draw = () => { + const link = cur.link + enc(token); $('gbLink').textContent = link; + $('gbLinkCopy').onclick = async () => { try { await navigator.clipboard.writeText(link); status('Link copied.', 'ok'); } catch (e) { status('Copy failed.', 'bad'); } }; + $('gbGames').innerHTML = GAMES.map(g => '').join(''); + const grid = $('gbGrid'); grid.innerHTML = ''; + for (const [s, n] of SIZES) { const w = s.split('x')[0], h = s.split('x')[1], src = CDN + cur.slug + '/' + cur.slug + '-' + s + '.png'; + const code = '' + cur.name + ''; + const d = document.createElement('div'); d.className = 'promo-block'; d.innerHTML = '
' + s + ' ' + esc(n) + '
' + esc(cur.name) + ' ' + s + '
' + esc(code) + '
'; + const row = document.createElement('div'); row.className = 'pb-actions'; row.appendChild(copyBtn(code, 'Copy embed code')); row.appendChild(copyBtn(src, 'Copy image URL')); row.appendChild(linkBtn(src, 'Open image')); d.appendChild(row); grid.appendChild(d); } + }; + $('gbGames').addEventListener('click', e => { const b = e.target.closest('[data-gb]'); if (!b) return; cur = GAMES.find(g => g.slug === b.dataset.gb) || cur; draw(); }); + draw(); + } // Spooky Doors (Halloween season, 2026-10-02): the member's game link, the share image and two short posts. Shown on the // season window the Games card uses (the server decides; the admin gets a preview before the start), hidden after it. const sdp = $('promo-spookydoors'); diff --git a/public/my.html b/public/my.html index 177a368..21cf7a0 100644 --- a/public/my.html +++ b/public/my.html @@ -776,6 +776,7 @@ + + - - + +