Add information restart game

This commit is contained in:
Léo 2020-05-24 21:10:44 +02:00
parent ba02632351
commit 31e4b1919a
3 changed files with 19 additions and 1 deletions

View File

@ -409,3 +409,13 @@ fieldset.fieldset {
table.tablelogin td{ table.tablelogin td{
padding: 10px 0px 10px 0px; padding: 10px 0px 10px 0px;
}
#info {
position: absolute;
top: 0px;
left: 280px;
padding:3px;
text-align: center;
background: #FFC577;
}

View File

@ -129,6 +129,11 @@ var set_derpli = function(){
$('#der-pli-'+i).html(`<img src="/static/cards/${jeu['last_played'][i]}.png" width=100% />`); $('#der-pli-'+i).html(`<img src="/static/cards/${jeu['last_played'][i]}.png" width=100% />`);
} }
} }
else if(jeu['turn']<0){
for(i=0;i<4;i++){
$('#der-pli-'+i).html();
}
}
} }
var set_players = function(){ var set_players = function(){
@ -173,7 +178,8 @@ var set_current_player = function(){
$(document).ready(function() { $(document).ready(function() {
socket = io(window.location.pathname); socket = io(window.location.pathname);
$('#suivant').hide() $('#suivant').hide();
$('#info').hide();
set_points(); set_points();
set_atout(); set_atout();
set_jeu(); set_jeu();
@ -208,6 +214,7 @@ socket.on('restart', function(data) {
set_players(); set_players();
set_current_player(); set_current_player();
socket.emit('monjeu', {}); socket.emit('monjeu', {});
$('#info').fadeIn().delay(2000).fadeOut()
}); });
socket.on('choose_color', function(data){ socket.on('choose_color', function(data){

View File

@ -8,6 +8,7 @@
<div id="jeu-1" class="carte"></div><!-- jeu-1 --> <div id="jeu-1" class="carte"></div><!-- jeu-1 -->
<div id="jeu-2" class="carte"></div><!-- jeu-2 --> <div id="jeu-2" class="carte"></div><!-- jeu-2 -->
<div id="jeu-3" class="carte"></div><!-- jeu-3 --> <div id="jeu-3" class="carte"></div><!-- jeu-3 -->
<div id="info" style="display: none;">Nouveau jeu !</div>
<div id="suivant"> <div id="suivant">
<input type="submit" name="suivant" value="Redistribuer" onclick="javascript:restart_jeu()"> <input type="submit" name="suivant" value="Redistribuer" onclick="javascript:restart_jeu()">
</div><!-- suivant --> </div><!-- suivant -->