pisouvigne 5 years ago
parent 30d8ee7f45
commit 112539d345

@ -606,6 +606,24 @@ input[type=color] {
color: orange; color: orange;
} }
#choice_button_div {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
}
.choice {
margin: 10px auto;
}
.retry_tuto {
display: none;
}
#margin-left-10 {
margin-left: 25px;
}
.fa-info-circle:hover { .fa-info-circle:hover {
cursor: help; cursor: help;
} }

@ -13,13 +13,4 @@ $stmt->bind_result($pseudo, $score, $id);
$stmt->fetch(); $stmt->fetch();
$stmt->close(); $stmt->close();
echo "<table>"; echo "<script>console.log('Debug Objects: " . $pseudo . "' );</script>";
echo "<tr>";
echo "<th>CustomerID</th>";
echo "<td>" . $pseudo . "</td>";
echo "<th>CompanyName</th>";
echo "<td>" . $score . "</td>";
echo "<th>ContactName</th>";
echo "<td>" . $id . "</td>";
echo "</table>";
?>

@ -31,12 +31,8 @@
<a>Normal</a> <a>Normal</a>
<i class="fa fa-arrow-right" id="right_select" aria-hidden="true"></i> <i class="fa fa-arrow-right" id="right_select" aria-hidden="true"></i>
</div> </div>
<div class="border background dys listenerHover" onclick="wait('perso', this)">
<a>Personnalisé</a>
<i class="fa fa-arrow-right" id="right_select" aria-hidden="true"></i>
</div>
<div class="border background dys listenerHover" onclick="wait('test', this)"> <div class="border background dys listenerHover" onclick="wait('test', this)">
<a>Test Nouveau Générateur</a> <a>Mode Perso</a>
<i class="fa fa-arrow-right" id="right_select" aria-hidden="true"></i> <i class="fa fa-arrow-right" id="right_select" aria-hidden="true"></i>
</div> </div>
<div class="border background dys listenerHover"> <div class="border background dys listenerHover">
@ -111,34 +107,7 @@
</div> </div>
</div> </div>
</div> </div>
<!--Mode Personnalisé-->
<div id="PersoSetupPage" class="background">
<div id="header_selection" align=center>
<i class="fa fa-arrow-left home" onclick="closePerso(this);" aria-hidden="true"></i>
<h1 class="dys" id="title_perso_setup">Mode Perso</h1>
<label></label>
</div>
<hr id="hr">
<div id="perso-setupContainer" class="dys">
<br>
<div>
<label>Nombres de portes logiques : </label>
<input type="number" id="colonne_number_setup_global" value="4">
</div><br>
<div onclick="show_more_perso(this)">
<label class="more_perso">Plus de personnalisation </label>
<i class="fa fa-arrow-down" aria-hidden="true"></i>
</div><br>
<div id="colonne_number_ask">
<input type=" number" id="colonne_number_setup" oninput="colonne_check_setup(this.value)" value="0">
<label>Nombre de colonnes</label><br><br>
</div>
<div class="border background dys listenerHover" id="generate_button_perso" onclick="buttonSpin()">
<a>Générer le niveau</a>
<i class="fa fa-arrow-right" aria-hidden="true"></i>
</div>
</div>
</div>
</div> </div>
<!--Play Page--> <!--Play Page-->
<div id="playPage"> <div id="playPage">
@ -151,11 +120,20 @@
<p class="dys"><a class="txt" id="successInfo"></a><a id="click_number"></a><a> click(s)</a> <p class="dys"><a class="txt" id="successInfo"></a><a id="click_number"></a><a> click(s)</a>
</p> </p>
<div id="show_stage" class="border"></div><br> <div id="show_stage" class="border"></div><br>
<div class="border background dys listenerHover" id="next_level_button" <div id="choice_button_div">
<div class="border background dys listenerHover choice retry_tuto" id="retry_tuto_button"
onclick="closeModal('success');retry();"">
<a>Refaire le niveau</a>
<i class=" fa fa-retweet" id="margin-left-10" aria-hidden="true"></i>
</div>
<div class="border background dys listenerHover choice" id="next_level_button"
onclick="closeModal('success');nextLevel();""> onclick="closeModal('success');nextLevel();"">
<a>Niveau suivant</a> <a>Niveau suivant</a>
<i class=" fa fa-arrow-right" id="right_select" aria-hidden="true"></i> <i class=" fa fa-arrow-right" id="right_select" aria-hidden="true"></i>
</div><br><br> </div>
</div>
<br><br>
<p class="dys info_check" align=right>Toujours afficher ce panneau <input type="checkbox" <p class="dys info_check" align=right>Toujours afficher ce panneau <input type="checkbox"
id="success_check_input" onclick="successCheck();" checked></p> id="success_check_input" onclick="successCheck();" checked></p>
</div> </div>
@ -637,7 +615,10 @@
<script src="js/db.js"></script> <script src="js/db.js"></script>
<script src="js/generateGame.js"></script> <script src="js/generateGame.js"></script>
<script> <script>
console.log("wsh");
getTest();
initAll(); initAll();
</script> </script>

@ -46,6 +46,7 @@ var liveColonneNumber = [];
var niveauActuel = 1; var niveauActuel = 1;
var isTuto = true; var isTuto = true;
var isTutoriel = false;
//window //window
@ -65,3 +66,5 @@ var successPanel = true;
var arrayPorte = []; var arrayPorte = [];
const NOMBRETEST = 500; const NOMBRETEST = 500;
var tempCol = [], tempMatchs = [], tempFork = [], tempPortes = [];

