🎠👂 Checkpoint

./index.html:18108127/5
./script.js:18108127/191
./style.css:18108127/60
This commit is contained in:
Glitch (hello-webpage) 2020-07-29 22:26:46 +00:00
parent 88bc37a046
commit b38a58bcaf
3 changed files with 9 additions and 4 deletions

View file

@ -28,7 +28,7 @@
</div>
<div class="congrats-container">
<div class="congrats-container hide">
<h1>
You win! 🎉
</h1>

View file

@ -150,7 +150,7 @@ function scoreBarController(barId) {
setUserTime(username, seconds) {
if (this.hasUser(username)) {
let userContainer = this.getUser(username);
userContainer.lastElementChild.textContent = `${seconds} seconds`;
userContainer.lastElementChild.innerHTML = `<i class="fas fa-stopwatch"></i> ${Math.floor(seconds)} seconds`;
}
}
};
@ -174,7 +174,7 @@ function isGameEnd(discoveredCards, cards) {
function finishGame(username) {
let finalTimeSpan = document.getElementById("user-seconds");
let totalSeconds = (Date.now() - startTime) / 1000;
finalTimeSpan.textContent = `${totalSeconds} seconds`;
finalTimeSpan.textContent = `${Math.floor(totalSeconds)} seconds`;
scoresController.setUserTime(username, totalSeconds);

View file

@ -233,9 +233,14 @@ strong {
width: 35px;
}
.fa-stopwatch {
font-size: 18px;
margin-right: 3px;
}
@media (max-height: 865px) {
#user-scores {
max-height: 73%;
overflow-y: auto;
}
}
}