-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
51 lines (45 loc) · 1.66 KB
/
index.html
File metadata and controls
51 lines (45 loc) · 1.66 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/addons/p5.sound.min.js"></script>
<link rel="stylesheet" type="text/css" href="style.css">
<meta charset="utf-8" />
<script src="./dataStructure.js"></script>
<script src="./map.js" ></script>
</head>
<body>
<script>
//get DPI
function fix_dpi() {
let dpi = window.devicePixelRatio;
//get canvas
let canvas = document.getElementById('defaultCanvas0');
//get context
let ctx = canvas.getContext('2d');
//get CSS height
//the + prefix casts it to an integer
//the slice method gets rid of "px"
let style_height = getComputedStyle(canvas).getPropertyValue("height").slice(0, -2);
//get CSS width
let style_width = getComputedStyle(canvas).getPropertyValue("width").slice(0, -2);
//scale the canvas
canvas.setAttribute('height', style_height * dpi);
canvas.setAttribute('width', style_width * dpi);
}
</script>
<div id="inp_setup">
<label for="search_algorithm">Search Algorithms</label><br>
<select id="algorithms">
<option value = "BFS">BFS</option>
<option value = "DFS">DFS</option>
<option value = "GULOSO">GULOSO</option>
<option value = "A*">A*</option>
<option value = "CUSTO_UNIFORME">CUSTO UNIFORME</option>
</select>
<br>
<br> <br><br>
<button id="botao">Reset map</button>
</div>
</body>
</html>