|
|
@ -1,10 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
function openModal(modalId) {
|
|
|
|
function openModal(modalId) {
|
|
|
|
var modal = document.getElementById(modalId);
|
|
|
|
var modal = document.getElementById(modalId);
|
|
|
|
modal.style.display = "block";
|
|
|
|
modal.style.display = "block";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function closeModal(modal) {
|
|
|
|
function closeModal(modal) {
|
|
|
|
var modal = document.getElementById(modal);
|
|
|
|
var modal = document.getElementById(modal);
|
|
|
|
modal.style.display = "none";
|
|
|
|
modal.style.display = "none";
|
|
|
@ -13,8 +13,7 @@ function closeModal(modal) {
|
|
|
|
function showBarTimer(checkbox) {
|
|
|
|
function showBarTimer(checkbox) {
|
|
|
|
if (checkbox.checked == true) {
|
|
|
|
if (checkbox.checked == true) {
|
|
|
|
document.getElementById("progress_bar").style.display = 'block';
|
|
|
|
document.getElementById("progress_bar").style.display = 'block';
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
else {
|
|
|
|
|
|
|
|
document.getElementById("progress_bar").style.display = 'none';
|
|
|
|
document.getElementById("progress_bar").style.display = 'none';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -23,8 +22,7 @@ function darkMode() {
|
|
|
|
var checkbox = document.getElementById("darkcheck");
|
|
|
|
var checkbox = document.getElementById("darkcheck");
|
|
|
|
if (checkbox.checked == true) {
|
|
|
|
if (checkbox.checked == true) {
|
|
|
|
setColor("black");
|
|
|
|
setColor("black");
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
else {
|
|
|
|
|
|
|
|
setColor("white");
|
|
|
|
setColor("white");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -32,8 +30,7 @@ function darkMode() {
|
|
|
|
function symbole(checkbox) {
|
|
|
|
function symbole(checkbox) {
|
|
|
|
if (checkbox.checked == true) {
|
|
|
|
if (checkbox.checked == true) {
|
|
|
|
pathImg = "img/sym/";
|
|
|
|
pathImg = "img/sym/";
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
else {
|
|
|
|
|
|
|
|
pathImg = "img/txt_en/";
|
|
|
|
pathImg = "img/txt_en/";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
saveStage();
|
|
|
|
saveStage();
|
|
|
@ -45,8 +42,7 @@ function dysFont() {
|
|
|
|
var font;
|
|
|
|
var font;
|
|
|
|
if (checkbox.checked == true) {
|
|
|
|
if (checkbox.checked == true) {
|
|
|
|
font = "dys";
|
|
|
|
font = "dys";
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
else {
|
|
|
|
|
|
|
|
font = "main";
|
|
|
|
font = "main";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
textToChange.forEach(function (item) {
|
|
|
|
textToChange.forEach(function (item) {
|
|
|
@ -135,8 +131,7 @@ function setLang(newLang) {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
document.querySelector(".img_france").style.opacity = 1;
|
|
|
|
document.querySelector(".img_france").style.opacity = 1;
|
|
|
|
document.querySelector(".img_usa").style.opacity = 0.2;
|
|
|
|
document.querySelector(".img_usa").style.opacity = 0.2;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
else {
|
|
|
|
|
|
|
|
textToChange.forEach(function (item) {
|
|
|
|
textToChange.forEach(function (item) {
|
|
|
|
let currText = item.id;
|
|
|
|
let currText = item.id;
|
|
|
|
document.getElementById(currText).innerHTML = lang.en[currText];
|
|
|
|
document.getElementById(currText).innerHTML = lang.en[currText];
|
|
|
@ -145,6 +140,7 @@ function setLang(newLang) {
|
|
|
|
document.querySelector(".img_usa").style.opacity = 1;
|
|
|
|
document.querySelector(".img_usa").style.opacity = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function calculNombreSwitch() {
|
|
|
|
function calculNombreSwitch() {
|
|
|
|
var entrelibre = 0;
|
|
|
|
var entrelibre = 0;
|
|
|
|
logiques.forEach(function (element) {
|
|
|
|
logiques.forEach(function (element) {
|
|
|
@ -158,6 +154,7 @@ function calculNombreSwitch() {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
numberOfSwitch = entrelibre;
|
|
|
|
numberOfSwitch = entrelibre;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function whatIsElement(element) {
|
|
|
|
function whatIsElement(element) {
|
|
|
|
if (findLogique(element.name) == null || findLogique(element.name) == undefined) {
|
|
|
|
if (findLogique(element.name) == null || findLogique(element.name) == undefined) {
|
|
|
|
return "switch";
|
|
|
|
return "switch";
|
|
|
@ -192,14 +189,17 @@ function changeLineColor(idLine) {
|
|
|
|
var colorline = line.stroke() == colorLineActive ? colorLineInnactive : colorLineActive;
|
|
|
|
var colorline = line.stroke() == colorLineActive ? colorLineInnactive : colorLineActive;
|
|
|
|
line.stroke(colorline);
|
|
|
|
line.stroke(colorline);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function changeLineColorInput(idLine, color) {
|
|
|
|
function changeLineColorInput(idLine, color) {
|
|
|
|
let line = stage.findOne("#" + idLine);
|
|
|
|
let line = stage.findOne("#" + idLine);
|
|
|
|
line.stroke(color);
|
|
|
|
line.stroke(color);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function changeLineColorBlack(idLine) {
|
|
|
|
function changeLineColorBlack(idLine) {
|
|
|
|
let line = stage.findOne("#" + idLine);
|
|
|
|
let line = stage.findOne("#" + idLine);
|
|
|
|
line.stroke(colorLineInnactive);
|
|
|
|
line.stroke(colorLineInnactive);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function changeLineColorYellow(idLine) {
|
|
|
|
function changeLineColorYellow(idLine) {
|
|
|
|
let line = stage.findOne("#" + idLine);
|
|
|
|
let line = stage.findOne("#" + idLine);
|
|
|
|
line.stroke(colorLineActive);
|
|
|
|
line.stroke(colorLineActive);
|
|
|
@ -260,8 +260,7 @@ function checkEntreCroisement(logiqueId) {
|
|
|
|
createLink(logique1, logique);
|
|
|
|
createLink(logique1, logique);
|
|
|
|
createLink(logique2, logique);
|
|
|
|
createLink(logique2, logique);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
} else if (getSwitchFromLine(logique.id1) != null && getLogiqueFromLine(logique.id2) != null) {
|
|
|
|
else if (getSwitchFromLine(logique.id1) != null && getLogiqueFromLine(logique.id2) != null) {
|
|
|
|
|
|
|
|
let logique1 = getLogiqueFromLine(logique.id2);
|
|
|
|
let logique1 = getLogiqueFromLine(logique.id2);
|
|
|
|
let switch1 = getSwitchFromLine(logique.id1).id;
|
|
|
|
let switch1 = getSwitchFromLine(logique.id1).id;
|
|
|
|
removeLine(logique.id1);
|
|
|
|
removeLine(logique.id1);
|
|
|
@ -270,8 +269,7 @@ function checkEntreCroisement(logiqueId) {
|
|
|
|
logique.id2 = null;
|
|
|
|
logique.id2 = null;
|
|
|
|
createLink(logique1, logique);
|
|
|
|
createLink(logique1, logique);
|
|
|
|
createLink(stage.findOne("#" + switch1), logique);
|
|
|
|
createLink(stage.findOne("#" + switch1), logique);
|
|
|
|
}
|
|
|
|
} else if (getLogiqueFromLine(logique.id1) != null && getSwitchFromLine(logique.id2) != null) {
|
|
|
|
else if (getLogiqueFromLine(logique.id1) != null && getSwitchFromLine(logique.id2) != null) {
|
|
|
|
|
|
|
|
let logique1 = getLogiqueFromLine(logique.id1);
|
|
|
|
let logique1 = getLogiqueFromLine(logique.id1);
|
|
|
|
let switch1 = getSwitchFromLine(logique.id2).id;
|
|
|
|
let switch1 = getSwitchFromLine(logique.id2).id;
|
|
|
|
removeLine(logique.id1);
|
|
|
|
removeLine(logique.id1);
|
|
|
@ -280,8 +278,7 @@ function checkEntreCroisement(logiqueId) {
|
|
|
|
logique.id2 = null;
|
|
|
|
logique.id2 = null;
|
|
|
|
createLink(stage.findOne("#" + switch1), logique);
|
|
|
|
createLink(stage.findOne("#" + switch1), logique);
|
|
|
|
createLink(logique1, logique);
|
|
|
|
createLink(logique1, logique);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
else {
|
|
|
|
|
|
|
|
croisement = true;
|
|
|
|
croisement = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -337,8 +334,7 @@ function checkSortieLogique(logiqueId) {
|
|
|
|
element.id3.forEach(function (line) {
|
|
|
|
element.id3.forEach(function (line) {
|
|
|
|
changeLineColorYellow(line);
|
|
|
|
changeLineColorYellow(line);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
else {
|
|
|
|
|
|
|
|
element.id3.forEach(function (line) {
|
|
|
|
element.id3.forEach(function (line) {
|
|
|
|
changeLineColorBlack(line);
|
|
|
|
changeLineColorBlack(line);
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -349,8 +345,7 @@ function checkSortieLogique(logiqueId) {
|
|
|
|
element.id3.forEach(function (line) {
|
|
|
|
element.id3.forEach(function (line) {
|
|
|
|
changeLineColorYellow(line);
|
|
|
|
changeLineColorYellow(line);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
else {
|
|
|
|
|
|
|
|
element.id3.forEach(function (line) {
|
|
|
|
element.id3.forEach(function (line) {
|
|
|
|
changeLineColorBlack(line);
|
|
|
|
changeLineColorBlack(line);
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -361,8 +356,7 @@ function checkSortieLogique(logiqueId) {
|
|
|
|
element.id3.forEach(function (line) {
|
|
|
|
element.id3.forEach(function (line) {
|
|
|
|
changeLineColorYellow(line);
|
|
|
|
changeLineColorYellow(line);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
else {
|
|
|
|
|
|
|
|
element.id3.forEach(function (line) {
|
|
|
|
element.id3.forEach(function (line) {
|
|
|
|
changeLineColorBlack(line);
|
|
|
|
changeLineColorBlack(line);
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -373,8 +367,7 @@ function checkSortieLogique(logiqueId) {
|
|
|
|
element.id3.forEach(function (line) {
|
|
|
|
element.id3.forEach(function (line) {
|
|
|
|
changeLineColorBlack(line);
|
|
|
|
changeLineColorBlack(line);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
else {
|
|
|
|
|
|
|
|
element.id3.forEach(function (line) {
|
|
|
|
element.id3.forEach(function (line) {
|
|
|
|
changeLineColorYellow(line);
|
|
|
|
changeLineColorYellow(line);
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -467,7 +460,9 @@ function checkEnd(mode) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
if (ter && !isTuto) {
|
|
|
|
if (ter && !isTuto) {
|
|
|
|
setTimeout(() => { success(mode); }, 100);
|
|
|
|
setTimeout(() => {
|
|
|
|
|
|
|
|
success(mode);
|
|
|
|
|
|
|
|
}, 100);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -479,7 +474,10 @@ function success(mode) {
|
|
|
|
if (successPanel) {
|
|
|
|
if (successPanel) {
|
|
|
|
openModal("success");
|
|
|
|
openModal("success");
|
|
|
|
document.querySelector("#click_number").innerHTML = click;
|
|
|
|
document.querySelector("#click_number").innerHTML = click;
|
|
|
|
document.querySelector("#next_level_button").onclick = function () { closeModal('success'); nextLevel(mode); }
|
|
|
|
document.querySelector("#next_level_button").onclick = function () {
|
|
|
|
|
|
|
|
closeModal('success');
|
|
|
|
|
|
|
|
nextLevel(mode);
|
|
|
|
|
|
|
|
}
|
|
|
|
var previewStage = new Konva.Stage({
|
|
|
|
var previewStage = new Konva.Stage({
|
|
|
|
container: 'show_stage',
|
|
|
|
container: 'show_stage',
|
|
|
|
width: window.innerWidth / 1.5,
|
|
|
|
width: window.innerWidth / 1.5,
|
|
|
@ -487,11 +485,15 @@ function success(mode) {
|
|
|
|
scaleX: 1 / 1.5,
|
|
|
|
scaleX: 1 / 1.5,
|
|
|
|
scaleY: 1 / 1.5
|
|
|
|
scaleY: 1 / 1.5
|
|
|
|
});
|
|
|
|
});
|
|
|
|
let previewLayer = layer.clone({ hitGraphEnabled: false });
|
|
|
|
let previewLayer = layer.clone({
|
|
|
|
|
|
|
|
hitGraphEnabled: false
|
|
|
|
|
|
|
|
});
|
|
|
|
previewStage.add(previewLayer);
|
|
|
|
previewStage.add(previewLayer);
|
|
|
|
previewLayer.batchDraw();
|
|
|
|
previewLayer.batchDraw();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
setTimeout(() => { nextLevel(mode); }, 1000);
|
|
|
|
setTimeout(() => {
|
|
|
|
|
|
|
|
nextLevel(mode);
|
|
|
|
|
|
|
|
}, 1000);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -526,22 +528,29 @@ function calculNombreSwitch() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function resize() {
|
|
|
|
function resize() {
|
|
|
|
stage.scale({ x: 1, y: 1 });
|
|
|
|
stage.scale({
|
|
|
|
|
|
|
|
x: 1,
|
|
|
|
|
|
|
|
y: 1
|
|
|
|
|
|
|
|
});
|
|
|
|
stage.draw();
|
|
|
|
stage.draw();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function activeSwitchInput(event) {
|
|
|
|
function activeSwitchInput(event) {
|
|
|
|
changeAllSwitchColorActive(event.target.value);
|
|
|
|
changeAllSwitchColorActive(event.target.value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function inactiveSwitchInput(event) {
|
|
|
|
function inactiveSwitchInput(event) {
|
|
|
|
changeAllSwitchColorInActive(event.target.value);
|
|
|
|
changeAllSwitchColorInActive(event.target.value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function activeLineInput(event) {
|
|
|
|
function activeLineInput(event) {
|
|
|
|
changeAllLineColorActive(event.target.value);
|
|
|
|
changeAllLineColorActive(event.target.value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function inactiveLineInput(event) {
|
|
|
|
function inactiveLineInput(event) {
|
|
|
|
changeAllLineColorInActive(event.target.value);
|
|
|
|
changeAllLineColorInActive(event.target.value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function inactiveEndInput(event) {
|
|
|
|
function inactiveEndInput(event) {
|
|
|
|
changeEndColorInActive(event.target.value);
|
|
|
|
changeEndColorInActive(event.target.value);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -562,11 +571,13 @@ function changeAllSwitchColorActive(color) {
|
|
|
|
colorSwitchActiveBackground = color;
|
|
|
|
colorSwitchActiveBackground = color;
|
|
|
|
layer.draw();
|
|
|
|
layer.draw();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function changeEndColorInActive(color) {
|
|
|
|
function changeEndColorInActive(color) {
|
|
|
|
colorEnd = color;
|
|
|
|
colorEnd = color;
|
|
|
|
stage.findOne("#end").fill(color);
|
|
|
|
stage.findOne("#end").fill(color);
|
|
|
|
layer.draw();
|
|
|
|
layer.draw();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function changeAllSwitchColorInActive(color) {
|
|
|
|
function changeAllSwitchColorInActive(color) {
|
|
|
|
switchsInfoCopy.forEach(function (element) {
|
|
|
|
switchsInfoCopy.forEach(function (element) {
|
|
|
|
var switche = stage.findOne("#" + element.id);
|
|
|
|
var switche = stage.findOne("#" + element.id);
|
|
|
@ -594,6 +605,7 @@ function changeAllLineColorActive(color) {
|
|
|
|
colorLineActive = color;
|
|
|
|
colorLineActive = color;
|
|
|
|
layer.draw();
|
|
|
|
layer.draw();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function changeAllLineColorInActive(color) {
|
|
|
|
function changeAllLineColorInActive(color) {
|
|
|
|
var line1 = stage.findOne("#line2");
|
|
|
|
var line1 = stage.findOne("#line2");
|
|
|
|
var line2 = stage.findOne("#line3");
|
|
|
|
var line2 = stage.findOne("#line3");
|
|
|
@ -610,9 +622,11 @@ function changeAllLineColorInActive(color) {
|
|
|
|
colorLineInnactive = color;
|
|
|
|
colorLineInnactive = color;
|
|
|
|
layer.draw();
|
|
|
|
layer.draw();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function hideDiv(div) {
|
|
|
|
function hideDiv(div) {
|
|
|
|
div.style.display = 'none';
|
|
|
|
div.style.display = 'none';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function showDiv(div) {
|
|
|
|
function showDiv(div) {
|
|
|
|
if (div.id == "levelSelectionPage") {
|
|
|
|
if (div.id == "levelSelectionPage") {
|
|
|
|
document.querySelectorAll("#right_select").forEach(function (element) {
|
|
|
|
document.querySelectorAll("#right_select").forEach(function (element) {
|
|
|
@ -626,11 +640,13 @@ function play() {
|
|
|
|
hideDiv(document.querySelector("#mainPage"));
|
|
|
|
hideDiv(document.querySelector("#mainPage"));
|
|
|
|
showDiv(document.querySelector("#levelSelectionPage"));
|
|
|
|
showDiv(document.querySelector("#levelSelectionPage"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function modePerso() {
|
|
|
|
function modePerso() {
|
|
|
|
document.querySelector("#generate_button_perso").childNodes[3].classList = "fa fa-arrow-right";
|
|
|
|
document.querySelector("#generate_button_perso").childNodes[3].classList = "fa fa-arrow-right";
|
|
|
|
hideDiv(document.querySelector("#levelSelectionPage"));
|
|
|
|
hideDiv(document.querySelector("#levelSelectionPage"));
|
|
|
|
showDiv(document.querySelector("#PersoSetupPage"));
|
|
|
|
showDiv(document.querySelector("#PersoSetupPage"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function playNormal() {
|
|
|
|
function playNormal() {
|
|
|
|
hideDiv(document.querySelector("#levelSelectionPage"));
|
|
|
|
hideDiv(document.querySelector("#levelSelectionPage"));
|
|
|
|
showDiv(document.querySelector("#playPage"));
|
|
|
|
showDiv(document.querySelector("#playPage"));
|
|
|
@ -638,6 +654,7 @@ function playNormal() {
|
|
|
|
timeTot = 0;
|
|
|
|
timeTot = 0;
|
|
|
|
launchGameOne();
|
|
|
|
launchGameOne();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function modeTuto() {
|
|
|
|
function modeTuto() {
|
|
|
|
hideDiv(document.querySelector("#levelSelectionPage"));
|
|
|
|
hideDiv(document.querySelector("#levelSelectionPage"));
|
|
|
|
showDiv(document.querySelector("#playPage"));
|
|
|
|
showDiv(document.querySelector("#playPage"));
|
|
|
@ -645,6 +662,15 @@ function modeTuto() {
|
|
|
|
timeTot = 0;
|
|
|
|
timeTot = 0;
|
|
|
|
launchTuto();
|
|
|
|
launchTuto();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function modeTest() {
|
|
|
|
|
|
|
|
hideDiv(document.querySelector("#levelSelectionPage"));
|
|
|
|
|
|
|
|
showDiv(document.querySelector("#playPage"));
|
|
|
|
|
|
|
|
niveauActuel = 1;
|
|
|
|
|
|
|
|
timeTot = 0;
|
|
|
|
|
|
|
|
launchTest();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function wait(mode, btn) {
|
|
|
|
function wait(mode, btn) {
|
|
|
|
var time = 300;
|
|
|
|
var time = 300;
|
|
|
|
spin(btn);
|
|
|
|
spin(btn);
|
|
|
@ -658,6 +684,9 @@ function wait(mode, btn) {
|
|
|
|
case "tuto":
|
|
|
|
case "tuto":
|
|
|
|
setTimeout(modeTuto, time);
|
|
|
|
setTimeout(modeTuto, time);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "test":
|
|
|
|
|
|
|
|
setTimeout(modeTest, time);
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -685,6 +714,7 @@ function colonne_check_setup(value) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
refresh_input();
|
|
|
|
refresh_input();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function refresh_input() {
|
|
|
|
function refresh_input() {
|
|
|
|
document.querySelector("#colonne_number_setup_global").value = "0";
|
|
|
|
document.querySelector("#colonne_number_setup_global").value = "0";
|
|
|
|
document.querySelectorAll(".input_refresh").forEach(function (element) {
|
|
|
|
document.querySelectorAll(".input_refresh").forEach(function (element) {
|
|
|
@ -718,6 +748,7 @@ function launchGameOne() {
|
|
|
|
resetAllTabs(false);
|
|
|
|
resetAllTabs(false);
|
|
|
|
gameOne();
|
|
|
|
gameOne();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function launchTuto() {
|
|
|
|
function launchTuto() {
|
|
|
|
document.querySelector(".niveau").innerHTML = niveauActuel;
|
|
|
|
document.querySelector(".niveau").innerHTML = niveauActuel;
|
|
|
|
timer.stop();
|
|
|
|
timer.stop();
|
|
|
@ -726,6 +757,14 @@ function launchTuto() {
|
|
|
|
tuto();
|
|
|
|
tuto();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function launchTest() {
|
|
|
|
|
|
|
|
document.querySelector(".niveau").innerHTML = niveauActuel;
|
|
|
|
|
|
|
|
timer.stop();
|
|
|
|
|
|
|
|
timer.reset();
|
|
|
|
|
|
|
|
resetAllTabs(false);
|
|
|
|
|
|
|
|
generate2();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function clearArray(arr) {
|
|
|
|
function clearArray(arr) {
|
|
|
|
while (arr.length > 0) {
|
|
|
|
while (arr.length > 0) {
|
|
|
|
arr.pop();
|
|
|
|
arr.pop();
|
|
|
@ -745,11 +784,13 @@ function closeSelection() {
|
|
|
|
showDiv(document.querySelector("#mainPage"));
|
|
|
|
showDiv(document.querySelector("#mainPage"));
|
|
|
|
hideDiv(document.querySelector("#levelSelectionPage"));
|
|
|
|
hideDiv(document.querySelector("#levelSelectionPage"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function closePerso() {
|
|
|
|
function closePerso() {
|
|
|
|
showDiv(document.querySelector("#levelSelectionPage"));
|
|
|
|
showDiv(document.querySelector("#levelSelectionPage"));
|
|
|
|
hideDiv(document.querySelector("#PersoSetupPage"));
|
|
|
|
hideDiv(document.querySelector("#PersoSetupPage"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var rotated = false;
|
|
|
|
var rotated = false;
|
|
|
|
|
|
|
|
|
|
|
|
function flip() {
|
|
|
|
function flip() {
|
|
|
|
document.querySelectorAll(".fa").forEach(function (element) {
|
|
|
|
document.querySelectorAll(".fa").forEach(function (element) {
|
|
|
|
deg = rotated ? 0 : 360;
|
|
|
|
deg = rotated ? 0 : 360;
|
|
|
|