From 3115b205efcf49a2c60c304aed34a2ea324db9cf Mon Sep 17 00:00:00 2001 From: pisouvigne Date: Sun, 14 Jun 2020 12:14:09 +0200 Subject: [PATCH] =?UTF-8?q?ajout=20des=20=C3=A9toiles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- site/vue/css/style.css | 4 ++++ site/vue/index.html | 9 ++++++++- site/vue/js/timer.js | 17 +++++++++++++---- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/site/vue/css/style.css b/site/vue/css/style.css index 562333a..e2032df 100644 --- a/site/vue/css/style.css +++ b/site/vue/css/style.css @@ -267,4 +267,8 @@ hr{ max-width: 95%; margin:2%; transition: 1.5s; +} +.fa-star{ + font-size: 10vh; + cursor: default; } \ No newline at end of file diff --git a/site/vue/index.html b/site/vue/index.html index db3144f..f774488 100644 --- a/site/vue/index.html +++ b/site/vue/index.html @@ -111,7 +111,14 @@

Niveau max :


Entrez votre pseudo :

- +
+
+
+

+ + + +

diff --git a/site/vue/js/timer.js b/site/vue/js/timer.js index 84fda48..4b0b1a0 100644 --- a/site/vue/js/timer.js +++ b/site/vue/js/timer.js @@ -28,10 +28,19 @@ timer.addEventListener('secondsUpdated', function (e) { function endTime() { if(!isTuto){ document.querySelector("#mainPage").style.display = 'block'; - document.querySelector("#playPage").style.display = 'none'; - document.querySelector("#scoreTotGameOver").innerHTML = (niveauActuel * (50 / timeTot)).toFixed(2); - document.querySelector("#niveauGameOver").innerHTML = niveauActuel; - document.querySelector("#TempsTotGameOver").innerHTML = timeTot; + var score = (niveauActuel * (50 / timeTot)).toFixed(2); + document.querySelector("#playPage").style.display = 'none'; + document.querySelector("#scoreTotGameOver").innerHTML = score; + document.querySelector("#niveauGameOver").innerHTML = niveauActuel; + document.querySelector("#TempsTotGameOver").innerHTML = timeTot; + //calcul stars + if(score < 10){ + document.querySelector("#star1").style.color = "#fe8a71"; + }else if(score > 10 || score < 50){ + document.querySelector("#star2").style.color = "#fe8a71"; + }else if(score > 10 || score < 50){ + document.querySelector("#star2").style.color = "#fe8a71"; + } openModal('gameOver'); }