Skip to content

Commit

Permalink
Merge pull request #3175 from Vinayakkh/vinayak_repeat
Browse files Browse the repository at this point in the history
Vinayak repeat
  • Loading branch information
kunjgit authored May 13, 2024
2 parents 4bc0226 + a450188 commit 539bc97
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
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

0 comments on commit 539bc97

Please sign in to comment.