This commit is contained in:
Suvodip
2025-01-26 14:54:52 +05:30
parent 54f2c9f06e
commit 50db006fd5
6 changed files with 45 additions and 32 deletions

View File

@@ -312,26 +312,24 @@ function submitUserData(drawingZone) {
setTimeout(() => {
if (data && data.message === "Game data saved successfully") {
starValue = data.data.score;
let feedbackMessage = '';
if (starValue >= 1 && starValue <= 3) {
feedbackMessage = "You're making progress! Let's keep going!";
} else if (starValue >= 4 && starValue <= 6) {
feedbackMessage = "Nice work! You're improving every day!";
} else if (starValue >= 7 && starValue <= 8) {
feedbackMessage = "Amazing work! Keep it up!";
} else if (starValue >= 9 && starValue <= 10) {
feedbackMessage = "Outstanding! You're a true superstar!";
} else {
feedbackMessage = "Invalid star value.";
}
loadingMainContainer.style.display = 'none';
loadingDiv.style.display = 'none';
starContainer.style.display = 'flex';
starContainer.style.flexDirection = 'row';
document.getElementById('countStar').innerHTML = starValue;
for (let i = 0; i < starValue; i++) {
const starDiv = document.createElement('div');
starDiv.innerHTML = starSVG;
starDiv.classList.add('star');
starContainer.appendChild(starDiv);
setTimeout(() => {
starDiv.style.opacity = '1';
starDiv.style.animationDelay = `${i * 0.5}s`;
}, i * 500);
}
for (let i = 0; i < maxStarValue - starValue; i++) {
const starDiv = document.createElement('div');
starDiv.innerHTML = blankStar;
starContainer.appendChild(starDiv);
}
document.getElementById('get-star-value').innerHTML = starValue;
document.getElementById('starFeedbackMessage').innerHTML = feedbackMessage;
scoreBoard.style.display = 'flex';
if (scoreBoard.style.display === 'flex') {
const bottomAnimateClipart = document.getElementById('bottomAnimateClipart');