-
Notifications
You must be signed in to change notification settings - Fork 839
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
111 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# **Click Per Minute** | ||
|
||
--- | ||
|
||
<br> | ||
|
||
## **Description 📃** | ||
|
||
- The "Click Per Minute Game" is an exciting and engaging game where users aim to achieve the highest number of clicks within one minute. It’s a fun and competitive way to test and improve your clicking speed and reaction time. | ||
|
||
## **functionalities 🎮** | ||
|
||
- Real-Time Point Counting: Keep track of your score in real-time as you click the button. | ||
Timer: A one-minute countdown timer to challenge your speed. | ||
Clicking Speed Display: See how fast you can click within the given time frame. | ||
|
||
<br> | ||
|
||
## **How to play? 🕹️** | ||
Simply click the "Click Me!" button as many times as you can within one minute. | ||
Your score will be updated in real-time. | ||
Once the timer reaches zero, your final score will be displayed, showing the total number of clicks per minute. | ||
- | ||
|
||
<br> | ||
|
||
## **Screenshots 📸** | ||
|
||
<br> | ||
![image](../../assets/images/Clicks_PerMin.png) | ||
<br> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
document.addEventListener('DOMContentLoaded', function() { | ||
const clickButton = document.getElementById('clickButton'); | ||
const scoreDisplay = document.getElementById('score'); | ||
const timerDisplay = document.getElementById('timer'); | ||
const gameOverDisplay = document.getElementById('gameOver'); | ||
const finalScoreDisplay = document.getElementById('finalScore'); | ||
|
||
let score = 0; | ||
let timeLeft = 60; // 60 seconds | ||
|
||
clickButton.addEventListener('click', function() { | ||
score++; | ||
scoreDisplay.innerText = `Score: ${score}`; | ||
}); | ||
|
||
// Timer function | ||
const timer = setInterval(function() { | ||
timeLeft--; | ||
let minutes = Math.floor(timeLeft / 60); | ||
let seconds = timeLeft % 60; | ||
timerDisplay.innerText = `Time left: ${minutes}:${seconds.toString().padStart(2, '0')}`; | ||
|
||
if (timeLeft === 0) { | ||
clearInterval(timer); | ||
clickButton.disabled = true; | ||
finalScoreDisplay.innerText = score; | ||
gameOverDisplay.classList.remove('d-none'); | ||
} | ||
}, 1000); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Click Per Minute Game</title> | ||
<!-- Bootstrap CSS --> | ||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"> | ||
<link rel="stylesheet" href="style.css"> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<h1 class="display-4">Click Per Minute Game</h1> | ||
<p class="lead">Click the button as many times as you can in 1 minute!</p> | ||
<button id="clickButton" class="btn btn-primary btn-lg click-button">Click Me!</button> | ||
<p id="score" class="score-board">Score: 0</p> | ||
<p id="timer" class="timer-board">Time left: 1:00</p> | ||
<p id="gameOver" class="game-over d-none">Game over! Your score is <span id="finalScore"></span> clicks per minute.</p> | ||
</div> | ||
|
||
<!-- Bootstrap JS and necessary scripts --> | ||
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js"></script> | ||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script> | ||
<script src="app.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
body { | ||
background-color: #f8f9fa; | ||
} | ||
.container { | ||
text-align: center; | ||
margin-top: 100px; | ||
} | ||
.score-board, .timer-board { | ||
font-size: 1.5rem; | ||
margin-top: 20px; | ||
} | ||
.click-button { | ||
font-size: 1.25rem; | ||
padding: 15px 30px; | ||
} | ||
.game-over { | ||
font-size: 1.75rem; | ||
color: #dc3545; | ||
margin-top: 20px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.