diff options
author | Tor Andersson <tor@ccxvii.net> | 2021-12-20 17:20:47 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2022-11-16 19:08:56 +0100 |
commit | fe837a001a035008642d831f4938fe6010787a5d (patch) | |
tree | 7617ae12960eb088c0d4c9c884c963ee5f1dc682 | |
parent | 0f402a882f6c5ac3fa8dcec8731b8adcf62ef834 (diff) | |
download | julius-caesar-fe837a001a035008642d831f4938fe6010787a5d.tar.gz |
Use ID instead of class for battle dialog.
-rw-r--r-- | play.html | 16 | ||||
-rw-r--r-- | ui.js | 30 |
2 files changed, 23 insertions, 23 deletions
@@ -84,10 +84,10 @@ /* BATTLE BOARD */ -.battle { background-color: tan; } -.battle .battle_message { background-color: wheat; } -.battle .battle_header { background-color: brown; color: wheat; font-weight: bold; } -.battle .battle_separator { background-color: brown; } +#battle { background-color: tan; } +#battle_message { background-color: wheat; } +#battle_header { background-color: brown; color: wheat; font-weight: bold; } +.battle_separator { background-color: brown; } .battle_line.enemy .battle_menu_list { min-height: 0; } .battle_reserves .battle_menu_list { min-height: 0; } @@ -160,7 +160,7 @@ body.shift .block.known:hover { z-index: 100; } -.battle .block { position: relative; } +#battle .block { position: relative; } #map .block { position: absolute; z-index: 2; } #map .block.highlight { z-index: 3; } #map .block.selected { z-index: 4; } @@ -239,9 +239,9 @@ body.Observer .columbia-labels .known.jupiter.Cleopatra { border: 3px solid #822 <form id="chat_form" action=""><input id="chat_input" autocomplete="off"></form> </div> -<table class="battle"> +<table id="battle"> <tr> -<th class="battle_header" colspan=4></th> +<th id="battle_header" colspan=4></th> <tr class="battle_reserves enemy"> <td colspan=4><div id="ER"></div></td> <tr class="battle_line enemy"> @@ -259,7 +259,7 @@ body.Observer .columbia-labels .known.jupiter.Cleopatra { border: 3px solid #822 <tr class="battle_reserves friendly"> <td colspan=4><div id="FR"></div></td> <tr> -<th class="battle_message" colspan=4></th> +<th id="battle_message" colspan=4></th> </table> <div id="grid_window"> @@ -14,20 +14,20 @@ function toggle_blocks() { function set_simple_labels() { label_style = 'simple'; - document.querySelector(".blocks").classList.remove("columbia-labels"); - document.querySelector(".battle").classList.remove("columbia-labels"); - document.querySelector(".blocks").classList.add("simple-labels"); - document.querySelector(".battle").classList.add("simple-labels"); + document.getElementById("blocks").classList.remove("columbia-labels"); + document.getElementById("battle").classList.remove("columbia-labels"); + document.getElementById("blocks").classList.add("simple-labels"); + document.getElementById("battle").classList.add("simple-labels"); window.localStorage['julius-caesar/label-style'] = label_style; update_map(); } function set_columbia_labels() { label_style = 'columbia'; - document.querySelector(".blocks").classList.remove("simple-labels"); - document.querySelector(".battle").classList.remove("simple-labels"); - document.querySelector(".blocks").classList.add("columbia-labels"); - document.querySelector(".battle").classList.add("columbia-labels"); + document.getElementById("blocks").classList.remove("simple-labels"); + document.getElementById("battle").classList.remove("simple-labels"); + document.getElementById("blocks").classList.add("columbia-labels"); + document.getElementById("battle").classList.add("columbia-labels"); window.localStorage['julius-caesar/label-style'] = label_style; update_map(); } @@ -719,12 +719,12 @@ function on_update() { ui.seen.clear(); if (game.battle) { - document.querySelector(".battle_header").textContent = game.battle.title; - document.querySelector(".battle_message").textContent = game.battle.flash; - document.querySelector(".battle").classList.add("show"); + document.getElementById("battle_header").textContent = game.battle.title; + document.getElementById("battle_message").textContent = game.battle.flash; + document.getElementById("battle").classList.add("show"); update_battle(); } else { - document.querySelector(".battle").classList.remove("show"); + document.getElementById("battle").classList.remove("show"); } for (let b in BLOCKS) @@ -784,10 +784,10 @@ function select_battle_pass(evt) { build_map(); -document.querySelector(".blocks").classList.add(label_style+'-labels'); -document.querySelector(".battle").classList.add(label_style+'-labels'); +document.getElementById("blocks").classList.add(label_style+'-labels'); +document.getElementById("battle").classList.add(label_style+'-labels'); -drag_element_with_mouse(".battle", ".battle_header"); +drag_element_with_mouse("#battle", "#battle_header"); scroll_with_middle_mouse("#grid_center"); init_map_zoom(); init_shift_zoom(); |