diff options
author | Frans Bongers <fransbongers@franss-mbp.home> | 2024-12-30 22:44:07 +0100 |
---|---|---|
committer | Frans Bongers <fransbongers@franss-mbp.home> | 2024-12-30 22:44:07 +0100 |
commit | 50d95d906d7d782d155e75635be4d637c1ccfb25 (patch) | |
tree | 779f45f3de545b9550539501910db3c35a71589e | |
parent | 4148cddd0370fa1ea9b9580a79ac1c73109c88a1 (diff) | |
download | land-and-freedom-50d95d906d7d782d155e75635be4d637c1ccfb25.tar.gz |
fix click fronts and remove console logs
-rw-r--r-- | land-and-freedom.css | 5 | ||||
-rw-r--r-- | land-and-freedom.scss | 6 | ||||
-rw-r--r-- | play.js | 4 | ||||
-rw-r--r-- | play.ts | 15 | ||||
-rw-r--r-- | rules.js | 5 | ||||
-rw-r--r-- | rules.ts | 6 |
6 files changed, 14 insertions, 27 deletions
diff --git a/land-and-freedom.css b/land-and-freedom.css index be49582..09c834b 100644 --- a/land-and-freedom.css +++ b/land-and-freedom.css @@ -176,12 +176,17 @@ main { gap: 2px; margin-top: 15px; height: 25px; + z-index: -1; +} +.contributions .faction_token { + z-index: -1; } .front .value { font-weight: bold; font-size: 30px; margin-top: auto; + z-index: -1; } #madrid_front { diff --git a/land-and-freedom.scss b/land-and-freedom.scss index 5c0c760..14ede73 100644 --- a/land-and-freedom.scss +++ b/land-and-freedom.scss @@ -230,12 +230,18 @@ main { // background-color: yellow; // opacity: 0.5; height: 25px; + z-index: -1; + + .faction_token { + z-index: -1; + } } .front .value { font-weight: bold; font-size: 30px; margin-top: auto; + z-index: -1; } #madrid_front { @@ -8,7 +8,6 @@ const STANDEES_COUNT = 5; const TRACK_COUNT = 5; const TRACK_LENGTH = 11; const FACTIONS = ['a', 'c', 'm']; -console.log('roles', document.getElementById('roles')); const ui = { map: document.getElementById('map'), medallions_container: document.getElementById('medallions'), @@ -173,7 +172,6 @@ const LAYOUT_TRACKS = [ [948, 489], ], ]; -console.log('ui', ui); function register_action(e, action, id) { e.my_action = action; e.my_id = id; @@ -181,7 +179,6 @@ function register_action(e, action, id) { action_register.push(e); } function on_click_action(evt) { - console.log('on_click_action', evt); if (evt.button === 0) if (send_action(evt.target.my_action, evt.target.my_id)) evt.stopPropagation(); @@ -195,7 +192,6 @@ function is_action(action, arg) { } let on_init_once = false; function on_init() { - console.log('on_init'); if (on_init_once) return; on_init_once = true; @@ -21,8 +21,6 @@ const TRACK_LENGTH = 11; const FACTIONS = ['a', 'c', 'm']; // const ROLES = ['Anarchist', 'Communist', 'Moderate']; -console.log('roles', document.getElementById('roles')); - const ui = { map: document.getElementById('map'), medallions_container: document.getElementById('medallions'), @@ -218,8 +216,6 @@ const LAYOUT_TRACKS = [ // }); // })(); -console.log('ui', ui); - function register_action( e: HTMLElement & { my_action?: string; my_id?: string | number }, action: string, @@ -232,7 +228,6 @@ function register_action( } function on_click_action(evt) { - console.log('on_click_action', evt); if (evt.button === 0) if (send_action(evt.target.my_action, evt.target.my_id)) evt.stopPropagation(); @@ -250,7 +245,6 @@ function is_action(action, arg) { let on_init_once = false; function on_init() { - console.log('on_init'); if (on_init_once) return; on_init_once = true; @@ -428,11 +422,6 @@ function on_update() { ui.roles[view.initiative].medallions.appendChild(ui.initiative_token); ui.initiative_token.setAttribute('data-year', view.year); - - - // ui.turn_info.replaceChildren(); - // console.log('played_card', view.played_card); - // console.log('turn_info', ui.turn_info); if (view.played_card === null) { ui.turn_info.style.display = 'none'; } else { @@ -453,7 +442,7 @@ function on_update() { action_button('d_liberty', 'Decrease Liberty'); action_button('soviet_support', 'Soviet Support'); action_button('collectivization', 'Collectivization'); - + action_button('d_collectivization', 'Decrease Collectivization'); action_button('d_foreign_aid', 'Decrease Foreign Aid'); action_button('d_government', 'Decrease Government'); @@ -476,7 +465,7 @@ function on_update() { // action_button('draw_card', 'Draw card'); action_button('play_for_ap', 'Play card for Action Points'); action_button('play_for_event', 'Play card for Event'); - + action_button('add_glory', 'Add Glory'); action_button('up', 'Up'); action_button('down', 'Down'); @@ -78,7 +78,6 @@ function gen_spend_hero_points() { } } function action(state, player, action, arg) { - console.log('action', player, action, arg); if (action !== 'undo') { state.undo = push_undo(); } @@ -886,11 +885,9 @@ states.choose_final_bid = { const faction = get_active_faction(); game.selected_cards[faction].push(c); const number_selected = game.selected_cards[faction].length; - console.log('number selected', number_selected); const number_hand = game.hands[faction].length; if (number_selected === 3 || (number_hand < 4 && number_selected === number_hand - 1)) { - console.log('proceed'); resolve_active_and_proceed(); } else { @@ -1473,7 +1470,6 @@ states.swap_card_tableau_hand = { resolve_spend_hp(); }, card(c) { - console.log('card', c); const faction = get_active_faction(); const selected_cards = game.selected_cards[faction]; selected_cards.push(c); @@ -1778,7 +1774,6 @@ function end_of_year() { log('The war is won!'); } else { - console.log('The war is lost'); game_over('None', 'The war is lost. All Players lose the game!'); resolve_active_and_proceed(); return; @@ -198,7 +198,6 @@ export function action( action: string, arg: unknown ) { - console.log('action', player, action, arg); if (action !== 'undo') { state.undo = push_undo(); } @@ -1122,13 +1121,12 @@ states.choose_final_bid = { const faction = get_active_faction(); game.selected_cards[faction].push(c); const number_selected = game.selected_cards[faction].length; - console.log('number selected', number_selected); + const number_hand = game.hands[faction].length; if ( number_selected === 3 || (number_hand < 4 && number_selected === number_hand - 1) ) { - console.log('proceed'); resolve_active_and_proceed(); } else { next(); @@ -1796,7 +1794,6 @@ states.swap_card_tableau_hand = { resolve_spend_hp(); }, card(c: CardId) { - console.log('card', c); const faction = get_active_faction(); const selected_cards = game.selected_cards[faction]; @@ -2186,7 +2183,6 @@ function end_of_year() { if (is_won) { log('The war is won!'); } else { - console.log('The war is lost'); game_over('None', 'The war is lost. All Players lose the game!'); resolve_active_and_proceed(); return; |