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,14 +220,26 @@ 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 (pos == 0 || pos == 2 || pos == 9 || pos == 11) { if (selectionDiemension == 0) {
unCercle.style.backgroundColor = "var(--colorone)"; if (pos == 0 || pos == 2 || pos == 9 || pos == 11) {
} unCercle.style.backgroundColor = "var(--colorone)";
if (pos == 1 || pos == 10) { }
unCercle.style.backgroundColor = "var(--colortwo)"; if (pos == 1 || pos == 10) {
} unCercle.style.backgroundColor = "var(--colortwo)";
if (pos == 4 || pos == 7) { }
unCercle.style.backgroundColor = "var(--colorthree)"; if (pos == 4 || pos == 7) {
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');
@ -249,14 +261,26 @@ class Figure {
unRond.className = "rond"; unRond.className = "rond";
unRond.style.backgroundColor = "var(--colorbase)"; unRond.style.backgroundColor = "var(--colorbase)";
if (pos == 0 || pos == 2 || pos == 9 || pos == 11) { if (selectionDiemension == 0) {
unRond.style.backgroundColor = "var(--colorone)"; if (pos == 0 || pos == 2 || pos == 9 || pos == 11) {
} unRond.style.backgroundColor = "var(--colorone)";
if (pos == 1 || pos == 10) { }
unRond.style.backgroundColor = "var(--colortwo)"; if (pos == 1 || pos == 10) {
} unRond.style.backgroundColor = "var(--colortwo)";
if (pos == 4 || pos == 7) { }
unRond.style.backgroundColor = "var(--colorthree)"; if (pos == 4 || pos == 7) {
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);

Loading…
Cancel
Save