-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
55 lines (54 loc) · 1.87 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="css/style.css" />
<title>A * in plain js</title>
</head>
<body>
<div class="header">
<h1 class="">A *</h1>
<p class="sub-header">Visual representation of the A* algorithm in plain js</p>
</div>
<canvas id="canvas" width="1000" height="1000"></canvas>
<div class="footer grid">
<div>
<label for="heuristic" id="grp-box-label">Choose heuristic distance h(n):</label>
<select name="heuristic" id="heuristic-distance">
<option value="manhattan">Manhattan</option>
<option value="diagonal">Diagonal</option>
<option value="euclidean">Euclidean</option>
</select>
</div>
<div>
<label for="speed">Animation Speed:</label>
<input type="number" id="speed" placeholder="Seconds" value="0.25" />
</div>
<div>
<label for="startposition">Start Node Position:</label>
<input type="number" id="start-node-x" class="node" value="1" />
<input type="number" id="start-node-y" class="node" value="1" />
</div>
<div>
<label for="endposition">End Node Position:</label>
<input type="number" id="end-node-x" class="node" value="48" />
<input type="number" id="end-node-y" class="node" value="48" />
</div>
<div>
<button class="std-btn" id="randomize-nodes">Randomize Start and End</button>
</div>
<p id="message">#</p>
<div>
<button class="std-btn" onclick="startAlgo()">Start A*</button>
<button class="std-btn" onclick="resetAlgo()">Reset</button>
</div>
<!-- <div>
<button class="std-btn" onclick="startDraw()">Start Draw</button>
<button class="std-btn" onclick="resetCanvas()">Reset Canvas</button>
</div> -->
<p>@github.com/johnkesko</p>
</div>
<script type="module" src="js/main.js"></script>
</body>
</html>