JAYASWAROOP commited on
Commit
3d661b3
·
1 Parent(s): b1d5e12

Update audio.js

Browse files
Files changed (1) hide show
  1. audio.js +18 -0
audio.js CHANGED
@@ -1,4 +1,7 @@
1
  document.addEventListener('DOMContentLoaded', function () {
 
 
 
2
  const movieContainers = document.querySelectorAll('.movie');
3
 
4
  movieContainers.forEach(function (container) {
@@ -25,4 +28,19 @@ document.addEventListener('DOMContentLoaded', function () {
25
  audio.classList.toggle('d-none');
26
  });
27
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  });
 
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 movieContainers = document.querySelectorAll('.movie');
6
 
7
  movieContainers.forEach(function (container) {
 
28
  audio.classList.toggle('d-none');
29
  });
30
  });
31
+
32
+ searchBar.addEventListener('input', function() {
33
+ const searchText = searchBar.value.toLowerCase();
34
+
35
+ songNames.forEach((song, index) => {
36
+ const songName = song.textContent.toLowerCase();
37
+ const description = descriptions[index].textContent.toLowerCase();
38
+
39
+ if (songName.includes(searchText) || description.includes(searchText)) {
40
+ song.parentElement.parentElement.style.display = 'block';
41
+ } else {
42
+ song.parentElement.parentElement.style.display = 'none';
43
+ }
44
+ });
45
+ });
46
  });