dev-AshishRanjan / Hacktoberfest-Frontend

Make your Pull Request for Hacktoberfest 2023 in the Web domain specially Frontend. And give this repo a ā­
https://frontend-database.netlify.app
MIT License
14 stars 37 forks source link

feat: Create a functional Music Player #69

Closed purnasth closed 8 months ago

purnasth commented 8 months ago

Describe your change:

Fixes issue #67

Checklist:

ATTACH SCREEN-SHOTS

Screenshot 2023-10-24 003608

| < After Image > |

netlify[bot] commented 8 months ago

Deploy Preview for frontend-database ready!

Name Link
Latest commit 370f67f454f503f63f3f97b46053e419d3673b85
Latest deploy log https://app.netlify.com/sites/frontend-database/deploys/65395642f029700008139768
Deploy Preview https://deploy-preview-69--frontend-database.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

pr-explainer-bot[bot] commented 8 months ago

Hey there! Looks like you need help summarizing the previous results into a Pull Request review markdown document. Let's get started!

Pull Request Review - Summary

Greetings

Hey team! šŸ‘‹ Here's my review of the recent changes made in the code. Overall, great work! Let's dive into the details:

Changes

  1. Added a new section 'MCU music player' with a link to the music player website.
  2. Added an image in the README.md file.
  3. Added CSS styles in the style.css file.
  4. Added JavaScript functionality in the app.js file.
  5. Added music files in the assets/music folder.
  6. Added images in the assets/images folder.

Suggestions

  1. In style.css, consider using more specific selectors instead of using the universal selector '*' for better performance.
  2. In app.js, consider using event delegation instead of adding individual event listeners to each play button for better performance and code organization.
  3. In app.js, consider using a switch statement instead of multiple if-else statements in the toggleRepeatMode() function for better readability and maintainability.

Bugs

  1. In app.js, there is a potential bug in the playNextTrack() function where the playTrack() function is not called when isShuffled is true.
  2. In app.js, there is a potential bug in the handleTrackEnded() function where the playNextTrack() function is called even when repeatMode is 'one'.

Improvements

In app.js, the playSelectedSong() function can be refactored for better readability and code organization:

const playSelectedSong = () => {
  const selectedButton = playButtons[currentTrackIndex];
  if (selectedButton) {
    const src = selectedButton.getAttribute('data-src');
    playTrack(src);
  }
};

Rating

The code has been rated 7.5 out of 10 based on the criteria of readability, performance, and security. Here's a brief explanation:

The code is generally readable and well-organized. However, there are some areas for improvement in terms of performance and potential bugs. The use of more specific selectors in CSS and event delegation in JavaScript can improve performance. There are also potential bugs in the playNextTrack() and handleTrackEnded() functions.

Conclusion

That's it for the review! Keep up the good work and let me know if you have any questions. Cheers! šŸŽ‰

dev-AshishRanjan commented 8 months ago

You can checkout our Idea-Arca, the project idea bank for any languages, for open-source contributions. The PR from this repo is being accepted in hacktoberfest2023

Happy Contributing season! Keep up the good work!