MiniApp Progress Bar Fixes

This commit is contained in:
Degradin 2025-01-22 18:28:42 +03:00
parent ecaad92ef0
commit e0a4eb184d
2 changed files with 14 additions and 6 deletions

View File

@ -62,11 +62,17 @@
position: relative;
height: 20px;
width: 100%;
background: rgba(255, 255, 255, 0.1);
background: linear-gradient(90deg, #e26f22, #e28f22, #e29c22); /* Градиент */
border-radius: 10px;
overflow: hidden;
margin: 10px 0;
transition: width 0.5s ease;
box-shadow: 0 0 10px rgba(226, 111, 34, 0.6), 0 0 20px rgba(226, 111, 34, 0.4), 0 0 30px rgba(226, 111, 34, 0.3); /* Тени для неонового эффекта */
transition: all 0.3s ease; /* Плавные переходы */
}
.progress-bar:hover {
transform: scale(1.05); /* Легкое увеличение при наведении */
box-shadow: 0 0 15px rgba(226, 111, 34, 1), 0 0 25px rgba(226, 111, 34, 0.8), 0 0 35px rgba(226, 111, 34, 0.6); /* Увеличение свечения при наведении */
}
.progress-hp, .progress-stamina {
@ -375,8 +381,10 @@
const profileProgress = document.getElementById("profile-progress");
const characterProgress = document.getElementById("character-progress");
profileProgress.style.strokeDashoffset = 251 - (251 * user.profileLevel / 100);
characterProgress.style.strokeDashoffset = 251 - (251 * user.characterLevel / 100);
const profileProgressValue = (user.profileExp / user.profileExpToUp) * 251;
const characterProgressValue = (user.characterExp / user.characterExpToUp) * 251;
profileProgress.style.strokeDashoffset = 251 - profileProgressValue;
characterProgress.style.strokeDashoffset = 251 - characterProgressValue;
// Установка прогресса HP и Стамины
let hpProgress = user.maxHp ? (user.hp / user.maxHp) * 100 : 0;

4
rpg.js
View File

@ -2383,7 +2383,7 @@ function generateBattleButtons(character, battle) {
// Обязательно добавляем одну кнопку с критическим ударом
buttons.push({
text: `🔥`, // Символ для критического удара
text: `🎯`, // Символ для критического удара
callback_data: `critical_${battle.id}`,
});
@ -2398,7 +2398,7 @@ function generateBattleButtons(character, battle) {
} else if (Math.random() < missChance) {
// Кнопка промаха (с шансом появления промаха)
buttons.push({
text: "", // Символ для промаха
text: "🎯", // Символ для промаха
callback_data: `miss_${battle.id}`,
});
}