Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'Play Again' button to restart game after prediction #151

Merged
merged 1 commit into from
Oct 7, 2024

Conversation

harish08102004
Copy link
Contributor

@harish08102004 harish08102004 commented Oct 4, 2024

What does this PR do?

This PR adds a "Play Again" button that allows users to restart the game without refreshing the page after a wife prediction has been made.

Changes made:

  • Added a "Play Again" button that becomes visible after a prediction is completed.
  • When clicked, the button redirects the user back to the main page where they can enter a name and play again.
  • Adjusted the logic to properly reset the game state, including unchecking the checkbox and resetting the input field.

Why is this change required?

Previously, users had to refresh the page manually to play the game again. This addition streamlines the user experience by allowing them to easily start over with the new button.

How to test:

  1. Play the game by entering your name and checking the box.
  2. After the wife prediction appears, click the "Play Again" button.
  3. Verify that the game resets, allowing you to play again from the main page.

Issue Resolved

#122

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome to Our repository.🎊 Thank you so much for taking the time to point this out.

@harish08102004
Copy link
Contributor Author

Hey @paulkrishanu4 please review and merge it.
Additionally please add labels.
hacktoberfest-accepted,
level

Copy link
Owner

@1Shubham7 1Shubham7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please share a video of how the play again works and looks after your changes : )

@harish08102004
Copy link
Contributor Author

Ok I will do that.

@harish08102004
Copy link
Contributor Author

harish08102004 commented Oct 7, 2024

Hey @1Shubham7 ,

Here is the screen recording of the changes made on implementing play again button.

Wife.predictor.mp4

Copy link
Owner

@1Shubham7 1Shubham7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good ! maybe the play again button can be improved. but we can do that in another PR : )

@1Shubham7 1Shubham7 merged commit bc73322 into 1Shubham7:main Oct 7, 2024
1 check passed
@harish08102004
Copy link
Contributor Author

harish08102004 commented Oct 7, 2024

Hey @1Shubham7 can you add labels for this PR.

@1Shubham7
Copy link
Owner

yes, was about to do that : )

@1Shubham7 1Shubham7 added gssoc-ext Issues under GSSoC label will be counted for GSSoC'24 extended Level2 hacktoberfest hacktoberfest-accepted labels Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gssoc-ext Issues under GSSoC label will be counted for GSSoC'24 extended hacktoberfest hacktoberfest-accepted Level2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants