From ea269654e3d08e9529c3042cd27eb8b977fae712 Mon Sep 17 00:00:00 2001 From: joniboy74prog Date: Fri, 8 Dec 2023 04:29:35 +0100 Subject: [PATCH 1/3] =?UTF-8?q?enlever=20les=20grosses=20usines=20=C3=A0?= =?UTF-8?q?=20gaz?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/fonctions.js | 39 +-------------------------------------- 1 file changed, 1 insertion(+), 38 deletions(-) diff --git a/back/fonctions.js b/back/fonctions.js index 8de8c21..fc09671 100644 --- a/back/fonctions.js +++ b/back/fonctions.js @@ -155,44 +155,7 @@ function getImg2(categorie, indice){ // function for random index of a function -async function getQuestionByCategorie2(category) { - try { - const response = await fetch(`./${category}.json`); - - if (!response.ok) { - throw new Error(`Erreur de chargement du fichier JSON : ${response.status}`); - } - - const objetJson = await response.json(); - const questions = objetJson.questions; - - console.log(questions); - return questions; - - } catch (error) { - console.error('Erreur lors du chargement du fichier JSON :', error.message); - alert('Erreur lors du chargement du fichier JSON. Consultez la console pour les détails.'); - throw error; // Re-throw the error for further handling - } - } - - - console.log(getQuestionByCategorie2("transport")) - - function shuffleArray(array) { - const shuffledArray = [...array]; - for (let i = shuffledArray.length - 1; i > 0; i--) { - const j = Math.floor(Math.random() * (i + 1)); - [shuffledArray[i], shuffledArray[j]] = [shuffledArray[j], shuffledArray[i]]; - } - return shuffledArray; - } - - function createShuffledIndicesArray(array) { - const indicesArray = Array.from({ length: array.length }, (_, index) => index); - return shuffleArray(indicesArray); - } - + function getNextIndex(indicesArray) { if (indicesArray.length === 0) { // Si tous les indices ont été utilisés, réinitialiser le tableau d'indices From 69acc46d1be5ee8b7e3db04a3673eb713379fe8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luc=C3=A0s?= Date: Fri, 8 Dec 2023 04:33:09 +0100 Subject: [PATCH 2/3] Edit jeu.html --- front/easterEggEtoile.html | 54 ++++++++++++++++++++++++++++++++------ front/index.html | 3 ++- front/jouer.html | 6 +++-- front/style/easter eggs | 4 +++ front/style/jeu.css | 20 +++++++------- front/style/main.css | 11 +++++--- 6 files changed, 74 insertions(+), 24 deletions(-) create mode 100644 front/style/easter eggs diff --git a/front/easterEggEtoile.html b/front/easterEggEtoile.html index 8cf0638..f3bace3 100644 --- a/front/easterEggEtoile.html +++ b/front/easterEggEtoile.html @@ -17,20 +17,55 @@ } h1 { - font-family: 'Manrope', extrabold; + font-family: 'Manrope', sans-serif; + font-weight: 400; font-size: 64px; - color: white; - text-shadow: 0 0 10px rgba(0, 0, 0, 0.5); + color: #0E3B43; } p { - font-size: 18px; - margin-bottom: 30px; + font-family: 'Manrope', sans-serif; + font-weight: 300; + font-size: 20px; + color: #0E3B43; } #santa { font-size: 72px; cursor: pointer; + color: darkred; + } + + .arrow-container { + display: flex; + } + + .arrow_right { + font-size: 36px; + animation: swing_arrow_right 1s infinite alternate; + } + + .arrow_left { + font-size: 36px; + animation: swing_arrow_left 1s infinite alternate; + } + + @keyframes swing_arrow_right { + 0% { + transform: translateX(0); + } + 100% { + transform: translateX(10px); + } + } + + @keyframes swing_arrow_left { + 0% { + transform: translateX(0); + } + 100% { + transform: translateX(-10px); + } } @@ -40,10 +75,13 @@

En cette période festive, pensons à la nature et à la durabilité.

Faites un geste écologique pendant les fêtes ! 🌲

-
→ 🎅 ←
- +
+

+
🎅
+

+
diff --git a/front/index.html b/front/index.html index 1790c5d..80c10a8 100644 --- a/front/index.html +++ b/front/index.html @@ -30,10 +30,11 @@

distinguons la réalité
des idées reçues.

Défiez les idées reçues sur l'écologie avec notre quiz captivant ! +
Testez-vous dès maintenant pour une expérience éducative et amusante.

- + diff --git a/front/jouer.html b/front/jouer.html index 587daff..0ab9b5c 100644 --- a/front/jouer.html +++ b/front/jouer.html @@ -45,11 +45,13 @@
imgleft +
Votre texte ici
@@ -85,10 +87,10 @@ leftSection.classList.remove('hide'); }); - let score = 20; + let score = 0; function augmenterCompteur() { - score += 5; + score++; if (score >= 5) { document.getElementById('star1').style.visibility = 'visible'; diff --git a/front/style/easter eggs b/front/style/easter eggs new file mode 100644 index 0000000..f6133aa --- /dev/null +++ b/front/style/easter eggs @@ -0,0 +1,4 @@ +Liste des easter eggs : + +- Joyeux noël écologique ! : Répondez juste à toutes les questions du quizz + et une nouvelle page s'ouvre. \ No newline at end of file diff --git a/front/style/jeu.css b/front/style/jeu.css index b670788..708420f 100644 --- a/front/style/jeu.css +++ b/front/style/jeu.css @@ -93,14 +93,18 @@ section a { /*background-image: url('');*/ } -.answer { - margin-top: 50vh; - text-align: center; +.text-overlay { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + font-size: 24px; font-family: 'inter', sans-serif; font-weight: 400; - font-size: 40px; - text-shadow: 0 0 10px rgba(0, 0, 0, 0.5); + text-align: center; + padding: 10px; color: white; + } .question { @@ -108,8 +112,6 @@ section a { top: 0; left: 50%; transform: translateX(-50%); - - background-color: #FFF1DD; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5); border-radius: 10px; @@ -122,14 +124,14 @@ section a { .question h2 { font-family: 'inter', sans-serif; font-weight: 400; - font-size: 40px; + font-size: 35px; color: black; margin: 0; } .question p { font-family: 'Manrope', sans-serif; - font-size: 20px; + font-size: 25px; color: black; } diff --git a/front/style/main.css b/front/style/main.css index db5c07b..6017ee8 100644 --- a/front/style/main.css +++ b/front/style/main.css @@ -17,7 +17,8 @@ main { } h1 { - font-family: 'Manrope', extrabold; + font-family: 'Manrope', sans-serif; + font-weight: 400; font-size: 64px; color: white; text-shadow: 0 0 10px rgba(0, 0, 0, 0.5); @@ -25,14 +26,16 @@ h1 { } h2 { - font-family: 'Manrope', extrabold; + font-family: 'Manrope', sans-serif; + font-weight: 400; font-size: 48px; color: white; text-shadow: 0 0 10px rgba(0, 0, 0, 0.5); } #sous-pres { - font-family: 'Manrope', bold; + font-family: 'Manrope', sans-serif; + font-weight: 300; font-size: 20px; color: white; text-shadow: 0 0 10px rgba(0, 0, 0, 0.5); @@ -45,7 +48,7 @@ h2 { height: 59px; padding: 10px 20px; margin-top: 90px; - font-family: 'Manrope', bold; + font-family: 'Manrope', sans-serif; font-size: 20px; border: none; border-radius: 10px; From c32dbed07c539d74f98b1969a3cf6f1d785a1fed Mon Sep 17 00:00:00 2001 From: joniboy74prog Date: Fri, 8 Dec 2023 04:33:38 +0100 Subject: [PATCH 3/3] =?UTF-8?q?enlever=20les=20grosses=20usines=20=C3=A0?= =?UTF-8?q?=20gaz?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/fonctions.js | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/back/fonctions.js b/back/fonctions.js index fc09671..45bf103 100644 --- a/back/fonctions.js +++ b/back/fonctions.js @@ -156,22 +156,8 @@ function getImg2(categorie, indice){ // function for random index of a function - function getNextIndex(indicesArray) { - if (indicesArray.length === 0) { - // Si tous les indices ont été utilisés, réinitialiser le tableau d'indices - return null; // ou une autre valeur pour indiquer que tous les indices ont été utilisés - } - return indicesArray.shift(); - } - - const votreTableau = await getQuestionByCategorie2('transport'); - const shuffledIndices = createShuffledIndicesArray(votreTableau); - - // À chaque appel, récupérez le prochain indice - const premierIndice = getNextIndex(shuffledIndices); - const deuxiemeIndice = getNextIndex(shuffledIndices); - - console.log(premierIndice); // Indice aléatoire - console.log(deuxiemeIndice); // Indice différent + function getIndex(){ + + }