-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
183 lines (175 loc) · 6.24 KB
/
index.html
File metadata and controls
183 lines (175 loc) · 6.24 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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/x-icon" href="./src/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Sorting Algorithms — Visualization</title>
<script
defer
src="https://stats.pyxel.dev/script.js"
data-website-id="390fb951-b77d-490b-afe4-28e3f75f1aaf"
></script>
</head>
<body>
<div id="app">
<!-- Header -->
<header>
<div class="header-left">
<h1 id="app-title">Sorting Algorithms</h1>
<p id="app-subtitle">
Visualize how different algorithms organize data, step by step
</p>
</div>
<!-- Theme & Language switchers -->
<div class="header-right">
<select id="theme-palette-select" class="lang-select">
<option value="mono" id="opt-theme-mono">⚫ Mono</option>
<option value="orange" id="opt-theme-orange">🟠 Orange</option>
<option value="blue" id="opt-theme-blue">🔵 Blue</option>
<option value="green" id="opt-theme-green">🟢 Green</option>
<option value="yellow" id="opt-theme-yellow">🟡 Yellow</option>
</select>
<div id="theme-switcher" class="theme-switcher">
<button data-theme="light" class="theme-btn" title="Light">
☀️
</button>
<button data-theme="auto" class="theme-btn active" title="Auto">
💻
</button>
<button data-theme="dark" class="theme-btn" title="Dark">🌙</button>
</div>
<select id="lang-select" class="lang-select">
<option value="en">🇬🇧 English</option>
<option value="fr">🇫🇷 Français</option>
</select>
</div>
</header>
<!-- Algorithm selector -->
<nav class="algo-selector" id="algo-selector"></nav>
<!-- Algorithm info -->
<div id="algo-info" class="algo-info hidden">
<h3 id="algo-info-name"></h3>
<p id="algo-info-desc"></p>
<div id="algo-info-complexity" class="complexity-row"></div>
</div>
<!-- Performance warning -->
<div id="perf-warning" class="perf-warning hidden">
⚠️ <span id="perf-warning-text"></span>
</div>
<!-- Canvas -->
<div class="canvas-wrapper">
<canvas id="canvas"></canvas>
</div>
<!-- Controls bar -->
<div class="controls-bar">
<div class="flex items-center gap-6">
<!-- Sliders -->
<div class="flex items-center gap-2">
<label id="label-size" class="slider-label">Size</label>
<input
type="range"
id="size-slider"
min="10"
max="1000"
value="50"
class="slider"
/>
<span id="size-value" class="slider-val">50</span>
</div>
<div class="flex items-center gap-2">
<label id="label-speed" class="slider-label">Speed</label>
<input
type="range"
id="speed-slider"
min="1"
max="100"
value="60"
class="slider"
/>
<span id="speed-value" class="slider-val">60</span>
</div>
<div class="flex items-center gap-2">
<label
id="label-colors"
class="slider-label"
for="color-mode-select"
>Colors</label
>
<select id="color-mode-select" class="select-control">
<option value="default" id="opt-color-default">Default</option>
<option value="grayscale" id="opt-color-grayscale">
Grayscale gradient
</option>
<option value="spectrum" id="opt-color-spectrum">
Red → Blue spectrum
</option>
</select>
</div>
</div>
<!-- Buttons -->
<div class="flex items-center gap-2">
<button id="btn-start" class="ctrl-btn ctrl-btn--primary">
▶ Start
</button>
<button id="btn-step" class="ctrl-btn">⏭ Step</button>
<button id="btn-shuffle" class="ctrl-btn">🔀 Shuffle</button>
<button id="btn-mute" class="ctrl-btn" title="Sound">🔊</button>
<button id="btn-about" class="ctrl-btn" title="About">ℹ️</button>
</div>
</div>
<!-- About dialog -->
<dialog id="about-dialog" class="about-dialog">
<div class="about-dialog-content">
<h3 id="about-title">About</h3>
<dl class="about-details">
<dt id="about-label-version">Version</dt>
<dd id="about-version"></dd>
<dt id="about-label-author">Author</dt>
<dd id="about-author"></dd>
<dt id="about-label-website">Website</dt>
<dd>
<a
id="about-website"
href=""
target="_blank"
rel="noopener noreferrer"
></a>
</dd>
<dt id="about-label-repo">Repository</dt>
<dd>
<a
id="about-repo"
href=""
target="_blank"
rel="noopener noreferrer"
></a>
</dd>
</dl>
<button
id="about-close"
class="ctrl-btn ctrl-btn--primary about-close-btn"
>
OK
</button>
</div>
</dialog>
<!-- Stats + Legend bar -->
<div class="stats-bar">
<div class="stat-item">
<span id="label-comparisons" class="stat-label">Comparisons</span>
<span id="stat-comparisons" class="stat-value">0</span>
</div>
<div class="stat-item">
<span id="label-swaps" class="stat-label">Swaps</span>
<span id="stat-swaps" class="stat-value">0</span>
</div>
<div class="stat-item">
<span id="label-status" class="stat-label">Status</span>
<span id="stat-status" class="stat-value stat-status">Ready</span>
</div>
</div>
</div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>