show loading screen

This commit is contained in:
Mahdi Dibaiee
2017-04-04 23:11:59 +04:30
parent dff72c7cc3
commit 9ea5626565
3 changed files with 40 additions and 0 deletions

View File

@ -511,9 +511,13 @@ function newGame() {
return;
}
$('#loading').addClass('active');
fetch('/play').then(res => res.json()).then(function(states) {
playing = true;
$('#loading').removeClass('active');
var i = 0;
setTimeout(function p() {
if (!playing) return;