From 05545ffe4ffb95e247e6db3e9ab1cf0271330365 Mon Sep 17 00:00:00 2001 From: Antoine Jourdain Date: Sun, 19 Nov 2023 22:23:54 +0100 Subject: [PATCH] =?UTF-8?q?Ajout=20vu=20r=C3=A9sultat=20faut=20le=20modifi?= =?UTF-8?q?er,=20=C3=A7a=20appel=20pas=20twig?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Project/php/css/memory.css | 10 +++++++--- Project/php/js/memory.js | 4 +++- Project/php/templates/memory.html | 2 -- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Project/php/css/memory.css b/Project/php/css/memory.css index 59c5749..eba5827 100755 --- a/Project/php/css/memory.css +++ b/Project/php/css/memory.css @@ -10,9 +10,10 @@ body { #memory-game { display: grid; - grid-template-columns: repeat(7, 1fr); - grid-template-rows: repeat(4, 140px); + grid-template-columns: repeat(7, minmax(0, 1fr)); + grid-template-rows: repeat(4, minmax(0, 1fr)); gap: 10px; + margin: auto; } .card { @@ -26,7 +27,10 @@ body { align-items: center; font-size: 18px; cursor: pointer; - transition: background-color 0.3s ease;; + transition: background-color 0.3s ease; + min-height: 10vh; + min-width: 20vh; + aspect-ratio: 1/1; } .flipped { diff --git a/Project/php/js/memory.js b/Project/php/js/memory.js index 4df90cf..73c4b83 100644 --- a/Project/php/js/memory.js +++ b/Project/php/js/memory.js @@ -73,6 +73,8 @@ document.addEventListener('DOMContentLoaded', function () { } function checkGameCompletion(){ - return; + if (document.querySelectorAll('.card.found').length === cards.length) { + window.location.href = '../../templates/resultatsJeux.html'; // A MODIFIER POUR UN TWIG RENDER + } } }); \ No newline at end of file diff --git a/Project/php/templates/memory.html b/Project/php/templates/memory.html index 06d6b0b..5f12a8f 100755 --- a/Project/php/templates/memory.html +++ b/Project/php/templates/memory.html @@ -21,7 +21,5 @@ - - \ No newline at end of file