JAYASWAROOP commited on
Commit
710766b
1 Parent(s): 568ef55

Update audio.js

Browse files
Files changed (1) hide show
  1. audio.js +17 -0
audio.js CHANGED
@@ -1,4 +1,7 @@
1
  document.addEventListener('DOMContentLoaded', function () {
 
 
 
2
  const songContainers = document.querySelectorAll('.movie');
3
 
4
  songContainers.forEach(function (container) {
@@ -23,4 +26,18 @@ document.addEventListener('DOMContentLoaded', function () {
23
  }
24
  });
25
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  });
 
1
  document.addEventListener('DOMContentLoaded', function () {
2
+ const searchBar = document.getElementById('searchBar');
3
+ const songNames = document.querySelectorAll('h1[style="font-size: 28px;"]');
4
+ const descriptions = document.querySelectorAll('p[style="font-size: 20px;"]');
5
  const songContainers = document.querySelectorAll('.movie');
6
 
7
  songContainers.forEach(function (container) {
 
26
  }
27
  });
28
  });
29
+ searchBar.addEventListener('input', function() {
30
+ const searchText = searchBar.value.toLowerCase();
31
+
32
+ songNames.forEach((song, index) => {
33
+ const songName = song.textContent.toLowerCase();
34
+ const description = descriptions[index].textContent.toLowerCase();
35
+
36
+ if (songName.includes(searchText) || description.includes(searchText)) {
37
+ song.parentElement.parentElement.style.display = 'block';
38
+ } else {
39
+ song.parentElement.parentElement.style.display = 'none';
40
+ }
41
+ });
42
+ });
43
  });