diff options
| author | sD <stoned@derpymail.org> | 2019-12-25 18:44:39 +0100 |
|---|---|---|
| committer | sD <stoned@derpymail.org> | 2019-12-25 18:44:39 +0100 |
| commit | 099ae02dd9ff85a0ff31a93042abd2ec3e3a96c6 (patch) | |
| tree | 28de73596794d480f9979a9dd484a50d9982ed41 /webAO | |
| parent | 2e7825b0ca0508053826e36add9888a64c62925a (diff) | |
use DOM instead of jquery
Diffstat (limited to 'webAO')
| -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 + "%"; } /** |
