diff --git a/src/js/main.js b/src/js/main.js index 194a29a..9dd60d9 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -10,7 +10,7 @@ function replaceAt(string, index, replace, length) { function initGame() { getRandomDefinition(); - + createGrid(10, 10); } function createGrid(li, col) { @@ -28,6 +28,40 @@ function createGrid(li, col) { fillGrid(); } +function displayLetter(letter) { + var word_data = game.grille_en_cours; + var cell_to_display = [] + + for (var i=0; i" + word_data[i].mot[j] + "" + + } +} + function fillGrid() { var selected_grid_id = 0; game.grille_en_cours = []; @@ -40,8 +74,8 @@ function fillGrid() { var y = word_data.y; var orientation = word_data.orientation; var id = word_data.id; + game.grille_en_cours[i].visibilite = "" - if (orientation == "h") { var number_cell = document.getElementById(`cell_${y+1}_${x}`); number_cell.innerHTML = id; @@ -52,7 +86,6 @@ function fillGrid() { number_cell.className = "number_cell"; } - console.log(word, word.length) for (var j=0; j" + word[j] + "" + // cell.className = "open_cell" + // cell.innerHTML = "" + word[j] + "" // AFFICHAGE HASARD LETTRE: A CHANGER // if (Math.random() + .5 >> 0) { @@ -74,7 +107,12 @@ function fillGrid() { // cell.className = "open_cell"; // cell.innerHTML = "" + word[j] + ""; // } - } + + //AJOUT ATTRIBUT VISIBILITE LETTRE + game.grille_en_cours[i].visibilite += "0"; + } + + console.log(word, game.grille_en_cours[i].visibilite, x, y, orientation) } } diff --git a/src/style/main.css b/src/style/main.css index b1706e7..1ceacfe 100644 --- a/src/style/main.css +++ b/src/style/main.css @@ -49,22 +49,21 @@ body { #definition_question { padding: 3vh 1vw; - z-index: 2; } #definition_reponse { display: flex; background-color: var(--accent_1); - border-radius: 0 0 1vh 1vh; + border-radius: 1vh 1vh; justify-content: center; width: min-content; padding: 1vh; - margin-top: -1vh; + margin-top: 1vh; color: white; font-size: x-large; align-items: center; animation: .5s displayDefinitionAnswer; - z-index: 1; + z-index: -1; } div#definition_reponse.hided, #definition.hided div#definition_reponse { transform: translateY(-10vh); @@ -131,12 +130,10 @@ div#actions { #definition.hided #definition_question { animation: .5s hideDefinition; - z-index: 2; } #definition.hided #definition_placeholder { animation: .75s hideDefinition; - /* z-index: 0; */ } @keyframes hideDefinition { @@ -161,7 +158,6 @@ div#actions { #definition.displayed #definition_question { animation: .5s displayDefinition; - z-index: 2; } #definition.displayed #definition_placeholder {