diff --git a/config/config.php b/config/config.php index f397fb7..6124e81 100644 --- a/config/config.php +++ b/config/config.php @@ -12,13 +12,13 @@ $base = ''; $login = ''; $mdp = ''; - $racine='/~kemondejar/WF-Website'; // /~kekentin/WF/WF-Website /~lebeaulato/WF-Website /~kemondejar/WF-Website //$racine='/WF-Website'; $repImg='/home/UCA/kemondejar/public_html/WF-Website/public/images/'; //$repImg='/'; + //Vues $vues['erreur'] = 'vue/erreur.php'; $vues['accueil'] = 'vue/accueil.php'; @@ -33,6 +33,8 @@ $vues['quiz'] = 'vue/quiz.php'; $vues['endQuiz'] = 'vue/endQuiz.php'; $vues['submitQuote'] = 'vue/submitQuote.php'; $vues['recap'] = 'vue/recap.php'; +$vues['accueilQuiz'] = 'vue/accueilQuiz.php'; + //Style css diff --git a/images/WIKIFANTASY.png b/images/WIKIFANTASY.png index 2dffdee..719e2e8 100644 Binary files a/images/WIKIFANTASY.png and b/images/WIKIFANTASY.png differ diff --git a/images/background.avif b/images/background.avif new file mode 100644 index 0000000..3350f94 Binary files /dev/null and b/images/background.avif differ diff --git a/public/images/background.avif b/public/images/background.avif new file mode 100644 index 0000000..3350f94 Binary files /dev/null and b/public/images/background.avif differ diff --git a/public/styles/style.css b/public/styles/style.css index 76d9ab8..9732f66 100644 --- a/public/styles/style.css +++ b/public/styles/style.css @@ -6,15 +6,12 @@ --main-dark-gradient : linear-gradient(45deg, #4a148c, #7b1fa2); --main-dark-other-color : #000000; - --main-light-background-color: #cccccc; - /*--main-light-background-color: #ffffff;*/ - --main-light-text-color : #000; - --main-light-gradient : linear-gradient(90deg, #46BE73, #BAEBF6); - /*--main-light-gradient : linear-gradient(-90deg, #f3e0f7, #dd9aff);*/ - /*--main-light-gradient : linear-gradient(45deg, #73CFF6, #DE95CA);*/ + --main-light-background-color: #ffffff; + --main-light-text-color : #000000; + /*--main-light-gradient : linear-gradient(90deg, #46BE73, #BAEBF6);*/ + /*--main-light-gradient : linear-gradient(90deg, #AAB9CF, #BDD4E7);*/ + --main-light-gradient : #84e4a9; --main-light-other-color : #46BE73; - /*--main-light-other-color : #f8eaff;*/ - /*--main-light-other-color : #d2d2d8;*/ } /* Général */ @@ -62,7 +59,7 @@ body.dark-mode .header{ /* Light mode */ body.light-mode{ - background-color: var(--main-light-background-color); + background-image: url("../images/background.avif"); color: var(--main-light-text-color); } @@ -96,7 +93,7 @@ body.light-mode .header img{ } .light-mode .theme-icon:hover, .light-mode .nav a:hover { - filter: brightness(0) saturate(100%) invert(84%) sepia(88%) saturate(6613%) hue-rotate(276deg) brightness(89%) contrast(95%); + filter: brightness(0) saturate(100%) invert(100%) sepia(0%) saturate(0%) hue-rotate(271deg) brightness(103%) contrast(101%); } /* écran par défaut */ diff --git a/public/styles/styleAccueilQuiz.css b/public/styles/styleAccueilQuiz.css new file mode 100644 index 0000000..e25d58e --- /dev/null +++ b/public/styles/styleAccueilQuiz.css @@ -0,0 +1,42 @@ +@import url(./style.css); /* Import de style.css */ + +h2{ + text-align: center; + font-size: 2em; + margin-top: 2em; + margin-bottom: 2em; +} + +.quizCard { + background: var(--main-dark-gradient); + border-radius: 15px; + padding: 1em; + display: flex; + flex-direction: column; + align-items: center; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); +} + +.quizCard img { + border-radius: 15px 15px 0 0; + width: 100%; + height: auto; +} + +.quizCard h3 { + margin: 1em 0 0; + font-size: 1.5em; + text-align: center; +} + +.quizCard ul { + display: flex; + justify-content: center; + list-style: none; + padding: 0; + margin: 1em 0 0; +} + +.quizCard ul li { + margin: 0 0.5em; +} \ No newline at end of file diff --git a/public/styles/styleQuoteLittleV1.css b/public/styles/styleQuoteLittleV1.css deleted file mode 100644 index 24c3221..0000000 --- a/public/styles/styleQuoteLittleV1.css +++ /dev/null @@ -1,120 +0,0 @@ -/* Conteneur pour les suggestions en deux colonnes */ -.suggestions-container { - display: flex; - flex-wrap: wrap; - justify-content: space-around; - width: 100%; - margin: 0 auto; -} - - - -a.link-citation { - text-decoration: none; - color: white; - width: 47.5%; - height: 100%; -} - -/* Citations */ -.citation-container { - background: linear-gradient(to right, #4a148c, #7b1fa2); - border-radius: 12px; - color: white; - display: flex; - width: 100%; - align-items: flex-start; - box-sizing: border-box; - padding: 0; - height: 150px; - overflow: hidden; - margin-bottom: 20px; - word-wrap: break-word; /* Permet de couper les mots trop longs */ - word-break: break-word; -} - -/* Fixe la taille pour s'assurer que toutes les citations restent cohérentes */ -.citation-container .text-content { - flex-grow: 1; - display: flex; - flex-direction: column; - justify-content: center; - height: 150px; -} - -.quote { - padding: 0; - overflow: hidden; -} - -.citation-image { - width: 150px; - height: 100%; - object-fit: cover; - margin: 0; - border-radius: 0; -} - -.text-content { - flex: 1; - padding: 10px; - display: flex; - flex-direction: column; - justify-content: center; /* Centre verticalement le texte */ - word-wrap: break-word; /* Permet de couper les mots trop longs */ - word-break: break-word; -} - -.quoteContent { - font-size: 1.2em; - margin-bottom: 10px; - font-style: italic; -} - - - -.citation .movie, .character, .year { - margin-bottom: 5px; -} - -/* Mode sombre */ -body.dark-mode .quote { - background: linear-gradient(45deg, #4a148c, #7b1fa2); - color:white; -} - -/* Mode clair */ -body.light-mode .quote { - background-image: linear-gradient(-28deg, #f3e7e9 0%, #e3eeff 99%, #e3eeff 100%); - color:black; /* Changer le texte en noir pour le mode clair */ -} - -body.light-mode .citation, -body.light-mode .movie, -body.light-mode .character, -body.light-mode .year { - color: black; /* Forcer le texte en noir pour le mode clair */ -} - -/* Responsive design */ -@media (max-width: 768px) { - .suggestions-container { - flex-direction: column; - width: 100%; - } - - .citation-container { - width: 100%; /* Chaque citation prend toute la largeur sur mobile */ - max-width: 100%; - height: 100px; /* Supprimer la hauteur fixe sur mobile */ - } - - .citation-image { - width: 100px; - height: 100px; - } - - .quote { - font-size: 1em; - } -} diff --git a/public/styles/styleV1.css b/public/styles/styleV1.css deleted file mode 100644 index 9276d19..0000000 --- a/public/styles/styleV1.css +++ /dev/null @@ -1,108 +0,0 @@ -/* header.css */ - -/* Styles généraux */ -* { - margin: 0; - padding: 0; - box-sizing: border-box; -} - -body { - background-color: #120b1d; - font-family: "Lemon", serif; - margin-top: 200px; -} - -/* Header */ -.header { - display: flex; - position: fixed; - background-color: #000000; - right: 0; - top: 0; - width: 100%; - text-align: center; - padding: 20px; -} - -.nav { - display: flex; - align-items: center; - vertical-align: center; - gap: 30px; - width: 40%; -} - -.logo { - display: flex; - align-items: center; - justify-content: center; - width: 20%; -} - -.user { - display: flex; - flex-direction: row; - justify-content: flex-end; - align-items: center; - vertical-align: center; - gap: 30px; - width: 40%; -} - -.search { - display: flex; - flex-direction: row; - justify-content: center; - align-items: center; - vertical-align: center; - margin: 10px; - width: 70px; - height: 70px; - border-radius: 50%; -} - - -/* Mode sombre */ -body.dark-mode { - background-color: #120B1D; - color: #ffffff; -} - -body.dark-mode .header { - background-color: #000; -} - -body.dark-mode .header img { - filter: invert(0%); -} - -body.dark-mode .nav img:hover { - filter: invert(59%) sepia(96%) saturate(6733%) hue-rotate(275deg) brightness(112%) contrast(122%); -} - -body.dark-mode .search { - background: white; -} - -/* Mode clair */ -body.light-mode { - background-color: #ffffff; - color: #000000; -} - -body.light-mode .header { - background-color: #F4F1DE; -} - -body.light-mode .header img { - filter: invert(100%); -} - -body.light-mode .nav img:hover { - filter: invert(22%) sepia(6%) saturate(2269%) hue-rotate(193deg) brightness(98%) contrast(106%); -} - -body.light-mode .search { - background: black; -} diff --git a/src/Controleur/FrontControler.php b/src/Controleur/FrontControler.php index b5c6637..ad40e9e 100644 --- a/src/Controleur/FrontControler.php +++ b/src/Controleur/FrontControler.php @@ -16,7 +16,7 @@ Class FrontControler{ global $twig,$racine; $this->listAction = ['visitor' => array('accueil','search','quote','login','signin','validlogin','validsignin'), - 'user' => array('quiz','commentary','logout','addComment','favorite','profil','addFav','supFav','changedata', 'submit', 'validsubmit', 'add'), + 'user' => array('quiz','commentary','logout','addComment','favorite','profil','addFav','supFav','changedata', 'submit', 'validsubmit', 'add', 'accueilQuiz'), 'admin' => array('null')]; $dVueEreur = []; @@ -54,6 +54,7 @@ Class FrontControler{ $router->map('GET|POST', '/submit', 'UserControler', 'submit'); $router->map('GET|POST', '/validsubmit', 'UserControler','validsubmit'); $router->map('GET|POST', '/add', 'UserControler', 'add'); + $router->map('GET|POST', '/accueilQuiz', 'UserControler', 'accueilQuiz'); $match = $router->match(); diff --git a/src/Controleur/UserControler.php b/src/Controleur/UserControler.php index a72dbd7..24a421c 100644 --- a/src/Controleur/UserControler.php +++ b/src/Controleur/UserControler.php @@ -31,8 +31,12 @@ class UserControler { private QuoteModel $qMod; private CharacterModel $caMod; private SourceModel $srcMod; +<<<<<<< HEAD private QuestionModel $questMod; private ImageModel $iMod; +======= + private QuizModel $quizModel; +>>>>>>> 8c848bc67dd41069816daf4d55dbca81ab1d3033 public function __construct() { global $co; @@ -42,7 +46,17 @@ class UserControler { $this -> questMod = new QuestionModel(new QuestionGateway($co)); $this -> caMod = new CharacterModel(new CharacterGateway($co)); $this->srcMod = new SourceModel(new SourceGateway($co)); +<<<<<<< HEAD $this->iMod = new ImageModel(new ImageGateway($co)); +======= + $this->quizModel = new QuizModel(new QuizGateway($co)); + } + + public function accueilQuiz() { + global $vues; + $quizs = $this->quizModel->listQuiz(); + require_once $vues['accueilQuiz']; +>>>>>>> 8c848bc67dd41069816daf4d55dbca81ab1d3033 } public function profil() { @@ -203,6 +217,14 @@ class UserControler { //echo $twig->render('quiz.html.twig', ['question' => $question,'id'=>$idquestion]); } + public function getQuiz(int $id) : QuizModel + { + global $co; + $gw = new QuizGateway($co); + $mdl = new QuizModel($gw); + return $mdl->getQuiz($id); + } + public function getNumberOfQuestion(int $id) : int{ global $co; diff --git a/src/Model/QuizModel.php b/src/Model/QuizModel.php index c38581e..dfa15de 100644 --- a/src/Model/QuizModel.php +++ b/src/Model/QuizModel.php @@ -46,4 +46,15 @@ class QuizModel extends Model{ } + public function listQuiz() : array + { + $q = $this -> gateway -> findAll(); + $quizIds = []; + + foreach ($q as $quiz) { + $quizIds[] = $quiz['id_quiz']; + } + + return $quizIds; + } } \ No newline at end of file diff --git a/vue/accueilQuiz.php b/vue/accueilQuiz.php new file mode 100644 index 0000000..e8de906 --- /dev/null +++ b/vue/accueilQuiz.php @@ -0,0 +1,17 @@ +render('head.html.twig', [ + 'title' => "Quiz", + 'style' => "public/styles/styleAccueilQuiz.css", + 'scripts' => array("public/script/theme-toggle.js") +]); + +echo $twig->render('bandeau.html.twig'); + +echo $twig->render('accueilQuiz.html.twig', [ + 'quiz' => $quizs, + 'titre' => "Quiz" +]); +?> \ No newline at end of file diff --git a/vue/search.php b/vue/search.php index 4338796..22ba842 100644 --- a/vue/search.php +++ b/vue/search.php @@ -3,7 +3,7 @@ global $twig; echo $twig->render('head.html.twig', array( - 'title' => "Quote", + 'title' => "Search", 'style' => "public/styles/styleSearch.css", 'scripts' => array("public/script/theme-toggle.js") )); diff --git a/vue/templates/accueilQuiz.html.twig b/vue/templates/accueilQuiz.html.twig new file mode 100644 index 0000000..b794610 --- /dev/null +++ b/vue/templates/accueilQuiz.html.twig @@ -0,0 +1,19 @@ +

Liste des Quiz

+ + + \ No newline at end of file diff --git a/vue/templates/bandeau.html.twig b/vue/templates/bandeau.html.twig index 72b8f7a..8e1d065 100644 --- a/vue/templates/bandeau.html.twig +++ b/vue/templates/bandeau.html.twig @@ -2,7 +2,7 @@