-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathminesweeper.html
174 lines (154 loc) · 6.28 KB
/
minesweeper.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<!doctype html>
<html lang="en-US">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Minesweeper</title>
<meta name="description" content="An implementation of the game Minesweeper in JavaScript" />
<meta property="og:title" content="Dice" />
<meta property="og:description" content="An implementation of the game Minesweeper in JavaScript" />
<meta property="og:image" content="https://josephpetitti.com/images/logo.png" />
<meta property="og:type" content="game" />
<meta property="og:url" content="https://josephpetitti.com/minesweeper" />
<meta name="viewport" content="initial-scale=1.0, width=device-width" />
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<link rel="icon" href="/images/favicon-16.png" sizes="16x16" type="image/png">
<link rel="icon" href="/images/favicon-96.png" sizes="96x96" type="image/png">
<link rel="icon" href="/images/favicon-192.png" sizes="192x192" type="image/png">
<link rel="icon" href="/images/favicon-32.png" sizes="32x32" type="image/png">
<meta name="theme-color" content="#1f0053">
<link rel="stylesheet" href="webfonts/fonts.css" type="text/css">
<link rel="stylesheet" href="styles/fontawesome.min.css" type="text/css">
<link rel="stylesheet" href="styles/brands.css" type="text/css">
<link rel="stylesheet" href="styles/solid.min.css" type="text/css">
<link rel="stylesheet" href="styles/dark.css?v=1.0.8" type="text/css">
<script src="scripts/jquery-3.3.1.min.js"></script>
<script src="scripts/minesweeper.js"></script>
</head>
<body>
<!-- Header -->
<header>
<input type="checkbox" id="toggle-menu">
<label for="toggle-menu" id="mobile-nav" title="Navigation">
<i class="fas fa-bars"></i> Menu
</label>
<!-- Nav -->
<nav id="nav">
<label for="toggle-menu" id="mobile-nav-close" title="Close">
<i class="fas fa-times"></i> Close
</label>
<ul>
<li><a href="index">Home</a></li>
<li><a href="resume">Resume</a></li>
<li><a href="projects">Projects</a>
<ul>
<li><a href="afterlight-caves">Afterlight Caves</a></li>
<li><a href="kyoto-ar-tour-guide-app">
Kyoto AR <br> Tour Guide App
</a></li>
<li><a href="traffic-classifier">Traffic Classifier</a></li>
<li><a href="hong-kong-historic-conservation">
Hong Kong Historic <br> Conservation
</a></li>
<li><a href="meeting-scheduler">Algol Meeting Scheduler</a></li>
<li><a href="this-website">This Website</a></li>
<li><a href="tic-tac-toe">Tic-Tac-Toe</a></li>
</ul>
</li>
<li><a href="blog">Blog</a>
<li><a href="other">Other</a>
<ul>
<li><a href="dice">Dice</a></li>
<li><a href="ant">Langton's Ant</a></li>
<li><a href="rps">RPS Automaton</a></li>
<li><a href="type">Typing Game</a></li>
<li><a href="minesweeper">Minesweeper</a></li>
<li><a href="snake">Snake</a></li>
<li><a href="match">Color Match</a></li>
<li><a href="klotski">Klotski</a></li>
<li><a href="sliding-tetris">Sliding Tetris</a></li>
</ul>
</li>
</ul>
</nav>
</header>
<!-- Main -->
<main id="main">
<h1 class="title">MINESWEEPER</h1>
<button id="easy">Easy</button>
<button id="medium">Medium</button>
<button id="hard">Hard</button>
<button id="expert">Expert</button>
<br>
<br>
<button id="custom">Custom</button>
Width: <input type="number" id="input-width" value="20"></input>
Height: <input type="number" id="input-height" value="15"></input>
Mines: <input type="number" id="input-mines" value="50"></input>
<center id="canvas-holder"></center>
<center>
<button id="play-again" style="display: none" onclick="location.reload()">Play Again?</button>
</center>
<p id="score"></p>
<h2>Instructions</h2>
<p>
Mines have been hidden throughout the board, and it's your job to find
out where they are! Left click on a square to explore it, but beware: if
there's a mine in that square it'll explode. If there isn't, the square
will show how many of its neighbors (including diagonals) contain mines.
When you think you know where a mine is, right click that square to mark
it. If you mark every mine square and explore every non-mine square, you
win!
</p>
</main>
<style>
#canvas {
border: 1px solid black;
margin: 15px;
}
#canvas-holder {
overflow: auto;
max-height: 800px;
min-height: 400px;
}
input[type="number"] {
width: 50px;
}
</style>
<!-- Footer -->
<footer id="footer">
<section class="about">
<h2>License</h2>
<p>
All text on this site is released under the
<a href="https://creativecommons.org/licenses/by/3.0/" target="_blank" rel="noreferrer noopener">CC BY 3.0</a>
license. Scripts are released under various free and open source
<a href="/licenses" rel="jslicense">licenses</a>. Source code is
available on
<a href="https://github.com/jojonium/josephpetitti.com">GitHub</a>.
</p>
</section>
<section class="contact">
<h2>Contact Information</h2>
<dl>
<dt>Email</dt>
<dd>
<a href="mailto:[email protected]">[email protected]</a>
<span class="gpg">(<a href="gpg">GPG Key</a>)</span>
</dd>
</dl>
<ul class="icons">
<li>
<a href="https://github.com/jojonium" target="_blank" rel="noreferrer noopener">
<span class="fab fa-github" title="GitHub"></span>
</a>
</li>
<li>
<a href="https://www.linkedin.com/in/joseph-petitti/" target="_blank" rel="noreferrer noopener">
<span class="fab fa-linkedin" title="LinkedIn"></span>
</a>
</li>
</ul>
</section>
</footer>
</body>
</html>