From 80dfab84a04c484262dd16f6102edfd50256d804 Mon Sep 17 00:00:00 2001 From: adplantade Date: Mon, 10 Aug 2020 18:55:05 +0200 Subject: [PATCH] =?UTF-8?q?l'accueil=20a=20une=20s=C3=A9lection=20apr=20d?= =?UTF-8?q?=C3=A9faut?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/button_displayer.js | 19 ++++++++++++------- code/index.php | 2 +- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/code/button_displayer.js b/code/button_displayer.js index 40e60cc..171f88c 100644 --- a/code/button_displayer.js +++ b/code/button_displayer.js @@ -3,15 +3,15 @@ var diffs=["easy","med","hard"]; var div=document.getElementById('buttons'); size=screen.height/6; hideAll(); -var modeSelected=null; -var diffSelected=null; +var modeSelected="5p"; +var diffSelected="easy"; var btn_options=document.getElementById("btn_options"); btn_options.width=size/2; document.getElementById("btn_play").width=size; -document.getElementById("btn_play_des").width=size; -document.getElementById("btn_play").style.display="none"; +//document.getElementById("btn_play_des").width=size; +document.getElementById("btn_play").style.display="inline"; 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 => { document.getElementById(element).style.display=what==element ? "flex":"none"; }) @@ -103,4 +103,9 @@ function play() function goHigh() { window.location.replace("./highscores.php"); -} \ No newline at end of file +} + +disp("points",true); +document.getElementById("btn_points").classList.add("selected"); +document.getElementById("5p").classList.add("selected"); +document.getElementById("btn_easy").classList.add("selected"); \ No newline at end of file diff --git a/code/index.php b/code/index.php index 41c5769..3f21152 100644 --- a/code/index.php +++ b/code/index.php @@ -53,7 +53,7 @@ -->