diff --git a/Games/Guess_The_Number/main.js b/Games/Guess_The_Number/main.js index 42ad5ac618..175301131b 100644 --- a/Games/Guess_The_Number/main.js +++ b/Games/Guess_The_Number/main.js @@ -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"); @@ -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(); diff --git a/Games/Guess_The_Number/style.css b/Games/Guess_The_Number/style.css index 335ab9635c..f7fdfcefd8 100644 --- a/Games/Guess_The_Number/style.css +++ b/Games/Guess_The_Number/style.css @@ -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%;