Skip to content
This repository was archived by the owner on Oct 13, 2021. It is now read-only.

Gabby's branch#1

Open
gabbyMill wants to merge 31 commits intomainfrom
Gabby's-Branch
Open

Gabby's branch#1
gabbyMill wants to merge 31 commits intomainfrom
Gabby's-Branch

Conversation

@gabbyMill
Copy link
Copy Markdown
Owner

Yeah

gabbyMill and others added 30 commits September 12, 2021 16:27
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
Fixed function so that onCLick attr is set property and initiated I at 1 so it doesn't add id to display
added some html in js
colors added to playSong Function
Songs colors whilst playing reflect their length.
Updated playSong Function to do so
Fixed color difference function
previously it was only on click and now it is onload.
added attributes and classes so I can manipulate them with css
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
updated a bit of css
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
Previously when you would play a song
a click on another song would not instantly start playing it.
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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant