-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
204 lines (184 loc) · 6.32 KB
/
Copy pathindex.html
File metadata and controls
204 lines (184 loc) · 6.32 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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta
name="description"
content="A Canvas-based visual algorithm studio with sorting, stack, queue, linked list, binary tree, and BFS pathfinding demos."
/>
<title>Visual Algorithm Studio</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800;900&family=JetBrains+Mono:wght@400;600;700&display=swap"
rel="stylesheet"
/>
<link rel="stylesheet" href="algo-styles.css" />
</head>
<body>
<div class="app-shell">
<aside class="sidebar">
<div class="brand">
<span class="brand-mark">VAS</span>
<div>
<h1>Visual Algorithm Studio</h1>
<p>Canvas DSA Lab</p>
</div>
</div>
<nav class="category-list" aria-label="Algorithm categories">
<button class="category-btn" type="button" data-category="SORTING">
SORTING
</button>
<button class="category-btn" type="button" data-category="QUEUE">
QUEUE
</button>
<button class="category-btn" type="button" data-category="STACK">
STACK
</button>
<button
class="category-btn"
type="button"
data-category="LINKED_LIST"
>
LINKED LIST
</button>
<button
class="category-btn"
type="button"
data-category="BINARY_TREE"
>
BINARY TREE
</button>
<button
class="category-btn"
type="button"
data-category="PATHFINDING"
>
PATHFINDING
</button>
</nav>
<div
class="algorithm-pills"
id="algorithmPills"
aria-label="Algorithms"
></div>
</aside>
<main class="main-area">
<section class="hero-panel">
<div>
<p class="eyebrow">Step-Based Algorithm Visualizer</p>
<h2 id="algorithmTitle">Bubble Sort Recorder</h2>
<p id="algorithmSubtitle">
Compare nearby values, swap when needed, and watch the largest
values move right.
</p>
</div>
<div class="step-counter" id="stepCounter">Step 00 / 00</div>
</section>
<section class="studio-grid">
<div class="canvas-card">
<canvas id="algorithmCanvas" width="900" height="440">
Your browser does not support Canvas.
</canvas>
<div class="control-bar">
<button id="playBtn" class="control-btn" type="button">
Play
</button>
<button id="pauseBtn" class="control-btn" type="button">
Pause
</button>
<button id="stepBackBtn" class="control-btn" type="button">
Back
</button>
<button id="stepForwardBtn" class="control-btn" type="button">
Next
</button>
<button id="resetBtn" class="control-btn danger" type="button">
Reset
</button>
<label class="speed-control">
Speed
<select id="speedSelect">
<option value="slow">Slow</option>
<option value="medium" selected>Medium</option>
<option value="fast">Fast</option>
</select>
</label>
</div>
</div>
<aside class="info-column">
<div class="info-card">
<h3>Algorithm Info</h3>
<div class="info-row">
<span>Name</span>
<strong id="infoName">Bubble Sort</strong>
</div>
<div class="badge-row">
<span class="complexity-badge time" id="timeComplexity"
>Time: O(n^2)</span
>
<span class="complexity-badge space" id="spaceComplexity"
>Space: O(1)</span
>
</div>
<p id="infoDescription">
Bubble Sort compares nearby values. Bigger values slowly move
right, like bubbles rising to the top.
</p>
</div>
<div class="info-card">
<h3>Data / Grid Input</h3>
<label class="input-label" for="dataInput"
>Numbers separated by commas</label
>
<input
id="dataInput"
class="data-input"
type="text"
value="34, 12, 45, 8, 67, 23"
/>
<div class="data-actions">
<button id="applyDataBtn" class="random-btn" type="button">
Use My Data
</button>
<button
id="randomBtn"
class="random-btn secondary"
type="button"
>
Random
</button>
</div>
<div class="grid-tools" id="gridTools">
<button
class="grid-tool active"
type="button"
data-mode="start"
>
START
</button>
<button class="grid-tool" type="button" data-mode="end">
END
</button>
<button class="grid-tool" type="button" data-mode="wall">
WALL
</button>
<button class="grid-tool" type="button" data-mode="erase">
ERASE
</button>
</div>
<div class="data-pills" id="dataPills"></div>
<p class="input-error" id="inputError"></p>
</div>
</aside>
</section>
<section class="explanation-panel">
<h3>Current Step</h3>
<p id="explanationText">Generate data or press play to begin.</p>
</section>
</main>
</div>
<script src="algo-script.js"></script>
</body>
</html>