Skip to content

Commit

Permalink
add win message animation and fix tie style
Browse files Browse the repository at this point in the history
  • Loading branch information
HuiGong-dev committed Jan 11, 2022
1 parent 4381d48 commit 46b2e9b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ function handleCrossWon() {
} else {
whoWinsText.innerText = "YOU LOSE!"
}
whoTakesRound.classList.remove('tie');
whoTakesRoundLogo.classList.remove(LOGO_O);
whoTakesRoundLogo.classList.add(LOGO_X);
// if (!whoTakesRoundLogo.classList.contains(LOGO_X)) {
Expand Down Expand Up @@ -288,7 +289,7 @@ function endGame(tie) {
isGameStarted = false;
setTimeout(() => {
winningMessage.classList.add(SHOW);
}, 500);
}, 200);

}

Expand Down
20 changes: 20 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,26 @@ display: none;
.winning-message.show {
display: flex;
}



.winning-message.show .winning-message__banner {
animation: slide-in-from-left;
animation-duration: 0.3s;
animation-fill-mode: forwards;

}



@keyframes slide-in-from-left {
0%{
transform: translateX(-100%);
}
100%{
transform: translate(0);
}
}

/* intro page */
.intro {
Expand Down

0 comments on commit 46b2e9b

Please sign in to comment.