parent
1bdb192724
commit
3a93ebcfbe
Binary file not shown.
@ -0,0 +1,46 @@
|
|||||||
|
var modes=["points","temps","survie"];
|
||||||
|
var diffs=["easy","med","hard"];
|
||||||
|
size=screen.height/6;
|
||||||
|
hideAll();
|
||||||
|
|
||||||
|
modes.forEach(element => {
|
||||||
|
|
||||||
|
eval("var img_"+element+"= document.getElementById('img_"+element+"')");
|
||||||
|
eval("img_"+element+".width=size");
|
||||||
|
eval("img_"+element).addEventListener("mousedown",function(e){disp(e);});
|
||||||
|
var tab=document.getElementById(element).children;
|
||||||
|
for(var i=1;i<tab.length;i+=2){
|
||||||
|
tab.item(i).children[0].width=size;
|
||||||
|
tab.item(i).addEventListener("mousedown",function(e)
|
||||||
|
{
|
||||||
|
var tab=document.getElementById("modeSelection").children;
|
||||||
|
for(var cpt=1;cpt<tab.length;cpt++)
|
||||||
|
{
|
||||||
|
var tabChilds=document.getElementById(tab.item(cpt).id).children;
|
||||||
|
for(var cptChild=0;cptChild<tabChilds.length;cptChild++)
|
||||||
|
{
|
||||||
|
tabChilds.item(cptChild).classList.remove("selected");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
document.getElementById(e.currentTarget.id).classList.add("selected");
|
||||||
|
console.log(e.currentTarget.id);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
function disp(what)
|
||||||
|
{
|
||||||
|
what=what.currentTarget.id.substring(4);
|
||||||
|
console.log(what);
|
||||||
|
modes.forEach(element => {
|
||||||
|
document.getElementById(element).style.display=what==element ? "flex":"none";
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function hideAll()
|
||||||
|
{
|
||||||
|
document.getElementById("temps").style.display="none";
|
||||||
|
document.getElementById("points").style.display="none";
|
||||||
|
document.getElementById("survie").style.display="none";
|
||||||
|
}
|
@ -0,0 +1,94 @@
|
|||||||
|
.all-container {
|
||||||
|
display : flex;
|
||||||
|
|
||||||
|
align-items: baseline;
|
||||||
|
width : min-content;
|
||||||
|
|
||||||
|
margin: 5px;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.button {
|
||||||
|
padding: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
[type="radio"] {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.selected {
|
||||||
|
-webkit-box-shadow:inset 0px 0px 0px 5px black;
|
||||||
|
-moz-box-shadow:inset 0px 0px 0px 5px black;
|
||||||
|
box-shadow:inset 0px 0px 0px 5px black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider {
|
||||||
|
-webkit-appearance: none;
|
||||||
|
width: 100%;
|
||||||
|
height: 15px;
|
||||||
|
border-radius: 5px;
|
||||||
|
background: #d3d3d3;
|
||||||
|
outline: none;
|
||||||
|
opacity: 0.7;
|
||||||
|
-webkit-transition: .2s;
|
||||||
|
transition: opacity .2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider::-webkit-slider-thumb {
|
||||||
|
-webkit-appearance: none;
|
||||||
|
appearance: none;
|
||||||
|
width: 25px;
|
||||||
|
height: 25px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: #4CAF50;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider::-moz-range-thumb {
|
||||||
|
width: 25px;
|
||||||
|
height: 25px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: #4CAF50;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* The Modal (background) */
|
||||||
|
.modal {
|
||||||
|
display: none; /* Hidden by default */
|
||||||
|
position: fixed; /* Stay in place */
|
||||||
|
z-index: 1; /* Sit on top */
|
||||||
|
padding-top: 100px; /* Location of the box */
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
width: 100%; /* Full width */
|
||||||
|
height: 100%; /* Full height */
|
||||||
|
overflow: auto; /* Enable scroll if needed */
|
||||||
|
background-color: rgb(0,0,0); /* Fallback color */
|
||||||
|
background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Modal Content */
|
||||||
|
.modal-content {
|
||||||
|
background-color: #fefefe;
|
||||||
|
margin: auto;
|
||||||
|
padding: 20px;
|
||||||
|
border: 1px solid #888;
|
||||||
|
width: 80%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* The Close Button */
|
||||||
|
.close {
|
||||||
|
color: #aaaaaa;
|
||||||
|
float: right;
|
||||||
|
font-size: 28px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.close:hover,
|
||||||
|
.close:focus {
|
||||||
|
color: #000;
|
||||||
|
text-decoration: none;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
@ -0,0 +1,134 @@
|
|||||||
|
<head>
|
||||||
|
<link rel="stylesheet" type="text/css" href="highscores.css"/>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<form action="highscores.php" method="post">
|
||||||
|
<p>difficulty : <input type="text" name="diff" /></p>
|
||||||
|
<p>dotsAmount : <input type="text" name="dotsAmount" /></p>
|
||||||
|
<p>pause : <input type="text" name="pause" /></p>
|
||||||
|
<div id="modeSelection">
|
||||||
|
<ul id="modes">
|
||||||
|
<img id="img_points" class="button" src="./ress/button_mode_points.png"/>
|
||||||
|
|
||||||
|
<img id="img_temps" class="button" src="./ress/button_mode_temps.png"/>
|
||||||
|
|
||||||
|
<img id="img_survie" class="button" src="./ress/button_mode_survie.png"/>
|
||||||
|
</ul>
|
||||||
|
<ul id="points" class="all-container">
|
||||||
|
<input type="radio" name="game_mode" id="5p" value="5p" />
|
||||||
|
<label for="5p"><img id="img_5p" class="button" src="./ress/button_points_5.png"/></label>
|
||||||
|
|
||||||
|
<input type="radio" name="game_mode" id="10p" value="10p"/>
|
||||||
|
<label for="10p"><img id="img_10p" class="button" src="./ress/button_points_10.png"/></label>
|
||||||
|
|
||||||
|
<input type="radio" name="game_mode" id="15p" value="15p" />
|
||||||
|
<label for="15p"><img id="img_15p" class="button" src="./ress/button_points_15.png"/></label>
|
||||||
|
|
||||||
|
<input type="radio" name="game_mode" id="20p" value="20p" />
|
||||||
|
<label for="20p"><img id="img_20p" class="button" src="./ress/button_points_20.png"/></label>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
<ul id="temps" class="all-container">
|
||||||
|
<input type="radio" name="game_mode" id="5m" value="5m" />
|
||||||
|
<label for="5m"><img id="img_5m" class="button" src="./ress/button_temps_5.png"/></label>
|
||||||
|
|
||||||
|
<input type="radio" name="game_mode" id="10m" value="10m"/>
|
||||||
|
<label for="10m"><img id="img_10m" class="button" src="./ress/button_temps_10.png"/></label>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
<ul id="survie" class="all-container">
|
||||||
|
<input type="radio" name="game_mode" id="15s" value="15s"/>
|
||||||
|
<label for="15s"><img id="img_15s" class="button" src="./ress/button_survie_15.png"/></label>
|
||||||
|
|
||||||
|
<input type="radio" name="game_mode" id="30s" value="30s" />
|
||||||
|
<label for="30s"><img id="img_30s" class="button" src="./ress/button_survie_30.png"/></label>
|
||||||
|
|
||||||
|
<input type="radio" name="game_mode" id="45s" value="45s" />
|
||||||
|
<label for="45s"><img id="img_45s" class="button" src="./ress/button_survie_45.png"/> </label>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<input type="image" src="ress/red.png" alt="Submit" width="48" height="48">
|
||||||
|
</form>
|
||||||
|
<!--
|
||||||
|
<form action="#">
|
||||||
|
|
||||||
|
<input type="radio" name="radio-choice2" id="radio-choice-2" />
|
||||||
|
<label for="radio-choice-2"><img id="img_temps" class="button" src="./ress/button_mode_temps.png"/></label>
|
||||||
|
|
||||||
|
<input type="radio" name="radio-choice2" id="radio-choice-2" />
|
||||||
|
<label for="radio-choice-2"><img id="img_temps" class="button" src="./ress/button_mode_temps.png"/></label>
|
||||||
|
|
||||||
|
<input type="radio" name="radio-choice2" id="radio-choice-2" />
|
||||||
|
<label for="radio-choice-2"><img id="img_temps" class="button" src="./ress/button_mode_temps.png"/></label>
|
||||||
|
|
||||||
|
<input type="radio" name="radio-choice2" id="radio-choice-2" />
|
||||||
|
<label for="radio-choice-2"><img id="img_temps" class="button" src="./ress/button_mode_temps.png"/></label>
|
||||||
|
|
||||||
|
<input type="radio" name="radio-choice3" id="radio-choice-2" />
|
||||||
|
<label for="radio-choice-2"><img id="img_temps" class="button" src="./ress/button_mode_temps.png"/></label>
|
||||||
|
|
||||||
|
<input type="radio" name="radio-choice3" id="radio-choice-2" />
|
||||||
|
<label for="radio-choice-2"><img id="img_temps" class="button" src="./ress/button_mode_temps.png"/></label>
|
||||||
|
|
||||||
|
<input type="radio" name="radio-choice3" id="radio-choice-2" />
|
||||||
|
<label for="radio-choice-2"><img id="img_temps" class="button" src="./ress/button_mode_temps.png"/></label>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<input type="submit" value="Valider" />
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<div id="modeSelection">
|
||||||
|
<ul id="modes" class="all-container">
|
||||||
|
|
||||||
|
|
||||||
|
<img id="img_survie" class="button" src="./ress/button_mode_survie.png"/>
|
||||||
|
</ul>
|
||||||
|
<ul id="points" class="all-container">
|
||||||
|
<img id="img_5p" class="button" src="./ress/button_points_5.png"/>
|
||||||
|
<img id="img_10p" class="button" src="./ress/button_points_10.png"/>
|
||||||
|
<img id="img_15p" class="button" src="./ress/button_points_15.png"/>
|
||||||
|
<img id="img_20p" class="button" src="./ress/button_points_20.png"/>
|
||||||
|
</ul>
|
||||||
|
<ul id="temps" class="all-container">
|
||||||
|
<img id="img_5m" class="button" src="./ress/button_temps_5.png"/>
|
||||||
|
<img id="img_10m" class="button" src="./ress/button_temps_10.png"/>
|
||||||
|
</ul>
|
||||||
|
<ul id="survie" class="all-container">
|
||||||
|
<img id="img_15s" class="button" src="./ress/button_survie_15.png"/>
|
||||||
|
<img id="img_30s" class="button" src="./ress/button_survie_30.png"/>
|
||||||
|
<img id="img_45s" class="button" src="./ress/button_survie_45.png"/>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<ul id="diff" class="all-container">
|
||||||
|
<img id="img_easy" class="button" src="./ress/button_diff_easy.png"/>
|
||||||
|
<img id="img_med" class="button" src="./ress/button_diff_normal.png"/>
|
||||||
|
<img id="img_hard" class="button" src="./ress/button_diff_hard.png"/>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
-->
|
||||||
|
<script src="highscore_button_displayer.js"></script>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$database = new SQLite3("data.db");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if($_POST["game_mode"]!="" && $_POST["diff"]!="" && $_POST["dotsAmount"]!="" && $_POST["pause"]!="")
|
||||||
|
{
|
||||||
|
if(stristr($_POST['game_mode'], "p") === FALSE)
|
||||||
|
{
|
||||||
|
$sql='select score, player from score where game_mode="'.$_POST['game_mode'].'" and difficulty="'.$_POST['diff'].'" and dots_amount='.$_POST["dotsAmount"].' and pause='.$_POST["pause"].' and score=(select min(score) from score where game_mode="'.$_POST['game_mode'].'" and difficulty="'.$_POST['diff'].'" and dots_amount='.$_POST["dotsAmount"].' and pause='.$_POST["pause"].')';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$sql='select score, player from score where game_mode="'.$_POST['game_mode'].'" and difficulty="'.$_POST['diff'].'" and dots_amount='.$_POST["dotsAmount"].' and pause='.$_POST["pause"].' and score=(select max(score) from score where game_mode="'.$_POST['game_mode'].'" and difficulty="'.$_POST['diff'].'" and dots_amount='.$_POST["dotsAmount"].' and pause='.$_POST["pause"].')';
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = $database->query($sql);
|
||||||
|
$a=$result->fetchArray();
|
||||||
|
|
||||||
|
echo "<h1 id='aya'>".print_r($a)."</h1>";
|
||||||
|
echo "<h1 id='aye'>".var_dump($_POST)."</h1>";
|
||||||
|
}
|
Loading…
Reference in new issue