Correction Solo 3*3

master
yasevret 4 years ago
parent 4c517951a0
commit 5f4c4d770f

@ -17,7 +17,7 @@ var selectionDiemension = 0;
var lesPoints = 0; //Points du Joueur1 var lesPoints = 0; //Points du Joueur1
function majSizeCard(column){ function majSizeCard(column) {
var newTaille = column * 3.2 + 1; var newTaille = column * 3.2 + 1;
document.documentElement.style.setProperty('--taille', newTaille + "vh"); document.documentElement.style.setProperty('--taille', newTaille + "vh");
} }
@ -220,6 +220,7 @@ class Figure {
var unCercle = document.createElement('div'); var unCercle = document.createElement('div');
unCercle.className = "anneau"; unCercle.className = "anneau";
unCercle.style.backgroundColor = "var(--colorbase)"; unCercle.style.backgroundColor = "var(--colorbase)";
if (selectionDiemension == 0) {
if (pos == 0 || pos == 2 || pos == 9 || pos == 11) { if (pos == 0 || pos == 2 || pos == 9 || pos == 11) {
unCercle.style.backgroundColor = "var(--colorone)"; unCercle.style.backgroundColor = "var(--colorone)";
} }
@ -229,6 +230,17 @@ class Figure {
if (pos == 4 || pos == 7) { if (pos == 4 || pos == 7) {
unCercle.style.backgroundColor = "var(--colorthree)"; unCercle.style.backgroundColor = "var(--colorthree)";
} }
} else if (selectionDiemension == 1) {
if (pos == 0 || pos == 2 || pos == 6 || pos == 8) {
unCercle.style.backgroundColor = "var(--colorone)";
}
if (pos == 1 || pos == 7) {
unCercle.style.backgroundColor = "var(--colortwo)";
}
if (pos == 4) {
unCercle.style.backgroundColor = "var(--colorthree)";
}
}
var unRond = document.createElement('div'); var unRond = document.createElement('div');
unRond.className = "rondinterieur inte"; unRond.className = "rondinterieur inte";
@ -249,6 +261,7 @@ class Figure {
unRond.className = "rond"; unRond.className = "rond";
unRond.style.backgroundColor = "var(--colorbase)"; unRond.style.backgroundColor = "var(--colorbase)";
if (selectionDiemension == 0) {
if (pos == 0 || pos == 2 || pos == 9 || pos == 11) { if (pos == 0 || pos == 2 || pos == 9 || pos == 11) {
unRond.style.backgroundColor = "var(--colorone)"; unRond.style.backgroundColor = "var(--colorone)";
} }
@ -258,6 +271,17 @@ class Figure {
if (pos == 4 || pos == 7) { if (pos == 4 || pos == 7) {
unRond.style.backgroundColor = "var(--colorthree)"; unRond.style.backgroundColor = "var(--colorthree)";
} }
} else if (selectionDiemension == 1) {
if (pos == 0 || pos == 2 || pos == 6 || pos == 8) {
unRond.style.backgroundColor = "var(--colorone)";
}
if (pos == 1 || pos == 7) {
unRond.style.backgroundColor = "var(--colortwo)";
}
if (pos == 4) {
unRond.style.backgroundColor = "var(--colorthree)";
}
}
divContainForm.appendChild(unRond); divContainForm.appendChild(unRond);
divcase.appendChild(divContainForm); divcase.appendChild(divContainForm);
this.CodeHTML = divcase; this.CodeHTML = divcase;

Loading…
Cancel
Save