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
 
1ae17e8
 
 
 
 
 
0ed58c6
 
 
 
1ae17e8
 
 
 
 
 
0ed58c6
 
 
 
 
 
 
 
 
 
 
0a7b925
94999f1
0ed58c6
 
 
 
02ee4f9
 
1ae17e8
 
 
 
0ed58c6
02ee4f9
0ed58c6
 
 
 
 
1ae17e8
 
0ed58c6
1ae17e8
02ee4f9
0ed58c6
02ee4f9
0ed58c6
1ae17e8
 
02ee4f9
0ed58c6
100f2ed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fddf6b3
 
 
 
 
 
 
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
/* ======  DATA  ====== */
const endpoints = [
  {
    name: "All-in-one",
    path: "/api/all-in-one?url=https://fb.com/video",
    method: "GET",
    params: ["url"],
    desc: "Download any social-media video",
    cat: "Downloaders",
    isActive: false,
  },
  {
    name: "Anime Quote",
    path: "/api/aniquote",
    method: "GET",
    params: [],
    desc: "Random quote from popular anime",
    cat: "Fun",
    isActive: true,
  },
  {
    name: "APK Downloader",
    path: "/api/apkdl?q=Facebook%20lite",
    method: "GET",
    params: ["q"],
    desc: "Download APKs directly",
    cat: "Downloaders",
    isActive: true,
  },
  {
    name: "Calculator",
    path: "/api/cal?num1=10&num2=5&operation=add",
    method: "GET",
    params: ["num1", "num2", "operation"],
    desc: "Basic arithmetic",
    cat: "Tools",
    isActive: true,
  },
  {
    name: "Country Info",
    path: "/api/country?q=Nigeria",
    method: "GET",
    params: ["q"],
    desc: "Country profiles",
    cat: "Tools",
    isActive: true,
  },
  {
    name: "Currency Converter",
    path: "/api/convert?from=USD&to=EUR&amount=100",
    method: "GET",
    params: ["from", "to", "amount"],
    desc: "Live exchange rates",
    cat: "Tools",
    isActive: true,
  },
  {
    name: "Dare",
    path: "/api/dare",
    method: "GET",
    params: [],
    desc: "Random dare challenge",
    cat: "Fun",
    isActive: true,
  },
  {
    name: "Encode",
    path: "/api/encode?text=Hello-world",
    method: "GET",
    params: ["text"],
    desc: "Text โ†’ binary",
    cat: "Tools",
    isActive: true,
  },
  {
    name: "Decode",
    path: "/api/decode?binary=01001000",
    method: "GET",
    params: ["binary"],
    desc: "Binary โ†’ text",
    cat: "Tools",
    isActive: true,
  },
  {
    name: "Facebook DL",
    path: "/api/fbdl?url=https://www.facebook.com/share/r/1JB12MKi1Z/",
    method: "GET",
    params: ["url"],
    desc: "Facebook video downloader",
    cat: "Downloaders",
    isActive: true,
  },
  {
    name: "JS Encryptor",
    path: "/api/obf?code=console.log('hello');",
    method: "GET",
    params: ["code"],
    desc: "For encrypting JavaScript codes",
    cat: "Tools",
    isActive: true,
  },
  {
    name: "Flirt ๐Ÿ˜",
    path: "/api/flirt",
    method: "GET",
    params: [],
    desc: "Random flirting text",
    cat: "Fun",
    isActive: true,
  },
  {
    name: "Font",
    path: "/api/font",
    method: "GET",
    params: ["text"],
    desc: "Generate different fonts",
    cat: "Tools",
    isActive: true,
  },
  {
    name: "Gpt3.5",
    path: "/api/gpt3.5?prompt=hi",
    method: "GET",
    params: ["prompt"],
    desc: "ChatGPT-3.5 turbo",
    cat: "AI",
    isActive: true,
  },
  {
    name: "Movie",
    path: "/api/moviedl?moviename=Wednesday&episode=1",
    method: "GET",
    params: ["moviename", "episode"],
    desc: "Movie downloader",
    cat: "Downloaders",
    isActive: true,
  },
  {
    name: "Npm stalker",
    path: "/api/npmcheck?package=Baileys",
    method: "GET",
    params: ["package"],
    desc: "Info on an npm package",
    cat: "Stalker",
    isActive: true,
  },
  {
    name: "TikTok DL",
    path: "/api/tkdl?url=https://vt.tiktok.com/ZSAG1bG1e/",
    method: "GET",
    params: ["url"],
    desc: "No-watermark TikTok",
    cat: "Downloaders",
    isActive: true,
  },
  {
    name: "TikTok DL2",
    path: "/api/tkdl2?url=https://vt.tiktok.com/ZSAG1bG1e/",
    method: "GET",
    params: ["url"],
    desc: "No-watermark TikTok faster than v1",
    cat: "Downloaders",
    isActive: true,
  },
  {
    name: "Instagram DL",
    path: "/api/instadl?url=https://www.instagram.com/reel/DNsaHN70Cdr/?igsh=YzljYTk1ODg3Zg==",
    method: "GET",
    params: ["url"],
    desc: "Instagram media downloader",
    cat: "Downloaders",
    isActive: false,
  },
  {
    name: "wachannel",
    path: "/api/wachannel?url=https://whatsapp.com/channel/0029VangYOt96H4JhFarL10C",
    method: "GET",
    params: ["url"],
    desc: "Get WhatsApp channel info",
    cat: "Stalker",
    isActive: false,
  },
  {
    name: "Wallpaper",
    path: "/api/wallpaper?q=naruto",
    method: "GET",
    params: ["q"],
    desc: "Wallpaper search",
    cat: "Search",
    isActive: true,
  },
  {
    name: "YouTube MP4",
    path: "/api/ytmp4?url=URL",
    method: "GET",
    params: ["url"],
    desc: "YouTube video",
    cat: "Downloaders",
    isActive: false,
  },
  {
    name: "YouTube MP3",
    path: "/api/ytmp3?url=URL",
    method: "GET",
    params: ["url"],
    desc: "YouTube audio",
    cat: "Downloaders",
    isActive: false,
  },
  {
    name: "Text-to-Image",
    path: "/api/text2img?prompt=hello",
    method: "GET",
    params: ["prompt"],
    desc: "AI image generation",
    cat: "AI",
    isActive: false,
  },
  {
    name: "Translator",
    path: "/api/translate?text=hello&from=en&to=id",
    method: "GET",
    params: ["text", "from", "to"],
    desc: "Auto-detect translate",
    cat: "Tools",
    isActive: true,
  },
  {
    name: "Joke",
    path: "/api/joke",
    method: "GET",
    params: [],
    desc: "Random joke",
    cat: "Fun",
    isActive: true,
  },
  {
    name: "Quote",
    path: "/api/quote",
    method: "GET",
    params: [],
    desc: "Inspirational quote",
    cat: "Fun",
    isActive: true,
  },
  {
    name: "Screenshot",
    path: "/api/screenshot?url=WEBSITE",
    method: "GET",
    params: ["url"],
    desc: "Website screenshot",
    cat: "Tools",
    isActive: true,
  },
  {
    name: "TinyURL",
    path: "/api/tinyurl?url=LONG",
    method: "GET",
    params: ["url"],
    desc: "URL shortener",
    cat: "Tools",
    isActive: true,
  },
  {
    name: "Spotify DL",
    path: "/api/spotifydl?url=TRACK_URL",
    method: "GET",
    params: ["url"],
    desc: "Spotify downloader",
    cat: "Downloaders",
    isActive: false,
  },
  {
    name: "Twitter DL",
    path: "/api/twitterdl?url=https://x.com/Korsogyimi/status/1962912658618802257",
    method: "GET",
    params: ["url"],
    desc: "Twitter video downloader",
    cat: "Downloaders",
    isActive: true,
  },
  {
    name: "Pinterest Search",
    path: "/api/pinterest?q=cats",
    method: "GET",
    params: ["q"],
    desc: "Pinterest images",
    cat: "Search",
    isActive: true,
  },
  {
    name: "Waifu (NSFW)",
    path: "/api/waifu?q=",
    method: "GET",
    params: ["q"],
    desc: "Random waifu pics",
    cat: "Random",
    isActive: true,
  },
  {
    name: "Hentai (NSFW)",
    path: "/api/hentai",
    method: "GET",
    params: [],
    desc: "Hentai videos",
    cat: "Random",
    isActive: true,
  },
  {
    name: "Xvideos",
    path: "/api/xvideos?url=https://www.xvideos.com/video.oipfcmd53ee/he_fucking_peaces_my_wet_hole_xxx",
    method: "GET",
    params: ["url"],
    desc: "download xvidios videos",
    cat: "Downloaders",
    isActive: true,
  },
  {
    name: "XXX Search",
    path: "/api/xxxsearch?q=keyword",
    method: "GET",
    params: ["q"],
    desc: "Search adult videos",
    cat: "Search",
    isActive: true,
  },
];

