-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
504 lines (456 loc) · 25.3 KB
/
Copy pathindex.html
File metadata and controls
504 lines (456 loc) · 25.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
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>算法可视化工具 - 直观理解算法原理</title>
<!-- Tailwind CSS -->
<script src="https://cdn.tailwindcss.com"></script>
<!-- Google Fonts -->
<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=Noto+Sans+SC:wght@300;400;500;700;900&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet">
<!-- Core Libraries -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/echarts@5.4.3/dist/echarts.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.7.0/p5.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@splidejs/splide@4.1.4/dist/js/splide.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/@splidejs/splide@4.1.4/dist/css/splide.min.css" rel="stylesheet">
<style>
:root {
--bg-primary: #1a1a2e;
--bg-secondary: #16213e;
--accent-cyan: #00d4ff;
--accent-orange: #ff6b35;
--accent-green: #4ecdc4;
--text-primary: #e0e0e0;
--text-secondary: #b0b0b0;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Noto Sans SC', sans-serif;
background: var(--bg-primary);
color: var(--text-primary);
overflow-x: hidden;
}
.hero-bg {
background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
position: relative;
overflow: hidden;
}
.hero-bg::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: url('./resources/hero-bg.jpg') center/cover;
opacity: 0.3;
z-index: 0;
}
.hero-content {
position: relative;
z-index: 1;
}
.gradient-text {
background: linear-gradient(135deg, var(--accent-cyan), var(--accent-green));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.card-hover {
transition: all 0.3s ease;
cursor: pointer;
}
.card-hover:hover {
transform: translateY(-8px) rotateX(5deg);
box-shadow: 0 20px 40px rgba(0, 212, 255, 0.2);
}
.glow-effect {
box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}
.floating-animation {
animation: float 6s ease-in-out infinite;
}
@keyframes float {
0%, 100% { transform: translateY(0px); }
50% { transform: translateY(-20px); }
}
.code-font {
font-family: 'JetBrains Mono', monospace;
}
.nav-link {
position: relative;
transition: color 0.3s ease;
}
.nav-link::after {
content: '';
position: absolute;
bottom: -4px;
left: 0;
width: 0;
height: 2px;
background: var(--accent-cyan);
transition: width 0.3s ease;
}
.nav-link:hover::after {
width: 100%;
}
.feature-icon {
width: 60px;
height: 60px;
background: linear-gradient(135deg, var(--accent-cyan), var(--accent-green));
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 24px;
margin-bottom: 16px;
}
.stats-number {
font-size: 2.5rem;
font-weight: 900;
color: var(--accent-cyan);
}
</style>
</head>
<body>
<!-- Navigation -->
<nav class="fixed top-0 left-0 right-0 z-50 bg-gray-900/90 backdrop-blur-md border-b border-gray-800">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex items-center justify-between h-16">
<div class="flex items-center space-x-2">
<div class="w-8 h-8 bg-gradient-to-r from-cyan-400 to-green-400 rounded-lg flex items-center justify-center">
<span class="text-white font-bold text-sm">AV</span>
</div>
<span class="text-xl font-bold gradient-text">算法可视化</span>
</div>
<div class="hidden md:flex items-center space-x-8">
<a href="#home" class="nav-link text-gray-300 hover:text-white">首页</a>
<a href="sorting.html" class="nav-link text-gray-300 hover:text-white">排序算法</a>
<a href="search.html" class="nav-link text-gray-300 hover:text-white">搜索算法</a>
<a href="graph.html" class="nav-link text-gray-300 hover:text-white">图论算法</a>
<a href="dp.html" class="nav-link text-gray-300 hover:text-white">动态规划</a>
<a href="string.html" class="nav-link text-gray-300 hover:text-white">字符串算法</a>
<a href="greedy.html" class="nav-link text-gray-300 hover:text-white">贪心算法</a>
</div>
<button class="md:hidden text-gray-300 hover:text-white">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path>
</svg>
</button>
</div>
</div>
</nav>
<!-- Hero Section -->
<section id="home" class="hero-bg min-h-screen flex items-center pt-16">
<div class="hero-content max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-20">
<div class="grid lg:grid-cols-2 gap-12 items-center">
<div class="space-y-8">
<div class="space-y-4">
<h1 class="text-5xl lg:text-6xl font-black leading-tight">
<span class="gradient-text">算法可视化</span>
<br>
<span class="text-white">让编程更直观</span>
</h1>
<p class="text-xl text-gray-300 leading-relaxed max-w-2xl">
通过交互式动画和实时可视化,深入理解排序、搜索、图论等核心算法的工作原理。适合学生、教师和开发者的专业学习工具。
</p>
</div>
<div class="flex flex-col sm:flex-row gap-4">
<button onclick="scrollToSection('algorithms')" class="px-8 py-4 bg-gradient-to-r from-cyan-500 to-green-500 text-white font-semibold rounded-lg hover:from-cyan-600 hover:to-green-600 transform hover:scale-105 transition-all duration-300 glow-effect">
开始探索
</button>
<button onclick="window.open('https://github.com', '_blank')" class="px-8 py-4 border-2 border-cyan-500 text-cyan-500 font-semibold rounded-lg hover:bg-cyan-500 hover:text-white transition-all duration-300">
查看源码
</button>
</div>
<div class="flex items-center space-x-8 pt-4">
<div class="text-center">
<div class="stats-number">10+</div>
<div class="text-gray-400">算法类型</div>
</div>
<div class="text-center">
<div class="stats-number">实时</div>
<div class="text-gray-400">可视化</div>
</div>
<div class="text-center">
<div class="stats-number">交互</div>
<div class="text-gray-400">学习</div>
</div>
</div>
</div>
<div class="relative">
<div class="floating-animation">
<img src="./resources/coding-theme.png" alt="算法可视化" class="w-full h-auto rounded-2xl shadow-2xl">
</div>
<div class="absolute inset-0 bg-gradient-to-r from-cyan-500/20 to-green-500/20 rounded-2xl blur-3xl"></div>
</div>
</div>
</div>
</section>
<!-- Algorithm Categories -->
<section id="algorithms" class="py-20 bg-gray-900/50">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="text-center mb-16">
<h2 class="text-4xl font-black gradient-text mb-4">算法分类</h2>
<p class="text-xl text-gray-300 max-w-3xl mx-auto">
选择你感兴趣的算法类型,开始深入学习之旅
</p>
</div>
<div class="grid md:grid-cols-2 lg:grid-cols-4 gap-8">
<!-- Sorting Algorithms -->
<div class="card-hover bg-gray-800/50 backdrop-blur-sm rounded-2xl p-8 border border-gray-700" onclick="window.location.href='sorting.html'">
<div class="feature-icon">
<svg class="w-8 h-8 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4"></path>
</svg>
</div>
<h3 class="text-2xl font-bold mb-4">排序算法</h3>
<p class="text-gray-400 mb-6">
冒泡排序、快速排序、归并排序等经典排序算法的可视化演示
</p>
<div class="flex items-center text-cyan-400 font-semibold">
<span>开始学习</span>
<svg class="w-4 h-4 ml-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path>
</svg>
</div>
</div>
<!-- Search Algorithms -->
<div class="card-hover bg-gray-800/50 backdrop-blur-sm rounded-2xl p-8 border border-gray-700" onclick="window.location.href='search.html'">
<div class="feature-icon">
<svg class="w-8 h-8 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path>
</svg>
</div>
<h3 class="text-2xl font-bold mb-4">搜索算法</h3>
<p class="text-gray-400 mb-6">
线性搜索、二分搜索等搜索算法的原理和性能对比
</p>
<div class="flex items-center text-cyan-400 font-semibold">
<span>开始学习</span>
<svg class="w-4 h-4 ml-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path>
</svg>
</div>
</div>
<!-- Graph Algorithms -->
<div class="card-hover bg-gray-800/50 backdrop-blur-sm rounded-2xl p-8 border border-gray-700" onclick="window.location.href='graph.html'">
<div class="feature-icon">
<svg class="w-8 h-8 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"></path>
</svg>
</div>
<h3 class="text-2xl font-bold mb-4">图论算法</h3>
<p class="text-gray-400 mb-6">
BFS、DFS、最短路径等图论算法的可视化学习
</p>
<div class="flex items-center text-cyan-400 font-semibold">
<span>开始学习</span>
<svg class="w-4 h-4 ml-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path>
</svg>
</div>
</div>
<!-- Dynamic Programming -->
<div class="card-hover bg-gray-800/50 backdrop-blur-sm rounded-2xl p-8 border border-gray-700" onclick="window.location.href='dp.html'">
<div class="feature-icon">
<svg class="w-8 h-8 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"></path>
</svg>
</div>
<h3 class="text-2xl font-bold mb-4">动态规划</h3>
<p class="text-gray-400 mb-6">
斐波那契数列、背包问题、最长公共子序列等动态规划经典问题
</p>
<div class="flex items-center text-cyan-400 font-semibold">
<span>开始学习</span>
<svg class="w-4 h-4 ml-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path>
</svg>
</div>
</div>
</div>
</div>
</section>
<!-- Features Section -->
<section class="py-20">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="text-center mb-16">
<h2 class="text-4xl font-black gradient-text mb-4">核心特性</h2>
<p class="text-xl text-gray-300 max-w-3xl mx-auto">
专业的算法学习工具,让复杂的算法变得简单易懂
</p>
</div>
<div class="grid lg:grid-cols-3 gap-12">
<div class="text-center space-y-6">
<div class="w-20 h-20 bg-gradient-to-r from-cyan-500 to-green-500 rounded-3xl flex items-center justify-center mx-auto">
<svg class="w-10 h-10 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path>
</svg>
</div>
<h3 class="text-2xl font-bold">实时可视化</h3>
<p class="text-gray-400 leading-relaxed">
每一步算法执行都有对应的动画展示,让你看到数据是如何变化的,真正理解算法的执行过程。
</p>
</div>
<div class="text-center space-y-6">
<div class="w-20 h-20 bg-gradient-to-r from-orange-500 to-red-500 rounded-3xl flex items-center justify-center mx-auto">
<svg class="w-10 h-10 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4"></path>
</svg>
</div>
<h3 class="text-2xl font-bold">交互式控制</h3>
<p class="text-gray-400 leading-relaxed">
自由调整算法执行速度,随时暂停、重置,还可以自定义输入数据,完全掌控学习节奏。
</p>
</div>
<div class="text-center space-y-6">
<div class="w-20 h-20 bg-gradient-to-r from-purple-500 to-pink-500 rounded-3xl flex items-center justify-center mx-auto">
<svg class="w-10 h-10 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"></path>
</svg>
</div>
<h3 class="text-2xl font-bold">性能分析</h3>
<p class="text-gray-400 leading-relaxed">
实时显示算法的时间复杂度、空间复杂度,以及各种操作的具体次数,深入理解算法效率。
</p>
</div>
</div>
</div>
</section>
<!-- Demo Section -->
<section class="py-20 bg-gray-900/50">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="text-center mb-16">
<h2 class="text-4xl font-black gradient-text mb-4">算法演示</h2>
<p class="text-xl text-gray-300">
看看算法可视化是如何工作的
</p>
</div>
<div class="grid lg:grid-cols-2 gap-12 items-center">
<div>
<h3 class="text-3xl font-bold mb-6">冒泡排序演示</h3>
<p class="text-gray-300 mb-8 leading-relaxed">
通过动画直观地看到冒泡排序的工作原理:相邻元素两两比较,大的元素逐渐"冒泡"到数组末尾。每次比较和交换都有清晰的视觉反馈。
</p>
<div class="space-y-4">
<div class="flex items-center space-x-4">
<div class="w-4 h-4 bg-cyan-500 rounded-full"></div>
<span class="text-gray-300">当前比较的元素</span>
</div>
<div class="flex items-center space-x-4">
<div class="w-4 h-4 bg-green-500 rounded-full"></div>
<span class="text-gray-300">已排序的元素</span>
</div>
<div class="flex items-center space-x-4">
<div class="w-4 h-4 bg-orange-500 rounded-full"></div>
<span class="text-gray-300">正在交换的元素</span>
</div>
</div>
</div>
<div class="relative">
<img src="./resources/sorting-animation.png" alt="排序算法演示" class="w-full h-auto rounded-2xl shadow-2xl">
<div class="absolute inset-0 bg-gradient-to-r from-cyan-500/10 to-green-500/10 rounded-2xl"></div>
</div>
</div>
</div>
</section>
<!-- Footer -->
<footer class="bg-gray-900 border-t border-gray-800 py-12">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="text-center">
<div class="flex items-center justify-center space-x-2 mb-4">
<div class="w-8 h-8 bg-gradient-to-r from-cyan-400 to-green-400 rounded-lg flex items-center justify-center">
<span class="text-white font-bold text-sm">AV</span>
</div>
<span class="text-xl font-bold gradient-text">算法可视化</span>
</div>
<p class="text-gray-400 mb-6">
让算法学习变得简单有趣
</p>
<div class="flex items-center justify-center space-x-6 mb-6">
<a href="#" class="text-gray-400 hover:text-cyan-400 transition-colors">
<svg class="w-6 h-6" fill="currentColor" viewBox="0 0 24 24">
<path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"/>
</svg>
</a>
<a href="#" class="text-gray-400 hover:text-cyan-400 transition-colors">
<svg class="w-6 h-6" fill="currentColor" viewBox="0 0 24 24">
<path d="M23.953 4.57a10 10 0 01-2.825.775 4.958 4.958 0 002.163-2.723c-.951.555-2.005.959-3.127 1.184a4.92 4.92 0 00-8.384 4.482C7.69 8.095 4.067 6.13 1.64 3.162a4.822 4.822 0 00-.666 2.475c0 1.71.87 3.213 2.188 4.096a4.904 4.904 0 01-2.228-.616v.06a4.923 4.923 0 003.946 4.827 4.996 4.996 0 01-2.212.085 4.936 4.936 0 004.604 3.417 9.867 9.867 0 01-6.102 2.105c-.39 0-.779-.023-1.17-.067a13.995 13.995 0 007.557 2.209c9.053 0 13.998-7.496 13.998-13.985 0-.21 0-.42-.015-.63A9.935 9.935 0 0024 4.59z"/>
</svg>
</a>
</div>
<p class="text-gray-500 text-sm">
© 2025 Kaleb. 保留所有权利.
</p>
</div>
</div>
</footer>
<script>
// Smooth scrolling function
function scrollToSection(sectionId) {
document.getElementById(sectionId).scrollIntoView({
behavior: 'smooth'
});
}
// Coming soon popup
function showComingSoon() {
alert('动态规划模块正在开发中,敬请期待!');
}
// Initialize animations
document.addEventListener('DOMContentLoaded', function() {
// Animate cards on scroll
const cards = document.querySelectorAll('.card-hover');
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
anime({
targets: entry.target,
translateY: [50, 0],
opacity: [0, 1],
duration: 800,
easing: 'easeOutQuart',
delay: anime.stagger(200)
});
}
});
}, { threshold: 0.1 });
cards.forEach(card => observer.observe(card));
// Animate stats numbers
const statsNumbers = document.querySelectorAll('.stats-number');
statsNumbers.forEach(stat => {
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
anime({
targets: entry.target,
scale: [0.8, 1],
opacity: [0, 1],
duration: 1000,
easing: 'easeOutElastic(1, .8)'
});
}
});
}, { threshold: 0.5 });
observer.observe(stat);
});
});
// Navbar scroll effect
window.addEventListener('scroll', function() {
const nav = document.querySelector('nav');
if (window.scrollY > 100) {
nav.classList.add('bg-gray-900/95');
} else {
nav.classList.remove('bg-gray-900/95');
}
});
</script>
</body>
</html>