The users of your MP3 player complained about it being inconvenient for regular (non-programmer) people. Time to build a GUI!
Your task is to create a webpage that conveniently displays the songs and playlists in a player object. The player object will have the same structure as in your previous assignment.
- Fork this repo into your account.
- Clone the forked repo to your computer.
- Create a new git branch for your work.
- Complete the requirements.
- Submit your work.
- May the odds be ever in your favor!
- There is now a section for adding new songs to the player. Make it work!
- Add a play button to every song. Clicking it will play that song.
- Add a remove button to every song. Clicking it will remove the song from the playlist.
- There should be only one event listener on the entire songs list, that handles all play and remove events of songs.
- You are given new template files to use:
index.new.html
andindex.new.js
.
Your webpage should contain 2 lists:
- A list of the
songs
in the player, sorted by their titles - A list of the
playlists
in the player, sorted by their names
Each song list item shall display the following details:
- song
title
album
nameartist
name- an image with the album's cover art (
coverArt
) - song
duration
(inmm:ss
format, of course)
One song can be played at a time. There should be some indication of the currently playing song (the specific indication is up to you). Clicking on a song will change the indication of the currently playing song. We have already provided code that handles the click event for you.
Every playlist list item should display the following information:
- playlist
name
- the number of songs in the playlist
- the total duration of the playlist
- After a song begins to play, it automatically switches to the next one when the song duration has passed.
- The color of the durations of songs should reflect their length. A duration of less than 2 min will show green, and will be gradually redder until it is completely red for durations that are above 7 min.
- When a song is removed, all playlists in the page will also be updated.
- When adding a new song, the songs list will remain sorted by title.
- Anything else you can think of...
You are provided with a template for your project:
- an HTML file (
index.html
) - a linked, empty CSS file (
style.css
) - a linked JS script with a sample
player
object (player.js
) - a linked JS script with a template for your code (
index.js
) - an
images
folder with the webpage icon and song cover art
The HTML defines the basic structure of the page. There are 2 container elements - one for the songs and one for the playlists. You may add more structural elements to the HTML (headings etc.), but the songs and playlists themselves must be generated using JS, based on the player
object.
- On GitHub, open a pull request from your branch to the main branch.
- Do not merge the pull request!
- Add the user
Cyber4sPopo
as collaborator to your repo. - Submit a link to the pull request in Google Classroom.
- Avoid duplication! Use JS functions and CSS classes wisely.
- Maintain high coding standards. Keep your code readable, indented properly, commented and indicative.
- Maintain a proper git workflow. Commit often, push often, write informative commit messages.
- You are free to style your webpage however you like. Make it BEAUTIFUL!