const baseURL = window.location.origin;

/* ======  STATE  ====== */
let filtered = [...endpoints];
let page = 0;
const perPage = 12;

/* ======  DOM  ====== */
const grid = document.getElementById("grid");
const search = document.getElementById("search");
const pills = document.getElementById("pills");
const loadBtn = document.getElementById("loadMore");
const modal = document.getElementById("modal");
const mTitle = document.getElementById("mTitle");
const mBody = document.getElementById("mBody");

/* ======  INIT  ====== */
function init() {
  createPills();
  render();
  bindEvents();
  fetchCount();
}

/* ======  CATEGORIES  ====== */
function createPills() {
  const cats = ["All", ...new Set(endpoints.map((e) => e.cat))];
  pills.innerHTML = cats
    .map((c) => `<button class="pill" data-cat="${c}">${c}</button>`)
    .join("");
  pills.firstElementChild.classList.add("active");
}

/* ======  RENDER  ====== */
function render(reset = true) {
  if (reset) {
    grid.innerHTML = "";
    page = 0;
  }
  // start from page*perPage instead of 0
  const slice = filtered.slice(page * perPage, (page + 1) * perPage);
  slice.forEach((e) => {
    const card = document.createElement("div");
    card.className = "card";
    card.innerHTML = `
      <span class="cat">${e.cat}</span>
      <h4>${e.name}</h4>
      <p>${e.desc}</p>
      <span class="method">${e.method}</span>
      <span class="status ${e.isActive ? "active" : "inactive"}">${e.isActive ? "Active" : "Inactive"}</span>
    `;
    card.onclick = () => openModal(e);
    grid.appendChild(card);
  });
  loadBtn.style.display = (page + 1) * perPage < filtered.length ? "block" : "none";
}

