feat: promotion

This commit is contained in:
2026-04-24 11:45:42 +07:00
parent df04cb1d09
commit 15077adf47
15 changed files with 2939 additions and 153 deletions
+14
View File
@@ -123,6 +123,7 @@ function applyCards(pageHtml, cards) {
const scale = cardData.asteroidScale;
const ship = cardData.ship;
const innerAst = cardData.innerAst;
const badge = cardData.badge;
// Apply asteroidScale to .space-asteroid img
if (scale != null && scale !== 1) {
@@ -161,6 +162,19 @@ function applyCards(pageHtml, cards) {
);
}
// Apply badge position
if (badge) {
const badgeLeft = badge.left != null ? badge.left : 40;
const badgeTop = badge.top != null ? badge.top : 39;
const badgeStyle = 'left: ' + badgeLeft + '%; top: ' + badgeTop + '%';
cardHtml = cardHtml.replace(
/(<div class="badge-10")([\s>])/,
function(full, tag, after) {
return tag + ' style="' + badgeStyle + '"' + after;
}
);
}
// Apply innerAst position (and compose with asteroidScale if present)
if (innerAst || (scale != null && scale !== 1)) {
const innerLeft = innerAst && innerAst.left != null ? innerAst.left : 58;