pisouvigne 5 years ago
parent 30d8ee7f45
commit 112539d345

@ -606,6 +606,24 @@ input[type=color] {
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 {
cursor: help;
}

@ -1,6 +1,6 @@
<?php
$mysqli = new mysqli("localhost", "root", "", "makeittrue");
if($mysqli->connect_error) {
if ($mysqli->connect_error) {
exit('Could not connect');
}
@ -13,13 +13,4 @@ $stmt->bind_result($pseudo, $score, $id);
$stmt->fetch();
$stmt->close();
echo "<table>";
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>";
?>
echo "<script>console.log('Debug Objects: " . $pseudo . "' );</script>";

@ -31,12 +31,8 @@
<a>Normal</a>
<i class="fa fa-arrow-right" id="right_select" aria-hidden="true"></i>
</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)">
<a>Test Nouveau Générateur</a>
<a>Mode Perso</a>
<i class="fa fa-arrow-right" id="right_select" aria-hidden="true"></i>
</div>
<div class="border background dys listenerHover">
@ -111,34 +107,7 @@
</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>
<!--Play Page-->
<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>
<div id="show_stage" class="border"></div><br>
<div class="border background dys listenerHover" id="next_level_button"
onclick="closeModal('success');nextLevel();"">
<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();"">
<a>Niveau suivant</a>
<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"
id="success_check_input" onclick="successCheck();" checked></p>
</div>
@ -637,7 +615,10 @@
<script src="js/db.js"></script>
<script src="js/generateGame.js"></script>
<script>
console.log("wsh");
getTest();
initAll();
</script>

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

@ -1,11 +1,13 @@
function getTest() {
var xhttp;
xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
console.log("oui");
var xhttp;
xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("txtHint").innerHTML = this.responseText;
}
};
xhttp.open("GET", "../database/insert.php", true);
xhttp.send();
}
}
};
xhttp.open("GET", "../database/insert.php", true);
xhttp.send();
}

@ -581,7 +581,6 @@ function checkEnd(mode) {
endLines.forEach(function (element) {
if (stage.findOne("#line" + element).stroke() == colorLineInnactive) {
ter = false;
}
});
if (ter && !isTuto) {
@ -602,6 +601,15 @@ function success(mode) {
timer.stop();
stage.findOne("#end").fill("yellow");
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) {
openModal("success");
document.querySelector("#click_number").innerHTML = click;
@ -638,7 +646,7 @@ function nextLevel(mode) {
if (mode != undefined && mode != null && mode === "tuto") {
launchTuto();
} else {
launchGameOne();
generate2(tempCol, tempMatchs, tempFork, tempPortes);
}
}

@ -232,6 +232,7 @@ function addGenForkInput() {
function tuto(niveau) {
setMode("Tuto");
isTutoriel = true;
windowWidth = window.innerWidth;
windowHeight = window.innerHeight;
var numberColonne1 = 2;
@ -322,7 +323,7 @@ function createGameOne(niveau) {
numberColonne2 = 1;
timeEnd = 20;
break;
//Fin premiere serie
//Fin premiere serie
case 5:
firstTime.push("inv");
isNotAllowed = true;
@ -441,18 +442,23 @@ function createGameOne(niveau) {
}
function generate2(col, matchs, fork) {
function generate2(col, matchs, fork, portes) {
isTutoriel = false;
isTuto = false;
hideDiv(document.querySelector('#TestNouveauGenerateur'));
showDiv(document.querySelector('#playPage'));
resetAllTabs(false);
if (portes === null || portes === undefined)
arrayPorte = [
[document.querySelector("#logique1").checked, "et"],
[document.querySelector("#logique2").checked, "ou"],
[document.querySelector("#logique3").checked, "inv"],
[document.querySelector("#logique4").checked, "etnon"],
[document.querySelector("#logique5").checked, "nonou"]
];
else arrayPorte = portes;
arrayPorte = [
[document.querySelector("#logique1").checked, "et"],
[document.querySelector("#logique2").checked, "ou"],
[document.querySelector("#logique3").checked, "inv"],
[document.querySelector("#logique4").checked, "etnon"],
[document.querySelector("#logique5").checked, "nonou"]
];
arrayPorte = arrayPorte.filter(function (e) {
if (e[0] === true) return e;
@ -461,10 +467,18 @@ function generate2(col, matchs, fork) {
var numberCol = col.length;
var numberPerCol = [];
numberPerColonne = [];
tempMatchs = [];
tempFork = [];
for (let i = 0; i < col.length; i++) {
numberPerCol[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;
var compt = new Array();
@ -529,7 +543,6 @@ function generate2(col, matchs, fork) {
if (listeLogiqueObj[x].matchId1 !== null) {
if (getElementArray(listeLogiqueObj[x].matchId1, listeSame)[1] === null) {
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) {
getElementArray(listeLogiqueObj[x].matchId2, listeSame)[1] = arrayPorte[num2][1];
}
@ -539,7 +552,6 @@ function generate2(col, matchs, fork) {
}
}
}
console.log(listeSame);
createStage("play_container");
stage.add(layer);

Loading…
Cancel
Save