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

Simon game added #25

Closed HardikPanwar closed 9 months ago

HardikPanwar commented 9 months ago

Describe your change:

Checklist:

ATTACH SCREEN-SHOTS

Images
< Before Image >

Screenshot 2023-10-07 223402 | < After Image > | Screenshot 2023-10-07 223412

netlify[bot] commented 9 months ago

Deploy Preview for frontend-database ready!

Name Link
Latest commit a97f64fbb83cdceb6518a6fc4c01a664cdad3b2a
Latest deploy log https://app.netlify.com/sites/frontend-database/deploys/6521900a657c830007dbcc90
Deploy Preview https://deploy-preview-25--frontend-database.netlify.app/projects/color_simon_game
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 9 months ago

Pull Request Report

Hey there! I've generated a report for the pull request. Let's dive in!

Changes

  1. Added a new project called "Simon Game" by Hardik Panwar.
  2. Updated the ProjectList.json file to include the details of the Simon Game project.
  3. Added the game.js file for the Simon Game project.
  4. Added the index.html file for the Simon Game project.
  5. Added the sounds folder for the Simon Game project.
  6. Added the styles.css file for the Simon Game project.

Suggestions

Bugs

Improvements

  1. In the game.js file, consider extracting the code for generating the random color and adding it to the nextSequence function. This will make the code more modular and easier to understand. Here's a code snippet:
function getRandomColor() {
  var randomNumber = Math.floor(Math.random() * buttonColours.length);
  return buttonColours[randomNumber];
}

function nextSequence() {
  // ...
  var randomChosenColour = getRandomColor();
  // ...
}
  1. In the game.js file, consider using a CSS class instead of directly manipulating the style properties in the animatePress function. This will separate the concerns of styling and behavior. Here's a code snippet:
function animatePress(currentColour) {
  $("#" + currentColour).addClass("pressed");

  setTimeout(function () {
    $("#" + currentColour).removeClass("pressed");
  }, 100);
}

Rating

I would rate the code a 7 out of 10. The code is generally readable and well-structured. However, there are some areas where it could be improved for better readability and modularity.

That's it for the report! Let me know if you need any further assistance. Happy coding!

HardikPanwar commented 9 months ago

Hey Ashish, As you have recovered your excluded repo. Now I am contributed again with another project. I hope you will take my PR under the consideration. Pls add "hacktoberfest-accepted" label.