Update index.html

This commit is contained in:
Degradin 2025-01-21 18:41:47 +03:00
parent a246ee0ca6
commit d78a11bce2

View File

@ -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}%`;