-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpathfinding.html
More file actions
169 lines (159 loc) · 5.86 KB
/
pathfinding.html
File metadata and controls
169 lines (159 loc) · 5.86 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Tile Grid</title>
<link rel="stylesheet" href="style.css">
</head>
<body class="path">
<div class="grid-container"></div>
<script>
const gridContainer = document.querySelector('.grid-container');
const width = gridContainer.offsetWidth;
const height = width * 15 / 37; // Set height to be 15/37 of the width
gridContainer.style.height = `${height}px`; // Set the height of the container using the style property
</script>
<div class="bottom-container">
<div class="container">
<div class="algorithm-container">
<div class="button-container">
<button class="alg-buttons" onclick="bfs()">BFS</button>
<button class="alg-buttons" onclick="dfs()">DFS</button>
</div>
<div class="button-container">
<button class="alg-buttons" onclick="dijkstra('euclidean')">Dijkstra Euclidean</button>
<button class="alg-buttons" onclick="dijkstra('manhattan')">Dijkstra Manhattan</button>
</div>
<div class="button-container">
<button class="alg-buttons" onclick="aStar('euclidean')">A* Euclidean</button>
<button class="alg-buttons" onclick="aStar('manhattan')">A* Manhattan</button>
</div>
<div class="button-container">
<button class="alg-buttons" onclick="greedyBFS('euclidean')">Greedy BFS Euclidean</button>
<button class="alg-buttons" onclick="greedyBFS('manhattan')">Greedy BFS Manhattan</button>
</div>
</div>
<div class="main-button-container">
<div class="tile-button-container">
<div class="tile-button-icons">
<button class="tilebut1" onclick="changeColor('green')">Start Tile</button>
<button class="tilebut2" onclick="changeColor('red')">End Tile</button>
<button class="tilebut3" onclick="changeColor('black')">Wall Tile</button>
</div>
<div class="info-stuff">
<button data-info-target="#info" class="alg-buttons">How to Use</button>
</div>
</div>
</div>
<div class="maze-random-container">
<div class="maze-reset">
<div class="maze-button">
<button class="alg-buttons" onclick="maze()">Create Maze</button>
</div>
<div class="reset-button">
<button class="alg-buttons" onclick="reset()">Reset</button>
</div>
</div>
<div class="input-container">
<div class="text-slider">
<label for="mySlider" onclick="updateRandom()">Random Tilemap</label>
</div>
<div class="slider-container">
<input class="range-style" type="range" min="0.1" max="0.25" step="0.01" value="0.175" id="mySlider" onchange="updateRandom()">
</div>
</div>
<div class="sorting-button">
<button class="alg-buttons">
<a href="sorting.html" style="color: inherit; text-decoration: none;">Sorting Algorithm Visualizer</a>
</button>
<button class="alg-buttons" id="source-code">
<a href="/" target="_self" style="color: inherit; text-decoration: none;">Back</a>
</button>
</div>
</div>
</div>
</div>
<div class="info" id="info">
<div class="page1">
<div class="info-header">
<div class="info-title">How to Use</div>
<button data-close-button class="close-button">×</button>
</div>
<div class="info-body">
<div class="info-body-text">
<div class="start-info">
<div class="info-sub-text">
To set the starting point, click on the Start Tile button and then click on any tile
</div>
<button class="tilebut1">Start Tile</button>
</div>
<div class="end-info">
<div class="info-sub-text">
To set the ending point, click on the End Tile button and then click on any tile
</div>
<button class="tilebut2">End Tile</button>
</div>
<div class="wall-info">
<div class="info-sub-text">
To set the walls, click on the Wall Tile button and then click or drag on any tile
</div>
<button class="tilebut3">Wall Tile</button>
</div>
<div class="start-alg-info">
Click any of the algorithms to visualize how they work
</div>
</div>
<div class="right-side-container">
<div class="part1-gif-container">
<img class="part1-gif" src="videos/part1.gif" alt="animated GIF">
</div>
<div class="info-footer-page2">
<button class="alg-buttons" onclick="togglePages()">Advanced Features --></button>
</div>
</div>
</div>
</div>
<div class="page2" id="advanced-info" style="display: none;">
<div class="info-header">
<div class="info-title">Advanced Features</div>
<button data-close-button class="close-button">×</button>
</div>
<div class="info-body">
<div class="info-body-text-page2">
<div class="drag-info">
<div class="info-sub-text">
After running an algorithm, you can visualize it from various angles by dragging the start or end positions
</div>
</div>
<div class="maze-info">
<div class="info-sub-text">
Click the Create Maze button to create a random maze using the Depth First Search algorithm
</div>
<button class="alg-buttons">Create Maze</button>
</div>
<div class="random-info">
<div class="info-sub-text">
Click or drag the Random Tilemap Slider to set a random tilemap with a lower or higher ratio of walls
</div>
<div class="input-container">
<div class="text-slider">
<label for="mySlider">Random Tilemap</label>
</div>
<div class="slider-container">
<input class="range-style" type="range" min="0.1" max="0.25" step="0.01" value="0.175" id="mySlider">
</div>
</div>
</div>
</div>
<div class="right-side-container">
<img class="part2-gif" src="videos/part2.gif" alt="animated GIF">
</div>
</div>
<div class="info-footer-page1">
<button class="alg-buttons" onclick="resetPages()"><-- How to Use</button>
</div>
</div>
</div>
<div id="overlay"></div>
<script src="js/index.js"></script>
</body>
</html>