win animation

This commit is contained in:
AUnicornWithNoLife 2021-04-12 17:53:18 +01:00
parent 93f2938ee7
commit 8b81b60349
3 changed files with 29 additions and 3 deletions

View File

@ -32,13 +32,23 @@ function move(id)
score[winner - 1]++; score[winner - 1]++;
info['score'].innerHTML = score[0] + " | " + score[1]; info['score'].innerHTML = score[0] + " | " + score[1];
tabloid.classList.add('win');
}
else
{
tabloid.classList.add('lol')
} }
info['go'] = "X's Go"; info['go'] = "X's Go";
ptm = 1; ptm = 1;
reset(); setTimeout(function ()
{
reset();
}, 1500);
return; return;
} }
@ -148,4 +158,7 @@ function reset()
board[x][y][1].innerHTML = " "; board[x][y][1].innerHTML = " ";
} }
} }
tabloid.classList.remove('win');
tabloid.classList.remove('lol');
} }

View File

@ -16,13 +16,16 @@
* *
{ {
background-color: #231F20;
color: white; color: white;
font-family: 'Roboto', sans-serif; font-family: 'Roboto', sans-serif;
} }
body
{
background-color: #231F20;
}
button button
{ {
height: 75px; height: 75px;
@ -42,4 +45,11 @@ button
{ {
height: 50px; height: 50px;
width: 150px; width: 150px;
}
.win
{
border-radius: 12px;
background-color: #9DB17C;
} }

View File

@ -3,6 +3,7 @@ var info;
var score; var score;
var ids; var ids;
var ptm; var ptm;
var tabloid;
function load() function load()
{ {
@ -53,4 +54,6 @@ function load()
}; };
ptm = 1; ptm = 1;
tabloid = document.getElementById('board');
} }