diff --git a/resources/js/views/Games/HangMan/Hangman.vue b/resources/js/views/Games/HangMan/Hangman.vue
index 01bef92..1a19a4f 100644
--- a/resources/js/views/Games/HangMan/Hangman.vue
+++ b/resources/js/views/Games/HangMan/Hangman.vue
@@ -2,6 +2,11 @@
Pendu
Trouve le mot du pendu - Saisi les lettres
+
@@ -48,7 +52,7 @@
name: "Hangman",
data: function () {
return {
- words: json['fruits'],
+ dictionary: json,
letterBox: '',
figureParts: [],
correctLetters: [],
@@ -62,14 +66,16 @@
}
},
mounted() {
- this.selectedWord = this.words[Math.floor(Math.random() * this.words.length)].toLowerCase()
this.figureParts = this.$el.querySelectorAll('.figure-part')
- this.displayWord()
window.addEventListener('keyup', this.keyMessage)
},
methods: {
+ selectWord(e) {
+ this.selectedWord = this.dictionary[e.target.textContent][Math.floor(Math.random() * this.dictionary[e.target.textContent].length)].toLowerCase()
+ this.displayWord()
+ this.popup = false
+ },
keyMessage(e) {
- console.log(event.key, event.keyCode)
if(e.keyCode >= 65 && e.keyCode <= 90) {
const letter = e.key
@@ -105,14 +111,13 @@
const innerWord = this.wordEl.replace(/
|<\/span>/g, '');
- console.log('win', innerWord, this.selectedWord)
if(innerWord === this.selectedWord) {
this.finalMessage = 'Gagné! 😃';
this.popup = true
+ this.newGame()
}
},
updateWrongLettersEl() {
- console.log('wrong', this.wrongLettersEl)
this.wrongLettersEl =
!this.wrongLetters ? 'Wrong
' : ''
+
@@ -133,16 +138,15 @@
if(this.wrongLetters.length === this.figureParts.length) {
this.finalMessage = 'Perdu. 😕';
this.popup = true
+ this.newGame()
}
},
- playAgain: function () {
+ newGame: function () {
+ this.popup = true
this.correctLetters.splice(0);
this.wrongLetters.splice(0);
- this.selectedWord = this.words[Math.floor(Math.random() * this.words.length)].toLowerCase();
- this.displayWord();
- this.updateWrongLettersEl();
- this.popup = false
this.letterBox = ''
+ this.selectedWord = ''
},
showNotification(){
this.notification = true
diff --git a/resources/js/views/Games/HangMan/HangmanIndex.vue b/resources/js/views/Games/HangMan/HangmanIndex.vue
index 73ee6d1..c8ea201 100644
--- a/resources/js/views/Games/HangMan/HangmanIndex.vue
+++ b/resources/js/views/Games/HangMan/HangmanIndex.vue
@@ -1,5 +1,5 @@
-
+
Pendu
@@ -8,6 +8,11 @@
diff --git a/resources/js/views/Games/HangMan/dict.json b/resources/js/views/Games/HangMan/dict.json
index 9ffa960..de03c24 100644
--- a/resources/js/views/Games/HangMan/dict.json
+++ b/resources/js/views/Games/HangMan/dict.json
@@ -1,6 +1,9 @@
{
- "fruits" : [
+ "Fruits" : [
"banane", "abricot", "pamplemousse", "clementine", "airelle", "amande", "ananas", "avocat", "cassis", "cedrat", "cerise", "chataigne", "citron", "coing", "figue", "fraise", "framboise", "grenade", "groseille", "kiwi", "litchi", "mandarine", "mangue", "marron", "melon", "merise", "mirabelle", "myrtille", "nectarine", "noissette", "noix", "olive", "orange", "pasteque", "peche", "pistache", "poire", "pomelo", "pomme", "prune", "pruneau", "raisin", "tomate", "vanille"
+ ],
+ "Légumes" : [
+ "ail", "amarante", "arachide", "artichaud", "asperge", "aubergine", "basilic", "betterave", "blette", "brocoli", "carotte", "chou", "ciboulette", "concombre", "courge", "courgette", "citrouille", "cresson", "echalote", "endive", "epinard", "fenouil", "flageolet", "gingembre", "haricot", "igname", "jacque", "laitue", "lentille", "marron", "navet", "oignon", "ortie", "oseille", "panais", "patisson", "persil", "piment", "pissenlit", "poireaux", "poivron", "potiron", "potimarron", "radis", "roquette", "scorsonere", "soja", "tomate"
]
}
diff --git a/resources/js/views/Memo/MemoCreate.vue b/resources/js/views/Memo/MemoCreate.vue
index 45506a6..7c0a74f 100755
--- a/resources/js/views/Memo/MemoCreate.vue
+++ b/resources/js/views/Memo/MemoCreate.vue
@@ -46,7 +46,3 @@
}
}
-
-
diff --git a/resources/js/views/User/UserAdmin.vue b/resources/js/views/User/UserAdmin.vue
index 1be31d5..19a2110 100644
--- a/resources/js/views/User/UserAdmin.vue
+++ b/resources/js/views/User/UserAdmin.vue
@@ -14,9 +14,11 @@
@@ -73,22 +75,16 @@
},
methods: {
addMember: function () {
- if(this.form.name.length >= 4 && this.form.email.length >= 12) {
- axios.post('/api/users', {name: this.form.name, email: this.form.email})
- .then(res => {
- this.form.name = ''
- this.form.email = ''
- this.alertType = 'success'
- this.alertMessage = `${res.data.data.attributes.name} a bien été créé`
- })
- .catch(errors => {
- this.alertType = 'error'
- this.alertMessage = 'L\'utilisateur n\'a pas été créé'
- })
- } else {
- this.alertType = 'error'
- this.alertMessage = 'Le formulaire n\'est pas correctement renseigné.'
- }
+ axios.post('/api/users', {name: this.form.name, email: this.form.email})
+ .then(res => {
+ this.form.name = ''
+ this.form.email = ''
+ this.alertType = 'success'
+ this.alertMessage = `${res.data.data.attributes.name} a bien été créé`
+ })
+ .catch(errors => {
+ this.errors = errors.response.data.errors
+ })
}
}
}
diff --git a/resources/sass/pages/games.scss b/resources/sass/pages/games.scss
index 9cdd756..b332110 100644
--- a/resources/sass/pages/games.scss
+++ b/resources/sass/pages/games.scss
@@ -1,20 +1,5 @@
-.game-index {
- display: flex;
- flex-wrap: wrap;
- margin-top: 3rem;
-}
-.game-index-item {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- width: 18rem;
- height: 18rem;
- background-color: $light;
- text-decoration: none;
+.card {
+
- &:hover {
- text-decoration: underline;
- }
}
diff --git a/resources/sass/pages/games/hangman.scss b/resources/sass/pages/games/hangman.scss
index d2f2d08..e51b322 100644
--- a/resources/sass/pages/games/hangman.scss
+++ b/resources/sass/pages/games/hangman.scss
@@ -11,6 +11,10 @@
justify-content: space-between;
}
+.dic-select {
+ min-height: 6rem;
+}
+
.figure-container {
fill: transparent;
stroke: $mediumDark;
diff --git a/resources/sass/setup/_containers.scss b/resources/sass/setup/_containers.scss
index 2e2ae67..709f93c 100644
--- a/resources/sass/setup/_containers.scss
+++ b/resources/sass/setup/_containers.scss
@@ -14,6 +14,11 @@
text-decoration: none;
flex-direction: column;
justify-content: space-between;
+
+ img,
+ svg {
+ max-height: 15rem;
+ }
}
@@ -34,3 +39,10 @@
}
}
+
+@media (max-width: 500px) {
+ .container-cards-list {
+ grid-template-columns: repeat(1, 1fr);
+
+ }
+}