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

Vinayak repeat #3175

Merged
merged 5 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Games/Guess_The_Number/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
var guessInput = document.getElementById("guess");
var guessBtn = document.getElementById("my_btn");
const resetBtn = document.querySelector('.reset-btn');
console.log(guessInput);

var msg1 = document.getElementById("message1");
var msg2 = document.getElementById("message2");
Expand All @@ -17,7 +18,7 @@ var guesses_num = [];
var lives=10;

resetBtn.addEventListener('click', reset);
guessBtn.addEventListener('click', play);
// guessBtn.addEventListener('click', play); this line cause repetition of play() function on click guess button
guessInput.addEventListener('keypress', function(event) {
if (event.key === 'Enter') {
play();
Expand Down
9 changes: 6 additions & 3 deletions Games/Guess_The_Number/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@ body {
}

.container {

position: absolute;
width: 50%;
/* separate home button from the guessing number container */
/* responsive */
width: auto;
margin-top:55px;
min-width: 580px;
/* min width for device is 300 px */
min-width: 300px;

transform: translate(-50%, -50%);
top: 50%;
left: 50%;
Expand Down
Loading