-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
272 lines (257 loc) · 10.3 KB
/
index.html
File metadata and controls
272 lines (257 loc) · 10.3 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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
<title>Queue Visualiser</title>
<link href="https://fonts.googleapis.com" rel="preconnect" />
<link crossorigin="" href="https://fonts.gstatic.com" rel="preconnect" />
<link
href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=swap"
rel="stylesheet"
/>
<script src="https://cdn.tailwindcss.com?plugins=forms,container-queries"></script>
<link rel="stylesheet" href="../shared.css" />
<link rel="stylesheet" href="style.css" />
<script>
tailwind.config = {
theme: {
extend: {
fontFamily: {
sans: ["Inter", "sans-serif"],
},
colors: {
primary: "#8b5cf6", // Violet 500
"primary-hover": "#7c3aed", // Violet 600
secondary: "#ec4899", // Pink 500
success: "#22c55e", // Green 500
warning: "#eab308", // Yellow 500
danger: "#ef4444", // Red 500
surface: "#ffffff",
background: "#f8fafc", // Slate 50
},
boxShadow: {
glass: "0 8px 32px 0 rgba(31, 38, 135, 0.07)",
card: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",
},
},
},
};
</script>
</head>
<body
class="bg-background text-slate-800 font-sans min-h-screen flex flex-col"
>
<nav class="app-nav">
<div class="nav-inner">
<a class="brand" href="../index.html">DS Visualisers</a>
<div class="links">
<a class="link" href="../Sorting Visualiser/index.html">Sorting</a>
<a class="link" href="../Stack Visualiser/index.html">Stack</a>
<a class="link" href="../Queue Visualiser/index.html">Queue</a>
<a class="link" href="../Linked List Visualiser/index.html">Linked List</a>
<a class="link" href="../Hash Table Visualiser/index.html">Hash Table</a>
<a class="link" href="../Heap Visualiser/index.html">Heap</a>
<a class="link" href="../BST Visualiser/index.html">BST</a>
</div>
</div>
</nav>
<!-- Header -->
<header
class="bg-surface/80 backdrop-blur-md border-b border-slate-200 sticky top-0 z-10"
>
<div
class="max-w-5xl mx-auto px-4 py-4 flex items-center justify-between"
>
<div class="flex items-center gap-3">
<div class="p-2 bg-primary/10 rounded-lg text-primary">
<span class="material-symbols-outlined">queue</span>
</div>
<h1 class="text-xl font-bold tracking-tight text-slate-900">
Queue Visualiser
</h1>
</div>
<a
href="../index.html"
class="text-sm font-medium text-slate-500 hover:text-slate-800 transition-colors flex items-center gap-1"
>
<span class="material-symbols-outlined text-[18px]">arrow_back</span>
Back
</a>
</div>
</header>
<main
class="flex-1 max-w-5xl mx-auto w-full p-4 md:p-8 grid md:grid-cols-[350px_1fr] gap-8"
>
<!-- Controls & Info Panel -->
<div class="flex flex-col gap-6">
<!-- Controls -->
<div
class="bg-surface p-6 rounded-2xl shadow-card border border-slate-100"
>
<h2 class="text-lg font-semibold mb-4 flex items-center gap-2">
<span class="material-symbols-outlined text-slate-400">tune</span>
Operations
</h2>
<div class="flex flex-col gap-4">
<!-- Enqueue Control -->
<div class="flex gap-2">
<input
type="text"
id="enqueue-input"
placeholder="Value"
maxlength="5"
class="flex-1 rounded-lg border-slate-200 focus:border-primary focus:ring-primary/20 text-sm"
autocomplete="off"
/>
<button
id="enqueue-btn"
class="bg-primary hover:bg-primary-hover text-white px-4 py-2 rounded-lg font-medium transition-colors flex items-center gap-2 shadow-sm shadow-violet-200"
>
<span class="material-symbols-outlined text-[20px]">add</span>
Enqueue
</button>
</div>
<div class="grid grid-cols-2 gap-2">
<button
id="dequeue-btn"
class="bg-white border border-slate-200 hover:border-danger hover:text-danger text-slate-700 px-4 py-2 rounded-lg font-medium transition-all flex items-center justify-center gap-2"
>
<span class="material-symbols-outlined text-[20px]"
>remove</span
>
Dequeue
</button>
<button
id="peek-btn"
class="bg-white border border-slate-200 hover:border-warning hover:text-warning text-slate-700 px-4 py-2 rounded-lg font-medium transition-all flex items-center justify-center gap-2"
>
<span class="material-symbols-outlined text-[20px]"
>visibility</span
>
Peek
</button>
</div>
<button
id="clear-btn"
class="w-full bg-slate-100 hover:bg-slate-200 text-slate-600 px-4 py-2 rounded-lg font-medium transition-colors flex items-center justify-center gap-2 mt-2"
>
<span class="material-symbols-outlined text-[20px]"
>delete_sweep</span
>
Clear Queue
</button>
<button
id="seed-btn"
class="w-full bg-white border border-slate-200 hover:border-secondary hover:text-secondary text-slate-700 px-4 py-2 rounded-lg font-medium transition-all flex items-center justify-center gap-2"
>
<span class="material-symbols-outlined text-[20px]">auto_awesome</span>
Seed Demo Queue
</button>
</div>
</div>
<!-- Info / Stats -->
<div
class="bg-surface p-6 rounded-2xl shadow-card border border-slate-100 flex-1"
>
<h2 class="text-lg font-semibold mb-4 flex items-center gap-2">
<span class="material-symbols-outlined text-slate-400">info</span>
Status
</h2>
<div class="space-y-4">
<div
class="flex justify-between items-center p-3 bg-slate-50 rounded-lg"
>
<span class="text-slate-500 text-sm font-medium">Size</span>
<span id="queue-size" class="text-slate-900 font-bold text-lg"
>0</span
>
</div>
<div class="grid grid-cols-2 gap-4">
<div
class="flex flex-col p-3 bg-slate-50 rounded-lg"
>
<span class="text-slate-500 text-xs font-medium uppercase">Front</span>
<span id="front-item" class="text-slate-900 font-bold text-lg"
>-</span
>
</div>
<div
class="flex flex-col p-3 bg-slate-50 rounded-lg"
>
<span class="text-slate-500 text-xs font-medium uppercase">Rear</span>
<span id="rear-item" class="text-slate-900 font-bold text-lg"
>-</span
>
</div>
</div>
<div class="p-3 bg-slate-50 rounded-lg min-h-[60px]">
<span
class="text-slate-500 text-xs font-bold uppercase tracking-wider block mb-1"
>Log</span
>
<p id="message-box" class="text-sm text-slate-600 leading-snug">
Ready to start.
</p>
</div>
</div>
</div>
</div>
<!-- Visualization Area -->
<div
class="bg-surface rounded-2xl shadow-card border border-slate-100 p-8 flex flex-col relative overflow-hidden"
>
<div
class="absolute inset-0 bg-[radial-gradient(#e5e7eb_1px,transparent_1px)] [background-size:16px_16px] opacity-40 pointer-events-none"
></div>
<div class="flex items-center justify-between mb-12 relative z-10">
<h2 class="text-lg font-semibold flex items-center gap-2">
<span class="material-symbols-outlined text-slate-400"
>view_kanban</span
>
Queue View
</h2>
<span
class="text-xs font-medium px-2 py-1 bg-slate-100 rounded text-slate-500"
>Max Capacity: 7</span
>
</div>
<!-- The Queue Channel -->
<div
class="flex-1 flex justify-center items-center relative z-10 min-h-[300px]"
>
<!-- Horizontal Container -->
<div
class="relative h-24 w-full max-w-2xl border-t-4 border-b-4 border-slate-300 bg-slate-50/50 flex flex-row items-center px-2 gap-2 transition-all overflow-hidden"
id="queue-container"
>
<!-- Items will be injected here -->
<div
class="text-slate-300 text-sm font-medium absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 pointer-events-none whitespace-nowrap"
id="empty-message"
>
Queue is Empty
</div>
</div>
<!-- Labels -->
<div class="absolute -top-8 left-0 text-slate-400 text-xs font-bold uppercase flex flex-col items-center">
<span>Front</span>
<span class="material-symbols-outlined text-sm">arrow_downward</span>
</div>
<div class="absolute -top-8 right-0 text-slate-400 text-xs font-bold uppercase flex flex-col items-center">
<span>Rear</span>
<span class="material-symbols-outlined text-sm">arrow_downward</span>
</div>
</div>
<div class="text-center text-slate-400 text-xs mt-4">
FIFO (First In, First Out)
</div>
</div>
</main>
<script src="script.js"></script>
</body>
</html>