Zhypier commited on
Commit
739010f
·
verified ·
1 Parent(s): e236425

the search is till not fucntioning and make the ui black like amoled

Browse files
Files changed (1) hide show
  1. index.html +42 -23
index.html CHANGED
@@ -27,8 +27,22 @@
27
  @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
28
  body {
29
  font-family: 'Poppins', sans-serif;
 
30
  }
31
- .video-wrapper {
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  aspect-ratio: 16/9;
33
  }
34
  .queue-item:hover {
@@ -318,8 +332,7 @@
318
  if (!query) return;
319
 
320
  const resultsContainer = document.getElementById('searchResults');
321
-
322
- try {
323
  // Show loading state
324
  resultsContainer.innerHTML = `
325
  <div class="p-4 text-center text-gray-400">
@@ -329,17 +342,25 @@
329
  feather.replace();
330
  resultsContainer.classList.remove('hidden');
331
 
332
- // Fetch from API (mock response for example)
333
- // In a real app, you would fetch from your backend or music API
334
- const mockResults = [
335
- { id: 1, title: "Dark Paradise", artist: "Lana Del Rey", duration: "3:42", cover: "https://static.photos/music/200x200/11" },
336
- { id: 2, title: "Midnight City", artist: "M83", duration: "4:03", cover: "https://static.photos/music/200x200/12" },
337
- { id: 3, title: "Nightcall", artist: "Kavinsky", duration: "4:18", cover: "https://static.photos/music/200x200/13" },
338
- { id: 4, title: "Black Out Days", artist: "Phantogram", duration: "3:47", cover: "https://static.photos/music/200x200/14" },
339
- { id: 5, title: "Bury a Friend", artist: "Billie Eilish", duration: "3:13", cover: "https://static.photos/music/200x200/15" }
340
- ];
341
-
342
- // Filter mock results based on query
 
 
 
 
 
 
 
 
343
  const filteredResults = mockResults.filter(song =>
344
  song.title.toLowerCase().includes(query.toLowerCase()) ||
345
  song.artist.toLowerCase().includes(query.toLowerCase())
@@ -399,10 +420,9 @@ function handleResize() {
399
 
400
  window.addEventListener('resize', handleResize);
401
  handleResize();
402
-
403
- // Initialize Vanta.js background
404
  VANTA.WAVES({
405
- el: "#vanta-bg",
406
  mouseControls: true,
407
  touchControls: true,
408
  gyroControls: false,
@@ -410,14 +430,13 @@ el: "#vanta-bg",
410
  minWidth: 200.00,
411
  scale: 1.00,
412
  scaleMobile: 1.00,
413
- color: 0x6e44ff,
414
- shininess: 77.00,
415
- waveHeight: 20.00,
416
- waveSpeed: 0.80,
417
  zoom: 0.65
418
  });
419
-
420
- // Initialize animations
421
  document.addEventListener('DOMContentLoaded', () => {
422
  // Simple fade-in animation for elements
423
  anime({
 
27
  @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
28
  body {
29
  font-family: 'Poppins', sans-serif;
30
+ background-color: #000000 !important;
31
  }
32
+ .bg-dark, .bg-gray-800, .bg-gray-700, .bg-gray-900 {
33
+ background-color: #000000 !important;
34
+ border-color: #222222 !important;
35
+ }
36
+ .text-light {
37
+ color: #ffffff !important;
38
+ }
39
+ .text-gray-400 {
40
+ color: #666666 !important;
41
+ }
42
+ .text-gray-500 {
43
+ color: #777777 !important;
44
+ }
45
+ .video-wrapper {
46
  aspect-ratio: 16/9;
47
  }
48
  .queue-item:hover {
 
332
  if (!query) return;
333
 
334
  const resultsContainer = document.getElementById('searchResults');
335
+ try {
 
336
  // Show loading state
337
  resultsContainer.innerHTML = `
338
  <div class="p-4 text-center text-gray-400">
 
342
  feather.replace();
343
  resultsContainer.classList.remove('hidden');
344
 
345
+ // Fetch from actual API
346
+ const response = await fetch(`https://itunes.apple.com/search?term=${encodeURIComponent(query)}&media=music&limit=5`);
347
+ const data = await response.json();
348
+
349
+ if (data.results && data.results.length > 0) {
350
+ resultsContainer.innerHTML = data.results.map(song => `
351
+ <div class="search-result flex items-center p-3 hover:bg-gray-900 transition cursor-pointer border-b border-gray-800 last:border-0">
352
+ <img src="${song.artworkUrl100.replace('100x100', '200x200')}" alt="${song.trackName}" class="w-12 h-12 rounded">
353
+ <div class="ml-3 flex-1">
354
+ <h4 class="font-medium">${song.trackName}</h4>
355
+ <p class="text-sm text-gray-400">${song.artistName}</p>
356
+ </div>
357
+ <span class="text-sm text-gray-500 mr-3">${Math.floor(song.trackTimeMillis/60000)}:${String(Math.floor((song.trackTimeMillis%60000)/1000)).padStart(2, '0')}</span>
358
+ <button class="p-2 rounded-full bg-secondary hover:bg-secondary/90 transition" onclick="addToQueue('${song.trackId}')">
359
+ <i data-feather="plus" class="w-4 h-4"></i>
360
+ </button>
361
+ </div>
362
+ `).join('');
363
+ // Filter mock results based on query
364
  const filteredResults = mockResults.filter(song =>
365
  song.title.toLowerCase().includes(query.toLowerCase()) ||
366
  song.artist.toLowerCase().includes(query.toLowerCase())
 
420
 
421
  window.addEventListener('resize', handleResize);
422
  handleResize();
423
+ // Initialize Vanta.js background - Black Waves
 
424
  VANTA.WAVES({
425
+ el: "#vanta-bg",
426
  mouseControls: true,
427
  touchControls: true,
428
  gyroControls: false,
 
430
  minWidth: 200.00,
431
  scale: 1.00,
432
  scaleMobile: 1.00,
433
+ color: 0x0,
434
+ shininess: 100.00,
435
+ waveHeight: 10.00,
436
+ waveSpeed: 0.50,
437
  zoom: 0.65
438
  });
439
+ // Initialize animations
 
440
  document.addEventListener('DOMContentLoaded', () => {
441
  // Simple fade-in animation for elements
442
  anime({