diff options
Diffstat (limited to 'webAO/client.js')
| -rw-r--r-- | webAO/client.js | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/webAO/client.js b/webAO/client.js index 6e481f5..ca1dcdd 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -830,19 +830,17 @@ class Client extends EventEmitter { */ handleHP(args) { const percent_hp = args[2] * 10; - if (args[1] === 1) { + let healthbox; + if (args[1] === "1") { // Def hp this.hp[0] = args[2]; - $("#client_defense_hp > .health-bar").animate({ - "width": percent_hp + "%" - }, 500); + healthbox = document.getElementById("client_defense_hp"); } else { // Pro hp this.hp[1] = args[2]; - $("#client_prosecutor_hp > .health-bar").animate({ - "width": percent_hp + "%" - }, 500); + healthbox = document.getElementById("client_prosecutor_hp"); } + healthbox.getElementsByClassName("health-bar")[0].style.width = percent_hp + "%"; } /** |
