summaryrefslogtreecommitdiff
path: root/Mines/index.html
diff options
context:
space:
mode:
authorKyle Gunger <corechg@gmail.com>2020-02-27 15:55:51 -0500
committerKyle Gunger <corechg@gmail.com>2020-02-27 15:55:51 -0500
commit06f962066c57818232cc8d59ef49e879043418df (patch)
tree954e4de86e728112a39562bb6616fa93d2bf4d5a /Mines/index.html
parent20de55be1be3aef4b49fa49fedc7b09276a0a026 (diff)
Add mines to the page
Diffstat (limited to 'Mines/index.html')
-rw-r--r--Mines/index.html64
1 files changed, 64 insertions, 0 deletions
diff --git a/Mines/index.html b/Mines/index.html
new file mode 100644
index 0000000..5b27806
--- /dev/null
+++ b/Mines/index.html
@@ -0,0 +1,64 @@
+<!Doctype HTML>
+<html>
+ <head>
+ <meta charset="utf-8">
+
+ <link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
+ <link rel="stylesheet" type="text/css" href="./mines.css"/>
+
+ <script src="./mines.js"></script>
+ </head>
+ <body>
+ <div class="selector">
+ <label>Width: </label> <input id="x" min="4" max="50" value="6" type="number"/>
+ <br>
+ <label>Height: </label> <input id="y" min="4" value="6" type="number"/>
+ <br>
+ <label>Mines: </label> <input id="m" min="2" value="5" type="number"/>
+ <br>
+ <label>- OR -</label>
+ <br>
+ <label>Difficulty: </label>
+ <select id="d">
+ <option value="0.125">Easy</option>
+ <option value="0.15">Medium</option>
+ <option value="0.2">Hard</option>
+ <option value="0.25">Impossible</option>
+ <option value="0">Custom</option>
+ </select>
+ <br>
+ <label>- OR -</label>
+ <br>
+ <button id="save" onclick="game.save()">Save Game</button> | <label for="fin">Choose Save File</label><input id="fin" type="file" accept=".mgs"/> <button id="load" onclick="game.loadFromFile()">Load Game</button>
+ </div>
+ <br>
+ <div class="game">
+ <h1 id="mines">0</h1><button id="circle" onclick="game.reset()"></button><h1 id="time">0</h1>
+ <br>
+ <table>
+ <tbody id="gtable"><tr><td class="wt">&#9673;</td></tr></tbody>
+ </table>
+ </div>
+ <script>
+ var xIn = document.getElementById("x");
+ var yIn = document.getElementById("y");
+ var mIn = document.getElementById("m");
+ var dIn = document.getElementById("d");
+
+ var sMines = document.getElementById("mines");
+ var sTime = document.getElementById("time");
+
+ var circle = document.getElementById("circle");
+
+ var table = document.getElementById("gtable");
+
+ var fileSel = document.getElementById("fin");
+
+ var game = new Board();
+
+ mIn.addEventListener("change", function(){
+ if(dIn.value !== "0") dIn.value = "0";
+ });
+ </script>
+ </body>
+</html> \ No newline at end of file