From 66296c36ac7e9ab2a3f74699351d84b0fb1cdeca Mon Sep 17 00:00:00 2001 From: Bezza Younes Date: Thu, 5 Dec 2024 20:20:52 +0100 Subject: [PATCH] =?UTF-8?q?timer=20ajout=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TODO.txt | 1 + demineur.html | 13 +++++++++---- demineur.js | 30 ++++++++++++++++++++++++++++++ style.css | 19 ++++++++++++++----- 4 files changed, 54 insertions(+), 9 deletions(-) create mode 100644 TODO.txt diff --git a/TODO.txt b/TODO.txt new file mode 100644 index 0000000..858d9ac --- /dev/null +++ b/TODO.txt @@ -0,0 +1 @@ +younes: final chrono , pop up cookie , centrer ligne , animation pop up diff --git a/demineur.html b/demineur.html index ac25e47..859c424 100644 --- a/demineur.html +++ b/demineur.html @@ -5,6 +5,7 @@ Démineur + @@ -15,17 +16,21 @@
Help
+
Temps: -
+ + +
Mines restantes:10
ICI se retourve le jeu
+ + - - + - \ No newline at end of file + diff --git a/demineur.js b/demineur.js index 2c431da..707faf1 100644 --- a/demineur.js +++ b/demineur.js @@ -7,3 +7,33 @@ class Case { } } +function sleep(ms){ + return new Promise(resolve => setTimeout(resolve, ms)); +} +async function chrono(){ + let k=document.getElementById("temps").value; + const myButton = document.getElementById("fin_game"); + let arret=0; + + while(arret==!1) { + + await sleep(1000); + document.getElementById("temps").value=document.getElementById("temps").value*1+1; + myButton.addEventListener("click",() =>{arret=1;}) +} +} +async function reset(){ + await sleep(500); + document.getElementById("temps").value=0; + +} + +function Cookies() { + var accept = confirm("Tu veux des cookies ?"); + if (accept === true) { + alert("Bon jeu!"); + } else { + Cookies(); + } + } +Cookies(); \ No newline at end of file diff --git a/style.css b/style.css index 4375b34..f94e073 100644 --- a/style.css +++ b/style.css @@ -1,6 +1,6 @@ #nav_demineur{ width: 100%; - background-position:0cm; + background-color: #2bd7d484; border-width: 2px; border-style: double; @@ -18,13 +18,22 @@ } #jeu{ + display: flex; - justify-content: center; - /* border-width: 2px; - border-style: double; */ + justify-content: left; + border-width: 2px; + border-style: double; + width: 49%; } .item_nav{ margin-top: 3px; padding-right: 10px; -} \ No newline at end of file +} +.vertical-line{ + border-left: 4px solid #000; + display: inline-block; + height: 400px; + margin: 0 50% ; + padding-top: 0; + } \ No newline at end of file