l'accueil a une sélection apr défaut

master
adplantade 5 years ago
parent af2f467616
commit 80dfab84a0

@ -3,15 +3,15 @@ var diffs=["easy","med","hard"];
var div=document.getElementById('buttons'); var div=document.getElementById('buttons');
size=screen.height/6; size=screen.height/6;
hideAll(); hideAll();
var modeSelected=null; var modeSelected="5p";
var diffSelected=null; var diffSelected="easy";
var btn_options=document.getElementById("btn_options"); var btn_options=document.getElementById("btn_options");
btn_options.width=size/2; btn_options.width=size/2;
document.getElementById("btn_play").width=size; document.getElementById("btn_play").width=size;
document.getElementById("btn_play_des").width=size; //document.getElementById("btn_play_des").width=size;
document.getElementById("btn_play").style.display="none"; document.getElementById("btn_play").style.display="inline";
document.getElementById("btn_high").width=size; document.getElementById("btn_high").width=size;
@ -76,9 +76,9 @@ diffs.forEach(element => {
}); });
}) })
function disp(what) function disp(what, short=false)
{ {
what=what.currentTarget.id.substring(4); what=(short ? what : what.currentTarget.id.substring(4));
modes.forEach(element => { modes.forEach(element => {
document.getElementById(element).style.display=what==element ? "flex":"none"; document.getElementById(element).style.display=what==element ? "flex":"none";
}) })
@ -104,3 +104,8 @@ function goHigh()
{ {
window.location.replace("./highscores.php"); window.location.replace("./highscores.php");
} }
disp("points",true);
document.getElementById("btn_points").classList.add("selected");
document.getElementById("5p").classList.add("selected");
document.getElementById("btn_easy").classList.add("selected");

@ -53,7 +53,7 @@
</div>--> </div>-->
<ul id="btns_play"> <ul id="btns_play">
<img id="btn_play" src="ress/button_play.png" onClick="play()"/> <img id="btn_play" src="ress/button_play.png" onClick="play()"/>
<img id="btn_play_des" src="ress/button_play_desac.png"/> <!--<img id="btn_play_des" src="ress/button_play_desac.png"/>-->
<img id="btn_high" src="ress/button_highscores.png" onClick="goHigh()"/> <img id="btn_high" src="ress/button_highscores.png" onClick="goHigh()"/>
</ul> </ul>
</div> </div>

Loading…
Cancel
Save