mode de jeux

master
pisouvigne 5 years ago
parent 8fda008546
commit 17faf058a4

@ -19,6 +19,30 @@ body {
--cool-color: #fe8a71;
}
.fa-play {
margin-left: 25px;
}
#containerVanilla {
display: flex;
flex-direction: row;
}
#VanillalevelSelectionPage {
height: 100%;
display: none;
}
#selectionVanillaContainer {
height: 95%;
display: flex;
align-items: center;
flex-direction: column;
justify-content: center;
}
html {
height: 100%;
margin: 0;
@ -205,7 +229,7 @@ html {
font-size: 6vh;
}
.fa-trophy {
.trophyMain {
font-size: 5vh;
position: absolute;
left: 0;
@ -214,7 +238,7 @@ html {
transition: .5s;
}
.fa-trophy:hover {
.trophyMain:hover {
font-size: 6vh;
}
@ -700,4 +724,9 @@ input[type=color] {
#win_pannel {
display: none;
}
.scoreElement {
width: 10%;
margin-left: 10px;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Before

Width:  |  Height:  |  Size: 930 B

After

Width:  |  Height:  |  Size: 930 B

Before

Width:  |  Height:  |  Size: 899 B

After

Width:  |  Height:  |  Size: 899 B

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before

Width:  |  Height:  |  Size: 930 B

After

Width:  |  Height:  |  Size: 930 B

Before

Width:  |  Height:  |  Size: 899 B

After

Width:  |  Height:  |  Size: 899 B

Before

Width:  |  Height:  |  Size: 925 B

After

Width:  |  Height:  |  Size: 925 B

Before

Width:  |  Height:  |  Size: 1012 B

After

Width:  |  Height:  |  Size: 1012 B

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

@ -41,6 +41,63 @@
</div>
</div>
</div>
<!-- Vanilla Selection -->
<div id="VanillalevelSelectionPage" class="background">
<div id="header_selection" align=center>
<i class="fa fa-arrow-left home" onclick="goToSelection(this);" aria-hidden="true"></i>
<h1 class="dys txt" id="title_selection">Vanilla</h1>
<label></label>
</div>
<hr id="hr">
<div id="selectionVanillaContainer">
<div id="containerVanilla">
<div class="border background dys listenerHover vanillaElement" onclick="wait('tuto', this)">
<a>Facile</a>
<i class="fa fa-play" aria-hidden="true"></i>
</div>
<div class="border background dys listenerHover vanillaElement scoreElement"
onclick="wait('tuto', this)">
<a></a>
<i class="fa fa-trophy" aria-hidden="true"></i>
</div>
</div>
<div id="containerVanilla">
<div class="border background dys listenerHover vanillaElement" onclick="wait('tuto', this)">
<a>Moyen</a>
<i class="fa fa-play" aria-hidden="true"></i>
</div>
<div class="border background dys listenerHover vanillaElement scoreElement"
onclick="wait('tuto', this)">
<a></a>
<i class="fa fa-trophy" aria-hidden="true"></i>
</div>
</div>
<div id="containerVanilla">
<div class="border background dys listenerHover vanillaElement" onclick="wait('tuto', this)">
<a>Impossible</a>
<i class="fa fa-play" aria-hidden="true"></i>
</div>
<div class="border background dys listenerHover vanillaElement scoreElement"
onclick="wait('tuto', this)">
<a></a>
<i class="fa fa-trophy" aria-hidden="true"></i>
</div>
</div>
<div id="containerVanilla">
<div class="border background dys listenerHover vanillaElement" onclick="wait('tuto', this)">
<a>Mode Infini</a>
<i class="fa fa-play" aria-hidden="true"></i>
</div>
<div class="border background dys listenerHover vanillaElement scoreElement"
onclick="wait('tuto', this)">
<a></a>
<i class="fa fa-trophy" aria-hidden="true"></i>
</div>
</div>
</div>
</div>
<!--Test Generateur-->
<div id="TestNouveauGenerateur" class="background">
<div id="header_selection" align=center>
@ -383,7 +440,7 @@
<a onclick="play();"><i class="far fa-play-circle"></i></a>
</div>
<a onclick="openModal('myModal')"><i class="fa fa-cog" id="setting" aria-hidden="true"></i></a>
<a onclick="openModal('scoreModal')"><i class="fa fa-trophy" id="setting" aria-hidden="true"></i></a>
<a onclick="openModal('scoreModal')"><i class="fa fa-trophy trophyMain" id="setting" aria-hidden="true"></i></a>
<a onclick="document.location.href='https://gitlab.iut-clermont.uca.fr/'; "><i class="fa fa-users" id="setting"
aria-hidden="true"></i></a>
<a onclick="openModal('infoModal')"><i class="fa fa-info" id="setting" aria-hidden="true"></i></a>
@ -483,7 +540,7 @@
<h1 align=center class="txt dys" id="scoreTitle">Tableau des scores</h1>
<hr id="hr">
<div class="scoreOne border" align=center>
<p class="dys txt" id="mode1">Aleatoire</p>
<p class="dys txt" id="mode1">Vanilla</p>
<hr id="hr">
<p class="dys">Pseudo | Score</p>
<p class="dys">Pseudo | Score</p>
@ -491,7 +548,7 @@
<p class="dys">Pseudo | Score</p>
</div>
<div class="scoreTwo border" align=center>
<p class="dys txt" id="mode2">Cameleon</p>
<p class="dys txt" id="mode2">Normal</p>
<hr id="hr">
<p class="dys">Pseudo | Score</p>
<p class="dys">Pseudo | Score</p>
@ -635,9 +692,10 @@
<script src="js/timer.js"></script>
<script src="js/db.js"></script>
<script src="js/generateGame.js"></script>
<script src="js/sql.js"></script>
<script>
//getTest();
getTest();
initAll();
</script>

@ -0,0 +1,19 @@
function getTest() {
var contents;
var xhr = new XMLHttpRequest();
xhr.open('GET', 'database/makeittrue.db', true);
xhr.responseType = 'arraybuffer';
xhr.onload = function (e) {
var uInt8Array = new Uint8Array(this.response);
var db = new SQL.Database(uInt8Array);
var contents = db.exec("SELECT * FROM scores WHERE mode = 'normal'");
contents.forEach(function (element) {
element.values.forEach(function (value) {
console.log(value)
});
});
};
xhr.send();
}

@ -817,6 +817,16 @@ function playNormal() {
launchGameOne("normal");
}
function goToSelection(btn) {
hideDiv(btn.parentElement.parentElement)
showDiv(document.querySelector("#levelSelectionPage"));
}
function vanillaSelection() {
hideDiv(document.querySelector("#levelSelectionPage"));
showDiv(document.querySelector("#VanillalevelSelectionPage"));
}
function playVanilla() {
hideDiv(document.querySelector("#levelSelectionPage"));
showDiv(document.querySelector("#playPage"));
@ -865,7 +875,7 @@ function wait(mode, btn) {
setMode("Normal");
break;
case "vanilla":
setTimeout(playVanilla, time);
setTimeout(vanillaSelection, time);
setMode("Vanilla")
break;
case "perso":
@ -991,10 +1001,22 @@ function launchGameOne(mode) {
porteLogique = [[true, "et"], [true, "nonou"], [true, "ou"], [true, "inv"]];
break;
default:
col = [4, 3, 2];
case 17:
case 18:
case 19:
case 20:
case 21:
col = [6, 4, 3];
matchs = [[1, 2], [2, 2]];
porteLogique = [[true, "et"], [true, "ou"]];
porteLogique = [[true, "et"], [true, "nonou"], [true, "ou"], [true, "inv"], [true, "etnon"]];
break;
default:
if (niveauActuel < 30) time = 15;
else if (niveauActuel < 35) time = 10;
else time = 5;
col = [6, 4, 3];
matchs = [[1, 2], [1, 2], [2, 2]];
porteLogique = [[true, "et"], [true, "nonou"], [true, "ou"], [true, "inv"], [true, "etnon"]];
break;
}
for (let i = 0; i < 200; i++) {

@ -3,8 +3,8 @@ const lang = {
titleGame: "Make It True",
settingTitle: "Paramètres",
playSelection: "Je veux jouer a",
mode1: "Aleatoire",
mode2: "Cameleon",
mode1: "Vanilla",
mode2: "Normal",
themeDark: "Theme Dark :",
retour: "Retour",
dysfont: "Dyslexie :",
@ -46,8 +46,8 @@ const lang = {
titleGame: "Make It True",
settingTitle: "Settings",
playSelection: "I want to play ",
mode1: "Random",
mode2: "Chameleon",
mode1: "Vanilla",
mode2: "Normal",
themeDark: "Dark Theme :",
retour: "Back",
dysfont: "Dyslexia :",

File diff suppressed because one or more lines are too long

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script src="db.js"></script>
<script src="sql.js"></script>
<script>
//getTest();
</script>
</body>
</html>

@ -1,16 +0,0 @@
<?php
$mysqli = new mysqli("localhost", "root", "", "makeittrue");
if ($mysqli->connect_error) {
exit('Could not connect');
}
$sql = "SELECT pseudo, score, id FROM score";
$stmt = $mysqli->prepare($sql);
$stmt->execute();
$stmt->store_result();
$stmt->bind_result($pseudo, $score, $id);
$stmt->fetch();
$stmt->close();
echo "<script>console.log('Debug Objects: " . $pseudo . "' );</script>";

@ -1,12 +0,0 @@
function getTest() {
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();
}

@ -1,10 +0,0 @@
<script>
var arr = [60, 40, 70, 120, 50, 45, 69, 69];
var newArray = [55, 55, 65, 65, 75, 75, 85, 85];
var position = 60;
console.log(arr);
arr.splice(arr.indexOf(position), 4);
for (let i = 0; i < newArray.length; i++)
arr.splice(0, 0, newArray[i])
console.log(arr);
</script>
Loading…
Cancel
Save