Games page: a strip of featured warriors from the PolyWarriors market (rarest listings, forged art, links into the market)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-10-10 18:07:32 -05:00
parent 84d54eda16
commit ef6c6b584e
2 changed files with 14 additions and 1 deletions
+7
View File
@@ -23,4 +23,11 @@
if (live.length) L.innerHTML = '<h2 class="gsec">Open now · ' + live.length + ' game' + (live.length === 1 ? '' : 's') + '</h2><div class="ggrid">' + live.map(card).join('') + '</div>';
if (soon.length) S.innerHTML = '<h2 class="gsec">Opening next</h2><div class="ggrid">' + soon.map(card).join('') + '</div>';
}).catch(function () { document.getElementById('gEmpty').hidden = false; });
// featured warriors from the PolyWarriors market (2026-10-10): the rarest listings, with the forged art
fetch('https://www.polywarriors.com/api/public/featured').then(function (r) { return r.json(); }).then(function (d) {
var f = (d && d.featured) || []; if (!f.length) return; var S = document.getElementById('gSoon'); var host = document.createElement('div'); host.id = 'gFeatured';
host.innerHTML = '<h2 class="gsec">From the PolyWarriors market <small style="letter-spacing:0;text-transform:none;font-size:11px"> <a href="' + esc(d.market) + '" target="_blank" rel="noopener">open the market</a></small></h2><div class="fgrid">' + f.map(function (x) {
return '<a class="fcard" href="' + esc(x.url) + '" target="_blank" rel="noopener" style="--rc:' + esc(x.color) + '"><div class="fpic"><img src="' + esc(x.image) + '" alt="" loading="lazy"><span class="ftag">' + esc(x.rarity) + '</span>' + (x.forSale ? '<span class="fsale">For sale</span>' : '') + '</div><div class="fb"><b>' + esc(x.name) + ' #' + String(x.serial).padStart(4, '0') + '</b>' + (x.forge ? '<small>Forged ' + esc(x.forge.grade) + ' ' + esc(x.forge.score) + '</small>' : '') + (x.forSale ? '<span class="fp">' + esc(x.price) + ' POL</span>' : '') + '</div></a>'; }).join('') + '</div>';
S.parentNode.insertBefore(host, S.nextSibling);
}).catch(function () {});
})();