feat: promotion
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user