diff --git a/WEB/Controller/UserController.php b/WEB/Controller/UserController.php index bdb938cd..aeb4e7f0 100644 --- a/WEB/Controller/UserController.php +++ b/WEB/Controller/UserController.php @@ -10,6 +10,7 @@ class UserController global $dsn, $rep, $vues, $error; $model = new UserModel(); $action = $_REQUEST['action']; + //register_event_handler('add_to_queue',array($this,"onAddToQueue")); switch ($action) { case NULL: $model->goToHome(); @@ -60,4 +61,13 @@ class UserController require($rep . $vues['erreur']); } } + public function onAddToQueue(){ + $model=new UserModel; + $model->AddUserToQueueEvent(); + $this->goToMulti(); + } + + /*public function goToMulti(){ + + }*/ } \ No newline at end of file diff --git a/WEB/Model/UserModel.php b/WEB/Model/UserModel.php index fb0c9d1f..f28c8df9 100644 --- a/WEB/Model/UserModel.php +++ b/WEB/Model/UserModel.php @@ -127,15 +127,8 @@ class UserModel } public function addToQueue(){ echo '1'; - $userGroup=$this->utilisateur_gateway->findUsersInQueue(); if($this->utilisateur_gateway->isAlreadyInqueue($_SESSION['utilisateur'])) { - if ($this->utilisateur_gateway->queueFilled()) - { - echo "Partie is launched"; - $this->utilisateur_gateway->launchGame($_SESSION['utilisateur']); - } else - $this->attente(); return; } echo '2'; @@ -156,16 +149,21 @@ class UserModel } echo '8'; $this->utilisateur_gateway->addToQueue($_SESSION['utilisateur'],$partie); - echo '9'; - if ($this->utilisateur_gateway->queueFilled()) + $userGroup=$this->utilisateur_gateway->findUsersInQueue(); + //trigger_event('add_to_queue',$userGroup); + } + +<<<<<<< HEAD + public function AddUserToQueueEvent(){ + $userGroup=$this->utilisateur_gateway->findUsersInQueue(); + if($userGroup.count()>=4) { - echo "Partie is launched"; - trigger_event('queue_filled',$user_group,$partie,$user_group); - $this->utilisateur_gateway->launchGame($_SESSION['utilisateur']); + $this->utilisateur_gateway->launchGame(); } - $this->attente(); } +======= +>>>>>>> 146a4b62fc5bc2340e9c08c07650a6efb799c3fb public function logout() { $_SESSION['role'] = 'visitor'; diff --git a/WEB/View/assets/img/ImgMain.png b/WEB/View/assets/img/ImgMain.png index b2adc342..6040317c 100644 Binary files a/WEB/View/assets/img/ImgMain.png and b/WEB/View/assets/img/ImgMain.png differ diff --git a/WEB/View/assets/img/SecondMainBack.jpg b/WEB/View/assets/img/SecondMainBack.jpg new file mode 100644 index 00000000..4b86ffd0 Binary files /dev/null and b/WEB/View/assets/img/SecondMainBack.jpg differ diff --git a/WEB/View/src/CSS/Enigme.css b/WEB/View/src/CSS/Enigme.css index 785e2d67..37305c82 100644 --- a/WEB/View/src/CSS/Enigme.css +++ b/WEB/View/src/CSS/Enigme.css @@ -13,10 +13,6 @@ body { color: white; scroll-behavior: smooth; height: 100vh; - background-position: center center; - background-attachment: fixed; - background-repeat: no-repeat; - background-size: cover; background-color: #050E15; } diff --git a/WEB/View/src/CSS/Main2.css b/WEB/View/src/CSS/Main2.css index 6a4b6bb9..35128d6c 100644 --- a/WEB/View/src/CSS/Main2.css +++ b/WEB/View/src/CSS/Main2.css @@ -4,19 +4,26 @@ color: white; scroll-behavior: smooth; height: 100vh; - background-image: radial-gradient( - circle, - #312c42, - #2e2a3d, - #2a2738, - #272434, - #24222f, - #22202c, - #1f1f29, - #1d1d26, - #1b1b23, - #191a21, - #17181e, - #15161c - ); + background-image: url("../../assets/img/ImgMain.png"); + background-position: center center; + background-attachment: fixed; + background-repeat: no-repeat; + background-size: cover; + background-color: #000; +} + +#imgMain { + background-image: url("../../assets/img/SecondMainBack.jpg"); + background-position: center center; + background-attachment: fixed; + background-repeat: no-repeat; + background-size: cover; + display: block; + margin: auto; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 85%; + height: 70%; } diff --git a/WEB/View/src/JS/base.js b/WEB/View/src/JS/base.js index 31dde7b0..7a4b795b 100644 --- a/WEB/View/src/JS/base.js +++ b/WEB/View/src/JS/base.js @@ -112,7 +112,7 @@ function check() { /** - * It gets all the elements with the class name "help" and sets their display property to "flex". + * It gets all the elements with the class name "help" and sets their display property to "block". */ function displayHelp() { var help = document.getElementsByClassName("help"); diff --git a/WEB/View/src/pages/Main2.html b/WEB/View/src/pages/Main2.html index c569c41f..90dd9b5d 100644 --- a/WEB/View/src/pages/Main2.html +++ b/WEB/View/src/pages/Main2.html @@ -23,8 +23,10 @@ -
- +
+
+ +
diff --git a/package-lock.json b/package-lock.json index 4603894c..1a07e498 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,8 @@ "": { "dependencies": { "bootstrap": "^5.2.2", - "bootstrap-icons": "^1.10.2" + "bootstrap-icons": "^1.10.2", + "events": "^3.3.0" } }, "node_modules/@popperjs/core": { @@ -41,6 +42,14 @@ "version": "1.10.2", "resolved": "https://registry.npmjs.org/bootstrap-icons/-/bootstrap-icons-1.10.2.tgz", "integrity": "sha512-PTPYadRn1AMGr+QTSxe4ZCc+Wzv9DGZxbi3lNse/dajqV31n2/wl/7NX78ZpkvFgRNmH4ogdIQPQmxAfhEV6nA==" + }, + "node_modules/events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "engines": { + "node": ">=0.8.x" + } } }, "dependencies": { @@ -60,6 +69,11 @@ "version": "1.10.2", "resolved": "https://registry.npmjs.org/bootstrap-icons/-/bootstrap-icons-1.10.2.tgz", "integrity": "sha512-PTPYadRn1AMGr+QTSxe4ZCc+Wzv9DGZxbi3lNse/dajqV31n2/wl/7NX78ZpkvFgRNmH4ogdIQPQmxAfhEV6nA==" + }, + "events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==" } } } diff --git a/package.json b/package.json index 0091e3c1..9cbb0c94 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { "dependencies": { "bootstrap": "^5.2.2", - "bootstrap-icons": "^1.10.2" + "bootstrap-icons": "^1.10.2", + "events": "^3.3.0" } }