|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="en"> |
| 3 | +<head> |
| 4 | + <meta charset="UTF-8"> |
| 5 | + <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 6 | + <title>Number Guessing Game</title> |
| 7 | + <link rel="stylesheet" href="style.css"> |
| 8 | +</head> |
| 9 | +<body> |
| 10 | + <div class="container"> |
| 11 | + <header> |
| 12 | + <h1>🎯 Number Guessing Game</h1> |
| 13 | + <p>I'm thinking of a number between 1 and 100. Can you guess it?</p> |
| 14 | + </header> |
| 15 | + |
| 16 | + <div class="game-container"> |
| 17 | + <div class="game-info"> |
| 18 | + <div class="stat"> |
| 19 | + <span class="stat-label">Attempts:</span> |
| 20 | + <span id="attempts">0</span> |
| 21 | + </div> |
| 22 | + <div class="stat"> |
| 23 | + <span class="stat-label">Best Score:</span> |
| 24 | + <span id="best-score">-</span> |
| 25 | + </div> |
| 26 | + <div class="stat"> |
| 27 | + <span class="stat-label">Games Won:</span> |
| 28 | + <span id="games-won">0</span> |
| 29 | + </div> |
| 30 | + </div> |
| 31 | + |
| 32 | + <div class="game-area"> |
| 33 | + <div class="guess-container"> |
| 34 | + <input type="number" id="guess-input" placeholder="Enter your guess (1-100)" min="1" max="100"> |
| 35 | + <button id="guess-btn" class="btn primary">Guess</button> |
| 36 | + </div> |
| 37 | + |
| 38 | + <div class="feedback" id="feedback"> |
| 39 | + <p>Start guessing to begin!</p> |
| 40 | + </div> |
| 41 | + |
| 42 | + <div class="range-indicator"> |
| 43 | + <div class="range-bar"> |
| 44 | + <div class="range-fill" id="range-fill"></div> |
| 45 | + </div> |
| 46 | + <div class="range-labels"> |
| 47 | + <span id="min-range">1</span> |
| 48 | + <span id="max-range">100</span> |
| 49 | + </div> |
| 50 | + </div> |
| 51 | + |
| 52 | + <div class="game-controls"> |
| 53 | + <button id="new-game-btn" class="btn secondary">New Game</button> |
| 54 | + <button id="hint-btn" class="btn hint" disabled>Get Hint</button> |
| 55 | + </div> |
| 56 | + </div> |
| 57 | + |
| 58 | + <div class="difficulty-selector"> |
| 59 | + <h3>Choose Difficulty:</h3> |
| 60 | + <div class="difficulty-options"> |
| 61 | + <button class="difficulty-btn active" data-difficulty="easy">Easy (1-50)</button> |
| 62 | + <button class="difficulty-btn" data-difficulty="medium">Medium (1-100)</button> |
| 63 | + <button class="difficulty-btn" data-difficulty="hard">Hard (1-200)</button> |
| 64 | + </div> |
| 65 | + </div> |
| 66 | + </div> |
| 67 | + |
| 68 | + <div class="instructions"> |
| 69 | + <h3>How to Play:</h3> |
| 70 | + <ul> |
| 71 | + <li>🎯 Guess a number within the given range</li> |
| 72 | + <li>📊 Get feedback on whether your guess is too high or too low</li> |
| 73 | + <li>🎉 Try to guess the number in as few attempts as possible</li> |
| 74 | + <li>💡 Use hints if you get stuck!</li> |
| 75 | + </ul> |
| 76 | + </div> |
| 77 | + </div> |
| 78 | + |
| 79 | + <script src="script.js"></script> |
| 80 | +</body> |
| 81 | +</html> |
0 commit comments