/* ======  SEARCH / FILTER  ====== */
function bindEvents() {
  search.addEventListener("input", filter);
  pills.addEventListener("click", (e) => {
    if (!e.target.classList.contains("pill")) return;
    pills.querySelector(".active")?.classList.remove("active");
    e.target.classList.add("active");
    filter();
  });
  loadBtn.addEventListener("click", () => {
    page++;
    render(false);
  });
  modal.querySelector(".modal-close").onclick = closeModal;
  modal.querySelector(".modal-backdrop").onclick = closeModal;
}

function filter() {
  const term = search.value.toLowerCase();
  const cat = pills.querySelector(".active").dataset.cat;
  filtered = endpoints.filter(
    (e) =>
      (cat === "All" || e.cat === cat) &&
      (e.name.toLowerCase().includes(term) ||
        e.desc.toLowerCase().includes(term)),
  );
  render();
}

/* ======  MODAL  ====== */
function openModal(e) {
  mTitle.textContent = e.name;
  const url = `${baseURL}${e.path}`;
  mBody.innerHTML = `
    <p>${e.desc}</p>
    <p><strong>Method:</strong> ${e.method}</p>
    ${e.params.length ? `<p><strong>Params:</strong> ${e.params.join(", ")}</p>` : ""}
    <p><strong>Status:</strong> <span class="status ${e.isActive ? "active" : "inactive"}">${e.isActive ? "Active" : "Inactive"}</span></p>
    <div class="code-snippet">curl -X ${e.method} "${url}"</div>
    <div style="margin-top:1rem">
      <button class="btn-copy" onclick="navigator.clipboard.writeText('${url}')">Copy URL</button>
      <a href="${url}" target="_blank" style="margin-left:.5rem" class="btn-copy">Test</a>
    </div>
  `;
  modal.classList.add("active");
}
function closeModal() {
  modal.classList.remove("active");
}

