From 67b1e931e31b4e302c16aabc4e39ae5c71616e7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Garnier?= Date: Wed, 4 Jan 2023 13:29:14 +0100 Subject: [PATCH 1/4] =?UTF-8?q?Corection=20de=20bug=20-=20maj=20de=20l'ord?= =?UTF-8?q?re=20lors=20de=20l'ajout=20d'=C3=A9nigme=20et=20lors=20de=20la?= =?UTF-8?q?=20suppression?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WEB/Model/AdminModel.php | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/WEB/Model/AdminModel.php b/WEB/Model/AdminModel.php index 7190f825..5c696a1a 100644 --- a/WEB/Model/AdminModel.php +++ b/WEB/Model/AdminModel.php @@ -16,7 +16,7 @@ class AdminModel public function addNewEnigmeSolo(string $nom,string $enonce,string $aide,string $rappel,string $exemple,string $test,string $solution, string $prompt) : Enigme { - $last = $this->enigme_gateway->findLastEnigma(); + $last = $this->enigme_gateway->findLastEnigmaByOrdre(); if ($last != null){ $ordre = $last[0]->getOrdre() + 1; } else { @@ -44,11 +44,32 @@ async function submit(){ return $tabEnigme[0]; } + private function majOrdreAfterDelete(int $ordre){ + $lesEnigmes = $this->enigme_gateway->findSoloEnigma(); + if ($lesEnigmes == null) { + return; + } + $lastOrdre = $this->enigme_gateway->findLastEnigmaByOrdre()[0]->getOrdre(); + if ($ordre > $lastOrdre) { + return; + } + foreach ($lesEnigmes as $enigme) { + if ($enigme->getOrdre() <= $ordre) { + continue; + } + $enigme->setOrdre($enigme->getOrdre()-1); + $this->enigme_gateway->update($enigme); + } + } + public function deleteEnigme(int $id) : void { - $nom = $this->enigme_gateway->findById($id)[0]->getNom(); + $enigme = $this->enigme_gateway->findById($id)[0]; + $nom = $enigme->getNom(); + $ordre = $enigme->getOrdre(); $this->enigme_gateway->delete($id); unlink('View/src/JS/'.$nom.'.js'); + $this->majOrdreAfterDelete($ordre); } public function getEnigmesSolo() : array From 5760fe35bac4f71023fca28d1cd2d3f9cbb3072f Mon Sep 17 00:00:00 2001 From: nathan boileau Date: Wed, 4 Jan 2023 13:31:37 +0100 Subject: [PATCH 2/4] =?UTF-8?q?arrow=20sur=20pr=C3=A9sentation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WEB/View/src/CSS/Presentation.css | 74 +++++++++++++++++++++++++--- WEB/View/src/pages/Presentation.html | 12 +++-- 2 files changed, 75 insertions(+), 11 deletions(-) diff --git a/WEB/View/src/CSS/Presentation.css b/WEB/View/src/CSS/Presentation.css index 4e766223..d4264307 100644 --- a/WEB/View/src/CSS/Presentation.css +++ b/WEB/View/src/CSS/Presentation.css @@ -9,12 +9,14 @@ src: url("../../assets/fonts/Equinox.otf"); } /* End Fonts CSS */ +html { + scroll-behavior: smooth; +} body { min-height: 100vh; font-family: "Equinox", sans-serif; color: white; - scroll-behavior: smooth; height: 100vh; background-position: center center; background-attachment: fixed; @@ -33,16 +35,15 @@ nav { .moving-fox { position: relative; - top : 0; + top: 0; z-index: -1; opacity: 0; } - /* Section Histoire */ -section{ - min-height: 70vh; +section { + min-height: 60vh; margin-bottom: 10px; } @@ -68,4 +69,65 @@ section{ p { font-family: "Fauna", sans-serif; font-size: 20px; -} \ No newline at end of file +} + +/* Scroll down arrow */ + +.scroll-down { + position: absolute; + bottom: 15px; + left: 50%; + margin-left: -16px; + display: block; + width: 40px; + height: 40px; + border: 2px solid #fff; + background-size: 14px auto; + border-radius: 50%; + z-index: 2; + -webkit-animation: bounce 2s infinite 2s; + animation: bounce 2s infinite 2s; + -webkit-transition: all 0.2s ease-in; + transition: all 0.2s ease-in; +} + +.scroll-down:before { + position: absolute; + top: calc(50% - 8px); + left: calc(50% - 6px); + transform: rotate(-45deg); + display: block; + width: 12px; + height: 12px; + content: ""; + border: 2px solid white; + border-width: 0px 0 2px 2px; +} + +@keyframes bounce { + 0%, + 100%, + 20%, + 50%, + 80% { + transform: translateY(0); + -webkit-transform: translateY(0); + -ms-transform: translateY(0); + -moz-transform: translateY(0); + -o-transform: translateY(0); + } + 40% { + transform: translateY(-10px); + -webkit-transform: translateY(-10px); + -ms-transform: translateY(-10px); + -moz-transform: translateY(-10px); + -o-transform: translateY(-10px); + } + 60% { + transform: translateY(-5px); + -webkit-transform: translateY(-5px); + -ms-transform: translateY(-5px); + -moz-transform: translateY(-5px); + -o-transform: translateY(-5px); + } +} diff --git a/WEB/View/src/pages/Presentation.html b/WEB/View/src/pages/Presentation.html index 9bb92861..c85a56fc 100644 --- a/WEB/View/src/pages/Presentation.html +++ b/WEB/View/src/pages/Presentation.html @@ -10,7 +10,7 @@ integrity="sha384-r4NyP46KrjDleawBgD5tp8Y7UzmLA05oM1iAEQ17CSuDqnUK2+k9luXQOfXJCJ4I" crossorigin="anonymous" /> - + - + + - + + -
+
@@ -89,7 +91,7 @@
Logo Date: Wed, 4 Jan 2023 13:34:36 +0100 Subject: [PATCH 4/4] =?UTF-8?q?link=20pr=C3=A9sentation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WEB/View/src/pages/Presentation.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/WEB/View/src/pages/Presentation.html b/WEB/View/src/pages/Presentation.html index c85a56fc..560a9daa 100644 --- a/WEB/View/src/pages/Presentation.html +++ b/WEB/View/src/pages/Presentation.html @@ -10,7 +10,7 @@ integrity="sha384-r4NyP46KrjDleawBgD5tp8Y7UzmLA05oM1iAEQ17CSuDqnUK2+k9luXQOfXJCJ4I" crossorigin="anonymous" /> - + - + - +
@@ -91,7 +91,7 @@