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

View File

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

View File

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