-
Notifications
You must be signed in to change notification settings - Fork 0
/
nxn-puzzle.html
72 lines (70 loc) · 3.32 KB
/
nxn-puzzle.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Slider Puzzle demo</title>
<link rel="stylesheet" href="css/css-reset.css">
<link rel="stylesheet" href="css/common.css">
<link rel="stylesheet" href="css/nxn-puzzle.css">
<script src="https://use.fontawesome.com/cab85a48b2.js"></script>
<link href="https://fonts.googleapis.com/css?family=Stardos+Stencil" rel="stylesheet">
</head>
<body>
<header class="row">
<div class="col-4 title">
<a class="hamburger-menu fLeft" href="../project/index.html"><i class="fa fa-list-ul projectMenu"></i></a>
<h1>Slider puzzle</h1>
<p class="subtitle">3x3 <i class="fa fa-exchange"></i> 9x9</p>
</div>
<div class="col-8">
<div class="row">
<div class="col-8 text-right p0">
<span id="randomize" class="randomize"><i class="fa fa-random"></i> Randomize <span id="randomIterations"></span></span>
<span id="randomizeStop" class="randomize"><i class="fa fa-stop"></i></span>
</div>
<div class="col-4 text-right p0">
<label for="sizeSelector">Size: </label>
<select id="sizeSelector"></select>
</div>
</div>
</div>
</header>
<div class="explanation">
<div>You can change the size of the board using the selector in the top right corner [Available sizes: 3 x 3 to 9 x 9]
</div>
<div>You can switch tiles either by using the directional keys or by left-clicking on the empty tile</div>
<div>You can randomize the layout of the board by using the "Randomize button" (and the associated "STOP" icon) in the header area</div>
<div>There are some statistics in the footer area. When the puzzle is complete, a congratulations message appears</div>
</div>
<div class="puzzleContainer row">
<div class="block col-4" id="directionNameBoxContainer">
<span id="directionNameBox" class="block-child">_</span>
</div>
<div class="block col-4">
<div id="tilesContainer" class="block-child">
</div>
</div>
<div class="block col-4" id="directionalKeyboard">
<table class="block-child">
<tr><td colspan="3"><span class="up" data-keycode="38">↑</span></td></tr>
<tr>
<td><span class="left" data-keycode="37">←</span></td>
<td><span class="down" data-keycode="40">↓</span></td>
<td><span class="right" data-keycode="39">→</span></td>
</tr>
</table>
</div>
</div>
<footer class="text-center">
<div id="result" class="hidden">Congrats! You've just solved the puzzle!!!</div>
<div class="stats">
<span class="validTiles stat">Correct tiles: <span id="validTiles"></span></span>
<span class="invalidTiles stat">Incorrect tiles: <span id="invalidTiles"></span></span>
<span class="totalMoves stat">Total moves: <span id="totalMoves"></span></span>
</div>
</footer>
<script src="js/utils.js"></script>
<script src="js/nxn-puzzle.js"></script>
</body>
</html>