diff options
-rw-r--r-- | cards.css | 11 | ||||
-rw-r--r-- | play.html | 13 | ||||
-rw-r--r-- | play.js | 15 | ||||
-rw-r--r-- | tools/gendata.js | 8 |
4 files changed, 31 insertions, 16 deletions
@@ -26,12 +26,20 @@ border-top: 1px solid black; border-bottom: 1px solid black; margin: 10px 0 12px 0; - padding: 5px 30px 5px 0; + padding: 5px 20px 5px 0; text-align: center; font-size: 16px; line-height: 16px; } +.flip .name { + padding: 5px 0 5px 20px; +} + +.name.with_symbol { + padding: 5px 0; +} + .name.red { background-color: #e32223; color: white; } .name.pink { background-color: #f49899; color: black; } .name.blue { background-color: #2482e4; color: white; } @@ -66,6 +74,7 @@ width: 45px; height: 63px; background-size: contain; + z-index: 1; filter: drop-shadow( 0 0 2px linen ); } @@ -172,10 +172,6 @@ main { flex-direction: row-reverse; } -.flip .card, .flip .card > div { - transform: rotate(180deg); -} - .card { box-shadow: 1px 2px 8px #0008; } @@ -184,9 +180,12 @@ main { box-shadow: -1px -2px 8px #0008; } -.flip .card .strength { - left: 6px; - right: unset; +.flip .card, .flip .card > div { + transform: rotate(180deg); +} + +.flip .card > div.link { + transform: none; } .table_separator { @@ -139,7 +139,15 @@ function create_formation_card(id) { register_action(e, "card", id) - append_div(e, "name " + wing_name[card.wing], card.name) + if (card.infantry || card.cavalry) + append_div(e, "name with_symbol " + wing_name[card.wing], card.name) + else + append_div(e, "name " + wing_name[card.wing], card.name) + + if (card.infantry) + append_div(e, "symbol infantry") + if (card.cavalry) + append_div(e, "symbol cavalry") if (card.special === 1) append_div(e, "strength", "I") @@ -150,11 +158,6 @@ function create_formation_card(id) { else append_div(e, "strength", card.strength) - if (card.infantry) - append_div(e, "symbol infantry") - if (card.cavalry) - append_div(e, "symbol cavalry") - if (card.link) { if (set_has(card.link, id - 1)) append_div(e, "link left") diff --git a/tools/gendata.js b/tools/gendata.js index 07f58c0..98e4f20 100644 --- a/tools/gendata.js +++ b/tools/gendata.js @@ -73,7 +73,10 @@ for (let c of card_records) { card.actions = [] result.push(`<div class="formation card">`) - result.push(`<div class="name ${c.wing}">${c.name}</div>`) + if (c.symbol) + result.push(`<div class="name with_symbol ${c.wing}">${c.name}</div>`) + else + result.push(`<div class="name ${c.wing}">${c.name}</div>`) if (c.symbol === "inf") { card.infantry = 1 @@ -352,7 +355,8 @@ for (let s of scenario_records) { { name: s.player1, cards: parse_cards(s.cards1), morale: parseInt(s.morale1), tactical: parseInt(s.tactical1) }, { name: s.player2, cards: parse_cards(s.cards2), morale: parseInt(s.morale2), tactical: parseInt(s.tactical2) }, ], - rule: s.rule || undefined + rule: s.rule || undefined, + rule_text: s.rule_text || undefined, }) result.push(` <div id="scenario_${s.number}" class="scenario card"> |