aboutsummaryrefslogtreecommitdiff
path: root/webAO
diff options
context:
space:
mode:
authorsD <stoned@derpymail.org>2019-12-25 18:44:39 +0100
committersD <stoned@derpymail.org>2019-12-25 18:44:39 +0100
commit099ae02dd9ff85a0ff31a93042abd2ec3e3a96c6 (patch)
tree28de73596794d480f9979a9dd484a50d9982ed41 /webAO
parent2e7825b0ca0508053826e36add9888a64c62925a (diff)
use DOM instead of jquery
Diffstat (limited to 'webAO')
-rw-r--r--webAO/client.js12
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 + "%";
}
/**