This repository was archived by the owner on Oct 13, 2021. It is now read-only.
Open
Conversation
sorted songs + playlists with sort function that appends all songs with properties into unordered list.
Did not notice prebuilt functions. pretty straight forward.
Made use of the arguments object.
createPlaylistFunction done. added id to go inside variable 'attrs' in both functions so it will have an id attribute the same as the song.id
append to div functions loops over player.songs and appends them to div
append To Songs Div function does the same.
append to playlists done using helper functions imported from previous mp3 challenge
Fixed class names so I can access them with playSong Function. Made background color reset to white every time playSong is called so only 1 song is played at a time
Songs colors whilst playing reflect their length. Updated playSong Function to do so
Edited createPlaylistElement so it will recieve id as attr and name as className using arguments object.
Fixed appendToPlaylistsDiv and createPlayList Element to get rid use of heavy use of arguments and make more use of destructuring
Made functions more generic by decreasing use of arguments and using destructuring. Main difference is now I pass an object to AppendDiv function and not individual arguments
New Instructions
…into Gabby's-Branch
A bit of css. Made a eventHandler function that receives event. It calls either removeSong, playSong, or addSong function.
Made the original createSongElement function add a class with the song's id so I can then pass the id to removeSong and playSong function. Updated removeSong to be much neater with this and for now playSong is calling the original playSong (now originalPlaySong) function with its id
Added add song function to recieve a song object from handleSongClickEvent, with it it creates a new song element and appends it to the 'songs' div. Also made the playlists + songs sort a function. For now the duration input only takes a number.
made a function to generate a unique new id for every song added. This song will also have corresponding buttons that match his id. Put AppendToSongsDiv (generateSongs) function inside add song function, this way, everytime a song is added the div is reset and re-updated according to the player object. Updated songCLickEvent function to use regex. Throwing an error for invalid inputs.
removeSong function now updates state of player.playlists as well. Everytime you delete a song that exists in a playlist it gets delted in the playlist as well, if you delete all of the songs in the playlist the playlist itself is deleted. When adding a new song the list will remain sorted by title. All of the new songs are colored by their duration.
worked a lot on css. made a progress bar that slowly fills up when you're playing a song. made the add song section hidden unless you click on the <h2> add song. did a bit of updating, there was a bug where anytime you would add a new song all of the old deleted songs would re appear
mainly fixed generate id function. where there were old working functions I left them in the old index.js
Final bonus req accomplished. songs automatically continue playing until the end
Revert Back to real songs duration
Paint songs back to their original color after last song finished playing
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Yeah