-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcustom.html
49 lines (38 loc) · 1.32 KB
/
custom.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Custom Sort Simulator</title>
<link rel="stylesheet" href="./assets/css/custom.css" />
</head>
<body>
<div class="wrapper">
<h1>Custom Sort Visualizer</h1>
<textarea id="userCode" rows="10" placeholder="// Viết code sắp xếp thuần (không cần delay, highlight, swap...)">
for (let i = 0; i < arr.length - 1; i++) {
for (let j = i + 1; j < arr.length; j++) {
if (arr[j] < arr[i]) {
swap(i, j);
}
}
}
</textarea>
<button id="runBtn">Chạy mô phỏng</button>
<div class="visual-area">
<div id="columns" class="columns"></div>
<pre id="codeView" class="code-view"></pre>
<div id="finalResult" class="result-line"></div>
</div>
<div class="array-control">
<label>Array Length:
<input type="number" id="arrayLength" min="2" max="50" value="5" />
</label>
<button id="generateBtn">Tạo mảng</button>
</div>
<label>Tốc độ: <input type="range" id="speedSlider" min="100" max="2000" step="100" value="800"> <span
id="speedValue">800</span> ms</label>
</div>
<script src="./assets/js/custom.js"></script>
</body>
</html>