Merge branch 'master' into 'production'

Master

See merge request Romulus21/portal!17
This commit is contained in:
Romain Delanoë
2020-04-05 05:58:35 +00:00
3 changed files with 13 additions and 13 deletions

View File

@@ -27,10 +27,10 @@
<div class="word" v-html="wordEl"></div>
</div>
<div v-if="notification" class="notification-container" id="notification-container">
<div v-if="notification" class="notification-container">
<p>Vous avez déjà saisie cette lettre.</p>
</div>
<div v-if="popup" class="popup-container" id="popup-container">
<div v-if="popup" class="popup-container">
<div class="popup">
<h2>{{ finalMessage }}</h2>
<button id="play-button" @click="playAgain">Rejouer</button>
@@ -38,19 +38,17 @@
</div>
</div>
</div>
<div class="game-input">
<label for="saisie" class="pb-1">Saisir vos lettres ici</label>
<input v-model="letterBox" id="saisie" type="text" @keyup="keyMessage">
</div>
</div>
</template>
<script>
import json from './dict.json'
export default {
name: "Hangman",
data: function () {
return {
words: ['pimprenelle', 'culcul', 'milo', 'Prout'],
words: json['fruits'],
letterBox: '',
figureParts: [],
correctLetters: [],
@@ -67,6 +65,7 @@
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: {
keyMessage(e) {

View File

@@ -0,0 +1,7 @@
{
"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"
]
}

View File

@@ -60,12 +60,6 @@
}
}
.game-input {
max-width: 30rem;
margin: 0 auto;
text-align: center;
}
.popup-container {
position: absolute;
width: calc(100% - 6rem);