@ -1,4 +1,5 @@
function getTest() { function getTest() {
console.log("oui");
var xhttp; var xhttp;
xhttp = new XMLHttpRequest(); xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function () { xhttp.onreadystatechange = function () {
@ -9,3 +10,4 @@ function getTest() {
xhttp.open("GET", "../database/insert.php", true); xhttp.open("GET", "../database/insert.php", true);
xhttp.send(); xhttp.send();
} }

@ -581,7 +581,6 @@ function checkEnd(mode) {
endLines.forEach(function (element) { endLines.forEach(function (element) {
if (stage.findOne("#line" + element).stroke() == colorLineInnactive) { if (stage.findOne("#line" + element).stroke() == colorLineInnactive) {
ter = false; ter = false;
} }
}); });
if (ter && !isTuto) { if (ter && !isTuto) {
@ -602,6 +601,15 @@ function success(mode) {
timer.stop(); timer.stop();
stage.findOne("#end").fill("yellow"); stage.findOne("#end").fill("yellow");
layer.draw(); layer.draw();
if (mode != undefined && mode != null && mode === "tuto") {
document.querySelector(".retry_tuto").style.display = "flex";
document.querySelector("#retry_tuto_button").onclick = function () {
closeModal('success');
launchTuto();
}
} else {
document.querySelector(".retry_tuto").style.display = "none";
}
if (successPanel) { if (successPanel) {
openModal("success"); openModal("success");
document.querySelector("#click_number").innerHTML = click; document.querySelector("#click_number").innerHTML = click;
@ -638,7 +646,7 @@ function nextLevel(mode) {
if (mode != undefined && mode != null && mode === "tuto") { if (mode != undefined && mode != null && mode === "tuto") {
launchTuto(); launchTuto();
} else { } else {
launchGameOne(); generate2(tempCol, tempMatchs, tempFork, tempPortes);
} }
} }

@ -232,6 +232,7 @@ function addGenForkInput() {
function tuto(niveau) { function tuto(niveau) {
setMode("Tuto"); setMode("Tuto");
isTutoriel = true;
windowWidth = window.innerWidth; windowWidth = window.innerWidth;
windowHeight = window.innerHeight; windowHeight = window.innerHeight;
var numberColonne1 = 2; var numberColonne1 = 2;
@ -441,11 +442,13 @@ function createGameOne(niveau) {
} }
function generate2(col, matchs, fork) { function generate2(col, matchs, fork, portes) {
isTutoriel = false;
isTuto = false;
hideDiv(document.querySelector('#TestNouveauGenerateur')); hideDiv(document.querySelector('#TestNouveauGenerateur'));
showDiv(document.querySelector('#playPage')); showDiv(document.querySelector('#playPage'));
resetAllTabs(false); resetAllTabs(false);
if (portes === null || portes === undefined)
arrayPorte = [ arrayPorte = [
[document.querySelector("#logique1").checked, "et"], [document.querySelector("#logique1").checked, "et"],
[document.querySelector("#logique2").checked, "ou"], [document.querySelector("#logique2").checked, "ou"],
@ -453,6 +456,9 @@ function generate2(col, matchs, fork) {
[document.querySelector("#logique4").checked, "etnon"], [document.querySelector("#logique4").checked, "etnon"],
[document.querySelector("#logique5").checked, "nonou"] [document.querySelector("#logique5").checked, "nonou"]
]; ];
else arrayPorte = portes;
arrayPorte = arrayPorte.filter(function (e) { arrayPorte = arrayPorte.filter(function (e) {
if (e[0] === true) return e; if (e[0] === true) return e;
@ -461,10 +467,18 @@ function generate2(col, matchs, fork) {
var numberCol = col.length; var numberCol = col.length;
var numberPerCol = []; var numberPerCol = [];
numberPerColonne = []; numberPerColonne = [];
tempMatchs = [];
tempFork = [];
for (let i = 0; i < col.length; i++) { for (let i = 0; i < col.length; i++) {
numberPerCol[i] = col[i]; numberPerCol[i] = col[i];
numberPerColonne[i] = col[i]; numberPerColonne[i] = col[i];
} }
for (let i = 0; i < matchs.length; i++)
tempMatchs[i] = matchs[i];
for (let i = 0; i < fork.length; i++)
tempFork[i] = fork[i];
tempPortes = portes;
tempCol = numberPerColonne;
colonneTot = col.length; colonneTot = col.length;
var compt = new Array(); var compt = new Array();
@ -529,7 +543,6 @@ function generate2(col, matchs, fork) {
if (listeLogiqueObj[x].matchId1 !== null) { if (listeLogiqueObj[x].matchId1 !== null) {
if (getElementArray(listeLogiqueObj[x].matchId1, listeSame)[1] === null) { if (getElementArray(listeLogiqueObj[x].matchId1, listeSame)[1] === null) {
getElementArray(listeLogiqueObj[x].matchId1, listeSame)[1] = arrayPorte[num2][1]; getElementArray(listeLogiqueObj[x].matchId1, listeSame)[1] = arrayPorte[num2][1];
console.log(listeLogiqueObj[x].matchId2);
if (listeLogiqueObj[x].matchId2 !== null && getElementArray(listeLogiqueObj[x].matchId2, listeSame)[1] === null) { if (listeLogiqueObj[x].matchId2 !== null && getElementArray(listeLogiqueObj[x].matchId2, listeSame)[1] === null) {
getElementArray(listeLogiqueObj[x].matchId2, listeSame)[1] = arrayPorte[num2][1]; getElementArray(listeLogiqueObj[x].matchId2, listeSame)[1] = arrayPorte[num2][1];
} }
@ -539,7 +552,6 @@ function generate2(col, matchs, fork) {
} }
} }
} }
console.log(listeSame);
createStage("play_container"); createStage("play_container");
stage.add(layer); stage.add(layer);

Loading…
Cancel
Save