aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAiden Woodruff <aiden.woodruff@gmail.com>2018-05-11 13:39:10 -0500
committerAiden Woodruff <aiden.woodruff@gmail.com>2018-05-11 13:39:10 -0500
commitd3f74409e2f5139503006730bcb5c9bb7db6d2a6 (patch)
treea8fb0979ddad70c2c55fe1da949da6719ddddb38
parente40c3441946886663b05f1fe0dc064a7f87e1a46 (diff)
downloadsweeper-d3f74409e2f5139503006730bcb5c9bb7db6d2a6.tar.gz
sweeper-d3f74409e2f5139503006730bcb5c9bb7db6d2a6.tar.bz2
sweeper-d3f74409e2f5139503006730bcb5c9bb7db6d2a6.zip
Added rules iframe
Signed-off-by: Aiden Woodruff <aiden.woodruff@gmail.com>
-rw-r--r--index.html18
-rw-r--r--rules.html2
-rw-r--r--styles.css6
3 files changed, 26 insertions, 0 deletions
diff --git a/index.html b/index.html
index ca92eba..b6c2ad8 100644
--- a/index.html
+++ b/index.html
@@ -7,11 +7,29 @@
7 <link type="text/css" rel="stylesheet" href="styles.css"> 7 <link type="text/css" rel="stylesheet" href="styles.css">
8 <script type="application/javascript" src="http-get.js"></script> 8 <script type="application/javascript" src="http-get.js"></script>
9 <script type="application/javascript" src="sweeper.js"></script> 9 <script type="application/javascript" src="sweeper.js"></script>
10 <script type="application/javascript">
11 function hide_collapsable (e) {
12 e.target.onclick = function (e) { window.setTimeout(show_collapsable.bind(null, e), 20); };
13 document.getElementById("rules").innerHTML = "";
14 }
15
16 function show_collapsable (e) {
17 e.target.onclick = function (e) { window.setTimeout(hide_collapsable.bind(null, e), 20); };
18 document.getElementById("rules").innerHTML = "<iframe src='rules.html'>";
19 }
20 </script>
10 </head> 21 </head>
11 <body> 22 <body>
12 <h1>Minesweeper</h1> 23 <h1>Minesweeper</h1>
13 <div id="content"> 24 <div id="content">
14 <p>I'm sorry, JavaScript is required.</p> 25 <p>I'm sorry, JavaScript is required.</p>
15 </div> 26 </div>
27 <br>
28 <h1 id="rules-clickable">Rules</h1>
29 <div id="rules">
30 </div>
31 <script type="application/javascript">
32 document.getElementById("rules-clickable").onclick = function (e) { window.setTimeout(show_collapsable.bind(null, e), 20); };
33 </script>
16 </body> 34 </body>
17</html> 35</html>
diff --git a/rules.html b/rules.html
new file mode 100644
index 0000000..1256a58
--- /dev/null
+++ b/rules.html
@@ -0,0 +1,2 @@
1To win, click all of the non-mine cells.<br>
2Score is calculated using <a href="http://www.minesweeper.info/wiki/3BV">3BV</a>/s.<br>
diff --git a/styles.css b/styles.css
index 29e1292..26f9234 100644
--- a/styles.css
+++ b/styles.css
@@ -56,3 +56,9 @@ div.leaderboard td {
56 border: 2px solid black; 56 border: 2px solid black;
57 text-align: right; 57 text-align: right;
58} 58}
59
60#rules-clickable {
61 text-decoration: underline;
62 color: blue;
63 cursor: pointer;
64}