-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
716 lines (629 loc) · 25.7 KB
/
index.php
File metadata and controls
716 lines (629 loc) · 25.7 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
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
<?php
session_start();
require 'db.php';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Anime World</title>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">
<link rel="stylesheet" href="styles_m.css" />
</head>
<body>
<header class="navbar">
<div class="logo">AnimeWorld</div>
<nav style="margin-right: 90px;">
<a href="#">Home</a>
<a href="#anime-list">Browse</a>
<a href="#continue-watching">Continue</a>
</nav>
</header>
<h1>Anime World</h1>
<div class="top-bar">
<div class="left-section">
<p class="welcome-text" style="font-size: 25px;">Welcome, <?php echo htmlspecialchars($_SESSION['username']); ?>!
</p>
</div>
<div class="center-section">
<div class="search-box">
<input type="text" id="search-input" placeholder="Search anime...">
<span class="search-icon">🔍</span>
<div id="suggestions" style="color: white;"></div>
</div>
</div>
<div class="right-section">
<a href="profile.php"><i class="fas fa-user nav-icon"></i></a>
<button class="logout-btn" onclick="window.location.href='logout.php'">Logout</button>
<!-- JS will populate this dynamically -->
</section>
<div class="dropdown">
<button class="filter-btn">Select Category</button>
<div class="dropdown-content">
<button class="filter-btn" data-category="all">All</button>
<button class="filter-btn" data-category="Action">Action</button>
<button class="filter-btn" data-category="Adventure">Adventure</button>
<button class="filter-btn" data-category="Fantasy">Fantasy</button>
<button class="filter-btn" data-category="Thriller">Thriller</button>
<button class="filter-btn" data-category="Mystery">Mystery</button>
<button class="filter-btn" data-category="Romance">Romance</button>
<button class="filter-btn" data-category="Sci-Fi">Sci-Fi</button>
</div>
</div>
</div>
</div>
<main id="anime-list">
<?php
$categories = [
// category data stays unchanged
"Action" => [
["AOT.jpg", "Attack on Titan", "Action, Drama"],
["D_S.jpg", "Demon Slayer", "Action, Fantasy"],
["mha.jpg", "My Hero Academia", "Action, Superpower"],
["TR.jpg", "Tokyo Revengers", "Action, Thriller"],
["bleach.jpg", "Bleach", "Action, Supernatural"],
["jjk.jpg", "Jujutsu Kaisen", "Action, Dark Fantasy"],
["naruto.jpg", "Naruto", "Action, Ninja"]
],
"Adventure" => [
["O_P.jpg", "One Piece", "Adventure, Fantasy"],
["dragon.jpg", "Dragon Ball", "Adventure, Action"],
["hunter.jpg", "Hunter x Hunter", "Adventure, Shounen"],
["sao.jpg", "Sword Art Online", "Adventure, Sci-Fi"],
["magi.jpg", "Magi", "Adventure, Fantasy"]
],
"Thriller" => [
["D_N.jpg", "Death Note", "Mystery, Thriller"],
["monster.jpg", "Monster", "Psychological, Thriller"],
["PA.jpg", "Paranoia Agent", "Thriller, Mystery"],
["tokyoghoul.jpg", "Tokyo Ghoul", "Thriller, Horror"]
],
"Sci-Fi" => [
["SG.jpg", "Steins;Gate", "Sci-Fi, Thriller"],
["psycho.jpg", "Psycho-Pass", "Sci-Fi, Action"],
["evangelion.jpg", "Evangelion", "Sci-Fi, Mecha"],
["gintama.jpg", "Gintama", "Sci-Fi, Comedy"]
],
"Romance" => [
["YourName.jpg", "Your Name", "Romance, Drama"],
["ASV.jpg", "A Silent Voice", "Romance, Drama"],
["toradora.jpg", "Toradora!", "Romance, Comedy"],
["clannad.jpg", "Clannad", "Romance, Slice of Life"]
]
];
foreach ($categories as $category => $animes) {
echo "<h2 class='category-heading'>{$category}</h2><div class='anime-grid'>";
foreach ($animes as $anime) {
[$img, $name, $genre] = $anime;
$animeURL = urlencode($name);
echo "<div class='anime-card' data-category='{$category}'>
<a href='watch.php?anime={$animeURL}&episode=1' style='text-decoration: none; color: inherit;'>
<img src='{$img}' alt='{$name}' />
<div class='anime-info'>
<h2 class='anime-title'>{$name}</h2>
<p class='anime-genre'>Genre: {$genre}</p>
</div>
</a>
</div>";
}
echo "</div>";
}
?>
</main>
<footer>
<p>© 2025 Anime Showcase. All rights reserved.</p>
</footer>
<!-- Scripts and interactions remain unchanged -->
<script>
// Category Filter
document.querySelectorAll(".filter-btn").forEach(button => {
button.addEventListener("click", () => {
document.querySelectorAll(".filter-btn").forEach(b => b.classList.remove("active"));
button.classList.add("active");
const category = button.dataset.category;
document.querySelectorAll(".anime-card").forEach(card => {
card.style.display = category === "all" || card.dataset.category.toLowerCase().includes(category.toLowerCase()) ? "block" : "none";
});
});
});
document.addEventListener("DOMContentLoaded", () => {
const dropdownBtn = document.querySelector(".dropdown > .filter-btn");
const dropdownContent = document.querySelector(".dropdown-content");
dropdownBtn.addEventListener("click", () => {
dropdownContent.style.display =
dropdownContent.style.display === "block" ? "none" : "block";
});
window.addEventListener("click", (e) => {
if (!document.querySelector(".dropdown").contains(e.target)) {
dropdownContent.style.display = "none";
}
});
});
// Scroll animation
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
entry.target.classList.toggle("visible", entry.isIntersecting);
});
}, { threshold: 0.1 });
document.querySelectorAll(".anime-card").forEach(card => observer.observe(card));
// Load last watched anime
function loadProgress() {
fetch('get_progress.php')
.then(res => res.json())
.then(data => {
if (data.status === 'success') {
const continueDiv = document.getElementById('continue-watching');
continueDiv.innerHTML = `
<p>Last watched: <strong>${data.anime_name}</strong> - Episode ${data.episode_number}</p>
<button onclick="window.location.href='watch.php?anime=${encodeURIComponent(data.anime_name)}&episode=${data.episode_number}'">
Continue Watching
</button>
`;
}
});
}
window.onload = loadProgress;
// Anime Effects
document.querySelectorAll(".anime-card").forEach((card) => {
card.addEventListener("click", (event) => {
event.preventDefault();
const title = card.querySelector("h2").innerText;
const link = card.querySelector("a").href;
let delay = 2500;
if (title.includes("Attack on Titan")) showTitanEffect();
else if (title.includes("Dragon Ball")) showDragonBallEffect();
else if (title.includes("Demon Slayer")) showSwordSlashEffect();
else if (title.includes("Death Note") || title.includes("Monster") || title.includes("Paranoia Agent") || title.includes("Tokyo Ghoul")) {
showDarkEffect(link);
return;
}
else if (title.includes("One Piece")) showBubbleEffect();
else if (title.includes("My Hero Academia")) showSmashEffect();
else if (title.includes("Tokyo Revengers")) showGlitchEffect();
else if (title.includes("Bleach")) showGetsugaEffect();
else if (title.includes("Jujutsu Kaisen")) showCursedEffect();
else if (title.includes("Naruto")) showRasenganEffect();
else if (title.includes("Hunter x Hunter")) showNenEffect();
else if (title.includes("Sword Art Online")) showLinkStartEffect();
else if (title.includes("Magi")) showRukhEffect();
else if (title.includes("Steins;Gate")) showTimeTravelEffect();
else if (title.includes("Psycho-Pass")) showDominatorEffect();
else if (title.includes("Evangelion")) showATFieldEffect();
else if (title.includes("Gintama")) showComedyEffect();
else if (['Your Name', 'A Silent Voice', 'Toradora', 'Clannad'].some(t => title.includes(t))) showRomanceEffect();
else {
window.location.href = link;
return;
}
setTimeout(() => {
window.location.href = link;
}, delay);
});
});
function showTitanEffect() {
document.body.classList.add("screen-shake");
setTimeout(() => document.body.classList.remove("screen-shake"), 2500);
}
function showDragonBallEffect() {
const ball = document.createElement("div");
ball.classList.add("dragon-ball-effect");
document.body.appendChild(ball);
setTimeout(() => ball.remove(), 2500);
}
function showSwordSlashEffect() {
const slash = document.createElement("div");
slash.classList.add("sword-slash-effect");
document.body.appendChild(slash);
setTimeout(() => slash.remove(), 1500);
}
function showDarkEffect(link) {
const overlay = document.createElement("div");
overlay.classList.add("death-note-fade");
const text = document.createElement("div");
text.classList.add("dark-text");
text.innerText = "Target Eliminated...";
overlay.appendChild(text);
document.body.appendChild(overlay);
setTimeout(() => { window.location.href = link; }, 2500);
}
// Reuse bubble effect but optimized inside this block
function showBubbleEffect() {
for (let i = 0; i < 50; i++) {
const bubble = document.createElement("div");
bubble.classList.add("bubble");
bubble.style.left = `${Math.random() * 100}vw`;
bubble.style.animationDuration = `${3 + Math.random() * 4}s`;
bubble.style.width = `${10 + Math.random() * 30}px`;
bubble.style.height = bubble.style.width;
document.body.appendChild(bubble);
setTimeout(() => bubble.remove(), 7000);
}
}
function showSmashEffect() {
const smash = document.createElement("div");
smash.classList.add("smash-effect");
smash.innerText = "SMASH!!";
document.body.appendChild(smash);
document.body.classList.add("heavy-shake");
setTimeout(() => { smash.remove(); document.body.classList.remove("heavy-shake"); }, 2000);
}
function showGlitchEffect() {
const overlay = document.createElement("div");
overlay.classList.add("glitch-overlay");
document.body.appendChild(overlay);
setTimeout(() => overlay.remove(), 2000);
}
function showGetsugaEffect() {
const wave = document.createElement("div");
wave.classList.add("getsuga-wave");
document.body.appendChild(wave);
setTimeout(() => wave.remove(), 2000);
}
function showCursedEffect() {
const energy = document.createElement("div");
energy.classList.add("cursed-energy");
document.body.appendChild(energy);
setTimeout(() => energy.remove(), 2000);
}
function showRasenganEffect() {
const rasengan = document.createElement("div");
rasengan.classList.add("rasengan");
document.body.appendChild(rasengan);
setTimeout(() => rasengan.remove(), 2500);
}
function showNenEffect() {
const aura = document.createElement("div");
aura.classList.add("nen-aura");
document.body.appendChild(aura);
setTimeout(() => aura.remove(), 2500);
}
function showLinkStartEffect() {
const tunnel = document.createElement("div");
tunnel.classList.add("link-start-tunnel");
tunnel.innerText = "LINK START";
document.body.appendChild(tunnel);
setTimeout(() => tunnel.remove(), 2500);
}
function showRukhEffect() {
for (let i = 0; i < 60; i++) {
const part = document.createElement("div");
part.classList.add("rukh-particle");
part.style.left = Math.random() * 100 + "vw";
part.style.top = Math.random() * 100 + "vh";
document.body.appendChild(part);
setTimeout(() => part.remove(), 2000);
}
}
function showTimeTravelEffect() {
const overlay = document.createElement("div");
overlay.classList.add("time-travel-overlay");
document.body.appendChild(overlay);
setTimeout(() => overlay.remove(), 2500);
}
function showDominatorEffect() {
const scan = document.createElement("div");
scan.classList.add("dominator-overlay");
scan.innerHTML = "<div class='scan-line'></div><div class='crime-coef'>CRIME COEFFICIENT: OVER 300</div>";
document.body.appendChild(scan);
setTimeout(() => scan.remove(), 2500);
}
function showATFieldEffect() {
const field = document.createElement("div");
field.classList.add("at-field");
document.body.appendChild(field);
setTimeout(() => field.remove(), 2000);
}
function showComedyEffect() {
const sweat = document.createElement("div");
sweat.classList.add("comedy-effect");
document.body.appendChild(sweat);
setTimeout(() => sweat.remove(), 2000);
}
function showRomanceEffect() {
for (let i = 0; i < 30; i++) {
const heart = document.createElement("div");
heart.classList.add("romance-heart");
heart.style.left = Math.random() * 100 + "vw";
heart.style.animationDuration = (2 + Math.random()) + "s";
document.body.appendChild(heart);
setTimeout(() => heart.remove(), 3000);
}
}
// Add animation styles
const style = document.createElement("style");
style.innerHTML = `
@keyframes shake {
0%, 100% { transform: translate(0, 0); }
25% { transform: translate(-10px, 5px); }
50% { transform: translate(10px, -5px); }
75% { transform: translate(-5px, 10px); }
}
.screen-shake { animation: shake 0.2s linear infinite; }
@keyframes spin-expand {
0% { transform: rotate(0deg) scale(1); top: 50%; left: 50%; width: 100px; height: 100px; }
100% { transform: rotate(360deg) scale(15); top: 0; left: 0; width: 100vw; height: 100vh; }
}
.dragon-ball-effect {
position: fixed;
top: 50%; left: 50%;
width: 100px; height: 100px;
background: url('dragonball.png') no-repeat center/contain;
animation: spin-expand 3s ease-in-out forwards;
z-index: 9999;
pointer-events: none;
}
@keyframes sword-slash {
0% { transform: translateX(-100%) skewX(-30deg); opacity: 1; }
100% { transform: translateX(100%) skewX(-30deg); opacity: 0; }
}
.sword-slash-effect {
position: fixed;
top: 50%;
left: 0;
width: 100vw;
height: 30px;
background: linear-gradient(to right, red, orange, yellow);
box-shadow: 0 0 20px rgba(255, 100, 0, 0.8);
animation: sword-slash 1.5s ease-out forwards;
z-index: 9999;
}
@keyframes rising-bubbles {
0% { transform: translateY(0); opacity: 1; }
100% { transform: translateY(-100vh); opacity: 0; }
}
.bubble {
position: fixed;
bottom: 0;
background: rgba(25, 0, 255, 0.85);
border-radius: 50%;
animation: rising-bubbles linear infinite;
opacity: 0.8;
pointer-events: none;
z-index: 9999;
}
@keyframes fade-to-black {
0% { opacity: 0; }
100% { opacity: 1; }
}
.death-note-fade {
position: fixed;
top: 0; left: 0;
width: 100vw; height: 100vh;
background: black;
opacity: 0;
animation: fade-to-black 2.5s ease-in-out forwards;
z-index: 9999;
}
`;
style.innerHTML += `
/* Additional Anime Effects */
/* Dark / Thriller Text */
.dark-text {
font-family: 'Courier New', monospace; color: red;
font-size: 2rem; opacity: 0;
animation: fadeIn 2s forwards 0.5s;
}
@keyframes fadeIn { to {opacity:1;} }
/* MHA Smash */
@keyframes smash-zoom {
0% { transform: scale(0.1); opacity: 0; }
50% { transform: scale(1.5); opacity: 1; }
100% { transform: scale(3); opacity: 0; }
}
.smash-effect {
position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
font-family: Impact, sans-serif; font-size: 10rem;
color: #ff0000; -webkit-text-stroke: 4px yellow;
animation: smash-zoom 0.5s ease-out forwards; z-index: 9999; pointer-events: none;
}
.heavy-shake { animation: shake 0.1s linear infinite; filter: blur(2px); }
/* Tokyo Revengers Glitch */
@keyframes glitch-anim {
0% { clip-path: inset(40% 0 61% 0); transform: translate(-5px,0); }
20% { clip-path: inset(92% 0 1% 0); transform: translate(5px,0); }
40% { clip-path: inset(43% 0 1% 0); transform: translate(-5px,0); }
60% { clip-path: inset(25% 0 58% 0); transform: translate(5px,0); }
80% { clip-path: inset(54% 0 7% 0); transform: translate(-5px,0); }
100% { clip-path: inset(58% 0 43% 0); transform: translate(5px,0); }
100% { clip-path: inset(0 0 0 0); transform: translate(0,0); }
}
.glitch-overlay {
position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
background: rgba(0,0,0,0.2);
z-index: 9999; pointer-events: none;
animation: glitch-anim 0.2s infinite;
backdrop-filter: invert(0.8);
}
/* Bleach Getsuga */
@keyframes getsuga-slash {
0% { transform: translateX(-100%) rotate(-45deg); opacity: 0; }
50% { opacity: 1; }
100% { transform: translateX(100%) rotate(-45deg); opacity: 0; }
}
.getsuga-wave {
position: fixed; top: 0; left: 0; width: 200vw; height: 100vh;
background: linear-gradient(transparent, black, red, black, transparent);
animation: getsuga-slash 1.5s cubic-bezier(0.1, 0.7, 1.0, 0.1) forwards;
z-index: 9999; pointer-events: none;
}
/* JJK Cursed Energy */
@keyframes curse-flow {
0% { filter: hue-rotate(0deg) contrast(150%); transform: scale(1); }
50% { filter: hue-rotate(270deg) blur(5px); transform: scale(1.05); }
100% { filter: hue-rotate(0deg) contrast(150%); transform: scale(1); }
}
.cursed-energy {
position: fixed; top:0; left:0; width: 100vw; height: 100vh;
background: radial-gradient(circle, transparent 30%, #4b0082 90%);
mix-blend-mode: exclusion;
animation: curse-flow 2s infinite; z-index: 9999; pointer-events: none;
}
/* Naruto Rasengan */
@keyframes spin-rasengan {
0% { transform: translate(-50%, -50%) rotate(0deg) scale(0); }
20% { transform: translate(-50%, -50%) rotate(360deg) scale(1); }
100% { transform: translate(-50%, -50%) rotate(3600deg) scale(15); opacity: 0; }
}
.rasengan {
position: fixed; top: 50%; left: 50%;
width: 150px; height: 150px;
background: radial-gradient(circle, #fff, #00BFFF, #000080);
border-radius: 50%;
box-shadow: 0 0 60px #00BFFF;
animation: spin-rasengan 2.5s ease-in forwards;
z-index: 9999; pointer-events: none;
}
/* HxH Nen */
.nen-aura {
position: fixed; inset: 0;
box-shadow: inset 0 0 100px 50px lime;
filter: drop-shadow(0 0 20px gold);
animation: shake 0.5s infinite;
z-index: 9999; pointer-events: none;
}
/* SAO Link Start */
@keyframes tunnel-dive {
0% { transform: scale(1); opacity: 0; }
20% { opacity: 1; }
100% { transform: scale(5); opacity: 1; background: #fff;}
}
.link-start-tunnel {
position: fixed; top:0; left:0; width: 100vw; height: 100vh;
background: radial-gradient(circle, transparent 10%, #00ffff 10%, #000 20%);
background-size: 100px 100px;
display: flex; justify-content: center; align-items: center;
color: white; font-size: 3rem; font-family: monospace;
animation: tunnel-dive 3s linear forwards;
z-index: 9999; pointer-events: none;
}
/* Magi Rukh */
@keyframes float-up {
to { transform: translateY(-100vh) rotate(360deg); opacity: 0; }
}
.rukh-particle {
position: fixed; width: 20px; height: 20px;
background: radial-gradient(circle, gold, transparent);
box-shadow: 0 0 5px gold;
border-radius: 50%;
animation: float-up 2s linear forwards;
z-index: 9999; pointer-events: none;
}
/* Steins;Gate */
.time-travel-overlay {
position: fixed; inset: 0; background: #fff;
mix-blend-mode: difference;
animation: glitch-anim 0.5s infinite;
z-index: 9999; pointer-events: none;
}
/* Psycho-Pass */
.dominator-overlay {
position: fixed; inset: 0; border: 10px solid #00ffcc;
background: rgba(0, 50, 50, 0.5);
color: #00ffcc; font-family: sans-serif;
display: flex; flex-direction: column; justify-content: center; align-items: center;
z-index: 9999; pointer-events: none;
}
.scan-line { width: 100%; height: 5px; background: #00ffcc; animation: slide-down 1s infinite; }
@keyframes slide-down { from {margin-top: -50vh;} to {margin-top: 50vh;} }
/* Evangelion AT Field */
@keyframes hex-pulse {
0% { opacity: 0; transform: scale(0.5); }
50% { opacity: 1; transform: scale(1); }
100% { opacity: 0; transform: scale(1.5); }
}
.at-field {
position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
width: 300px; height: 300px;
background: rgba(255, 165, 0, 0.4);
clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
border: 2px solid orange;
animation: hex-pulse 1s ease-out infinite; z-index: 9999; pointer-events: none;
}
/* Comedy */
.comedy-effect {
position: fixed; top: 10%; right: 10%;
width: 100px; height: 150px;
background: radial-gradient(circle at 50% 100%, #00f, transparent);
border-radius: 50% 50% 0 0;
transform: rotate(-15deg);
z-index: 9999; opacity: 0.8;
animation: shake 0.5s infinite;
}
/* Romance */
@keyframes heart-rise {
to { transform: translateY(-100vh) scale(1.5); opacity: 0; }
}
.romance-heart {
position: fixed; bottom: 0;
width: 20px; height: 20px; background: pink; transform: rotate(45deg);
box-shadow: 10px 10px 0 pink;
z-index: 9999; pointer-events: none;
animation: heart-rise 3s ease-in forwards;
}
.romance-heart::before, .romance-heart::after {
content:''; position: absolute; width: 20px; height: 20px; background: pink; border-radius: 50%;
}
.romance-heart::before { top: -10px; left: 0; }
.romance-heart::after { left: -10px; top: 0; }
`;
document.head.appendChild(style);
const searchInput = document.getElementById("search-input");
const suggestionsBox = document.getElementById("suggestions");
let animeNames = Array.from(document.querySelectorAll(".anime-card h2")).map(h2 => h2.innerText);
searchInput.addEventListener("input", () => {
const query = searchInput.value.toLowerCase();
suggestionsBox.innerHTML = "";
if (query.length === 0) {
suggestionsBox.style.display = "none";
return;
}
const matches = animeNames.filter(name => name.toLowerCase().includes(query));
if (matches.length > 0) {
suggestionsBox.style.display = "block";
matches.forEach(name => {
const div = document.createElement("div");
div.textContent = name;
div.addEventListener("click", () => {
const targetCard = Array.from(document.querySelectorAll(".anime-card")).find(card =>
card.querySelector("h2").innerText === name
);
if (targetCard) {
targetCard.scrollIntoView({ behavior: "smooth", block: "center" });
targetCard.classList.add("highlight");
setTimeout(() => targetCard.classList.remove("highlight"), 2000);
}
searchInput.value = name;
suggestionsBox.style.display = "none";
});
suggestionsBox.appendChild(div);
});
} else {
suggestionsBox.style.display = "none";
}
});
const dropdown = document.querySelector(".dropdown");
const dropdownBtn = dropdown.querySelector(".filter-btn");
dropdownBtn.addEventListener("click", (e) => {
e.stopPropagation();
dropdown.classList.toggle("open");
});
window.addEventListener("click", (e) => {
if (!dropdown.contains(e.target)) {
dropdown.classList.remove("open");
}
});
</script>
<script>
const navbar = document.querySelector('.navbar');
window.addEventListener('scroll', () => {
if (window.scrollY > 150) { // adjust scroll distance
navbar.classList.add('visible');
} else {
navbar.classList.remove('visible');
}
});
</script>
</body>
</html>