From 099ae02dd9ff85a0ff31a93042abd2ec3e3a96c6 Mon Sep 17 00:00:00 2001 From: sD Date: Wed, 25 Dec 2019 18:44:39 +0100 Subject: use DOM instead of jquery --- webAO/client.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'webAO/client.js') 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 + "%"; } /** -- cgit