From d78a11bce27f1210f5e8f17a2b8ec00b31524591 Mon Sep 17 00:00:00 2001 From: Degradin <42292046+Degradin@users.noreply.github.com> Date: Tue, 21 Jan 2025 18:41:47 +0300 Subject: [PATCH] Update index.html --- public/index.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/public/index.html b/public/index.html index a4df3f2..a1b506b 100644 --- a/public/index.html +++ b/public/index.html @@ -351,8 +351,10 @@ body { characterProgress.style.strokeDashoffset = 251 - (251 * user.characterLevel / 100); // Установка прогресса HP и Стамины - const hpProgress = user.maxHp ? (user.hp / user.maxHp) * 100 : 0; - const staminaProgress = user.maxStamina ? (user.stamina / user.maxStamina) * 100 : 0; + let hpProgress = user.maxHp ? (user.hp / user.maxHp) * 100 : 0; + let staminaProgress = user.maxStamina ? (user.stamina / user.maxStamina) * 100 : 0; + if (hpProgress <= 0) hpProgress = 0; + if (staminaProgress <= 0) staminaProgress = 0; document.getElementById("hp-bar").style.width = `${hpProgress}%`;