/* ======  LIVE REQUEST COUNT  ====== */
async function fetchCount() {
  try {
    const res = await fetch(`${baseURL}/api/requests`);
    const data = await res.json();
    document.getElementById("req-count").textContent =
      data.request_count.toLocaleString();
  } catch {
    document.getElementById("req-count").textContent = "0";
  }
}

/* ======  UTILS  ====== */
window.scrollToSection = (id) =>
  document.getElementById(id).scrollIntoView({ behavior: "smooth" });

init();
/* ======  DYNAMIC MAGIC  ====== */

/* ----  auto-play music with widget  ---- */
const bgm = document.getElementById('bgm');
const musicToggle = document.getElementById('music-toggle');
const musicText = document.getElementById('music-text');
let musicOn = false;

function toggleMusic() {
  musicOn = !musicOn;
  if (musicOn) {
    bgm.muted = false;
    bgm.play().catch(() => {});
    musicToggle.innerHTML = '<i class="fas fa-pause"></i>';
    musicText.textContent = 'sound on';
  } else {
    bgm.muted = true;
    musicToggle.innerHTML = '<i class="fas fa-play"></i>';
    musicText.textContent = 'sound off';
  }
}
musicToggle.addEventListener('click', toggleMusic);

/* first user interaction un-mutes */
window.addEventListener('pointerdown', () => {
  if (!musicOn) toggleMusic();
}, { once: true });

/* ----  cursor chasing orbs  ---- */
document.addEventListener('pointermove', e => {
  const { clientX, clientY } = e;
  const { innerWidth, innerHeight } = window;
  const x = (clientX / innerWidth - .5) * 30;
  const y = (clientY / innerHeight - .5) * 30;
  document.querySelectorAll('.orb').forEach((o, i) => {
    const speed = 1 + i * .2;
    o.style.transform = `translate(${x * speed}px, ${y * speed}px)`;
  });
});

/* ----  header shrink on scroll  ---- */
const header = document.querySelector('.header');
let last = 0;
addEventListener('scroll', () => {
  const curr = scrollY;
  header.classList.toggle('compact', curr > 80);
  last = curr;
});

/* ----  ripple on buttons  ---- */
function createRipple(e) {
  const btn = e.currentTarget;
  const circle = document.createElement('span');
  const d = Math.max(btn.clientWidth, btn.clientHeight);
  const rect = btn.getBoundingClientRect();
  circle.style.width = circle.style.height = d + 'px';
  circle.style.left = e.clientX - rect.left - d / 2 + 'px';
  circle.style.top = e.clientY - rect.top - d / 2 + 'px';
  circle.classList.add('ripple');
  btn.appendChild(circle);
  setTimeout(() => circle.remove(), 600);
}
document.querySelectorAll('.cta, .pill, .load-more, .btn-copy')
        .forEach(b => b.addEventListener('pointerdown', createRipple));

/* ----  animate numbers on stat cards  ---- */
function countUp(el, target) {
  let cur = 0;
  const inc = target / 60;
  const t = setInterval(() => {
    cur += inc;
    if (cur >= target) { cur = target; clearInterval(t); }
    el.textContent = Math.floor(cur).toLocaleString();
  }, 16);
}
/* run when visible */
const io = new IntersectionObserver(entries => {
  entries.forEach(e => {
    if (e.isIntersecting) {
      const card = e.target;
      const num = card.querySelector('span');
      if (num.dataset.done) return;
      num.dataset.done = true;
      const final = parseInt(num.textContent.replace(/,/g, ''), 10) || 0;
      if (final) countUp(num, final);
    }
  });
}, { threshold: .6 });
document.querySelectorAll('.stat-card').forEach(c => io.observe(c));
/*  toggle SVG icon  */
const spIcon = document.getElementById('speaker-icon');
function updateSpeakerIcon() {
  spIcon.src = musicOn ? './media/speaker-on.svg'
                       : './media/speaker-off.svg';
}
musicToggle.addEventListener('click', updateSpeakerIcon);