-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmerge.html
More file actions
80 lines (70 loc) · 1.67 KB
/
merge.html
File metadata and controls
80 lines (70 loc) · 1.67 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
<!DOCTYPE html>
<html>
<head>
<title>Merge Sort Visualization</title>
<style>
body {
font-family: Arial, sans-serif;
}
div {
margin-bottom: 10px;
}
.container {
display: flex;
justify-content: center;
}
.array-container, .comparison-container {
display: flex;
flex-direction: column-reverse; /* Display bars from top to bottom */
align-items: flex-start;
}
.array-element, .comparison-element {
height: 30px;
background-color: #0074D9;
text-align: center;
line-height: 30px;
color: white;
transition: width 0.3s;
margin: 2px;
}
.comparison-element {
background-color: #FF4136; /* Red color for comparisons */
}
input[type="text"] {
width: 200px;
padding: 5px;
border: 1px solid #ccc;
border-radius: 5px;
}
button {
padding: 5px 10px;
background-color: #0074D9;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
button:hover {
background-color: #0056A7;
}
label {
margin-right: 10px;
}
</style>
</head>
<body>
<div>
<input type="text" id="array-input" placeholder="Enter values (e.g., 4 7 2 8 1 6 9 5 3)">
<button id="sort-button">Sort</button>
<button id="reset-button">Reset</button>
<label for="speed-slider">Speed:</label>
<input type="range" id="speed-slider" min="1" max="1000" value="500">
<span id="speed-label">Speed: 500ms</span>
</div>
<div class="container">
<div class="array-container" id="array-container"></div>
<div class="comparison-container" id="comparison-container"></div>
</div>
<script src="merge_sort_visualization.js"></script>
</body>
</html>