forked from iamsonukushwaha/tarana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d41870f
commit aafda65
Showing
7 changed files
with
1,041 additions
and
1,214 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,25 @@ | ||
// const searchForm = document.querySelector('#srh'); | ||
const searchForm = document.querySelector('#srh'); | ||
|
||
// const getSongs = async (term) => { | ||
// let uri = `https://tarana-music-player.herokuapp.com/songs/?_sort=name&_order=asc`; | ||
const searchSong = async (term) => { | ||
let uri = `https://tarana-music-player.herokuapp.com/songs/?_sort=name&_order=asc`; | ||
|
||
// if (term) { | ||
// uri += `&q=${term}`; | ||
// list.innerHTML = ""; | ||
// } | ||
if (term) { | ||
uri += `&q=${term}`; | ||
list.innerHTML = ""; | ||
} | ||
|
||
// const res = await fetch(uri); | ||
// const data = await res.json(); | ||
const res = await fetch(uri); | ||
const data = await res.json(); | ||
|
||
// data.forEach(element => { | ||
// link = document.createElement('a'); | ||
// link.innerHTML = `${element.id}. ${element.name} →${element.singer}`; | ||
data.forEach(element => { | ||
genLink(element); | ||
|
||
// // console.log(element); | ||
}); | ||
} | ||
|
||
// link.addEventListener('click', function () { | ||
// track.src = element.path; | ||
// title.innerHTML = element.name; | ||
// track_image.src = element.img; | ||
// artist.innerHTML = element.singer; | ||
// present.innerHTML = element.id; | ||
|
||
// total.innerHTML = All_song.length; | ||
|
||
|
||
// nochange(); | ||
// reset_slider(); | ||
|
||
// playsong(); | ||
|
||
// }); | ||
|
||
// list.append(link); | ||
// }); | ||
|
||
// } | ||
|
||
// searchForm.addEventListener('input', (e) => { | ||
// e.preventDefault(); | ||
// getSongs(searchForm.value.trim()); | ||
|
||
// }); | ||
|
||
// // window.addEventListener('DOMContentLoaded', () => getSongs()); | ||
searchForm.addEventListener('input', (e) => { | ||
e.preventDefault(); | ||
if(searchForm.value.trim() != ''){ | ||
searchSong(searchForm.value.trim()); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,10 @@ | |
"start": "nodemon server.js", | ||
"serve": "json-server --watch songs.json" | ||
}, | ||
"keywords": [], | ||
"keywords": [ | ||
"tarana", | ||
"music-player" | ||
], | ||
"author": "Sonu Kumar Kushwaha <[email protected]>", | ||
"license": "MIT", | ||
"dependencies": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.