Compare commits
4 commits
4049db87da
...
380cebd36d
Author | SHA1 | Date | |
---|---|---|---|
|
380cebd36d | ||
|
657b327d91 | ||
|
678a1f6b2b | ||
|
b4bc6a8ab0 |
2 changed files with 35 additions and 4 deletions
|
@ -21,6 +21,9 @@
|
|||
your experience.
|
||||
</p>
|
||||
<![endif]-->
|
||||
<div id="timer">Time</div>
|
||||
<button id="Pause" onclick="Pause()">Pause</button>
|
||||
<canvas id="canvas" width="800" height="400"></canvas>
|
||||
<div class="to-center">
|
||||
<canvas id="canvas" width="800" height="400"></canvas>
|
||||
<div class="text-bubble">
|
||||
|
|
36
script.js
36
script.js
|
@ -44,11 +44,39 @@ const sleep = (ms) => {
|
|||
return new Promise(resolve => setTimeout(resolve, ms));
|
||||
}
|
||||
|
||||
//function qui met à jour le temps
|
||||
|
||||
let time = 10;
|
||||
|
||||
function timer(){
|
||||
let txt = document.getElementById('timer');
|
||||
let level = 0;
|
||||
let afficher = "Time : " + time;
|
||||
txt.innerHTML= afficher;
|
||||
|
||||
time = time <= 0 ? 0 : time -1;
|
||||
if (time == )
|
||||
{
|
||||
clearInterval(maVar);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
let maVar = setInterval(timer, 1000);
|
||||
if (time == 0){
|
||||
alert('Terminé YAsmine')
|
||||
}
|
||||
// while (document.readyState != "complete") {
|
||||
/*function set_time(){
|
||||
minutes=Math.floor
|
||||
}*/
|
||||
|
||||
function Pause(){
|
||||
time = time -10;
|
||||
}
|
||||
|
||||
// while (document.readyState != "complete") {
|
||||
setTimeout(1000);
|
||||
// (new Promise((resolve) => {
|
||||
// setTimeout(resolve, 100)
|
||||
// })).then(()=>{;})
|
||||
// }
|
||||
|
||||
|
||||
playground.draw(ctx);
|
||||
|
|
Loading…
Reference in a new issue