essais d'ajout de boutons

upgrade-menu
non 5 years ago
parent b8f1b4d9c9
commit ebab13a8a0

@ -0,0 +1,21 @@
var modes=["points","temps","survie"];
var div=document.getElementById('buttons');
modes.forEach(element => {
var name=element+"Button";
eval("var "+name+"= new Image()");
/*
console.log(name+".src='./ress/button_mode_"+element+".png'");
eval(name+".src='./ress/button_mode_"+element+".png'");
*/
console.log("<img src='"+"./ress/button_mode_"+element+".png'"+"/>");
div.innerHTML+="<img id="+name+" src='./ress/button_mode_"+element+".png'/>";
/*
eval(name).onload = function(){
div.innerHTML+="<img src='./ress/button_mode_"+element+".png'/>";
}*/
//eval(name).src="./ress/button_mode_"+element+".png";
eval(name).addEventListener("mousedown",function(e){console.log("yo");});
});

@ -5,6 +5,9 @@
<body>
<form action="./game.html" method="GET">
Jouer la partie en : </br>
<div id="buttons"></div>
<script src="button_displayer.js"></script>
<!--
<input type="radio" id="5pts" name="mode" value="5p" checked="checked">
<label for="5pts">5 points</label><br>
<input type="radio" id="10pts" name="mode" value="10p">
@ -18,7 +21,7 @@
<input type="radio" id="10min" name="mode" value="10m">
<label for="5pts">10 minutes</label><br>
<input type="radio" id="survie" name="mode" value="surv">
<label for="5pts">survie</label><br>
<label for="5pts">survie</label><br> -->
Choisissez la difficult&eacute; </br>
@ -29,7 +32,7 @@
<input type="radio" id="hard" name="diff" value="hard">
<label for="5pts">difficile</label><br>
Entrez votre pseudo (optionnel, mais n&eacute;coul&eacute;cessaire si vous voulez sauvegarder votre score):
Entrez votre pseudo (optionnel, mais n&eacute;cessaire si vous voulez sauvegarder votre score):
<input type="text" name="pseudo" />

@ -1,16 +0,0 @@
<html>
<head>
On the Dot
</head>
<body>
<form action="./game.php" method="post">
<input type="radio" id="no-res" name="mode" value="no-res">
<label for="no-res">Sans réserve</label><br>
<div class="button">
<button type="submit">JOUER !</button>
</div>
</form>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Loading…
Cancel
Save