Skip to content

Instantly share code, notes, and snippets.

@NunteGamer
Created March 31, 2023 23:05
Show Gist options
  • Save NunteGamer/21ebbb7465c4f52fd68928f3cc22ee3e to your computer and use it in GitHub Desktop.
Save NunteGamer/21ebbb7465c4f52fd68928f3cc22ee3e to your computer and use it in GitHub Desktop.
Clicker Game by Nunte Gamer
<!DOCTYPE html>
<body>
<h1>Clicker Game</h1>
<h2>Click to earn points.</2>
<p>Points: <span id="score">0</span></p>
<button id="parte-btn">Click!</button>
</body>
var score = 0;
var parteBtn = document.getElementById("parte-btn");
var scoreText = document.getElementById("score");
parteBtn.addEventListener("click", function() {
score++;
scoreText.innerHTML = score;
});
html, body {
user-select: none;
text-align: center;
}
body {
background-color: #f1f1f1;
text-align: center;
font-family: "Roboto", sans-serif;
width: 500px;
height: 200px;
}
h1 {
margin-top: 50px;
}
h2 {
margin-top: 35px;
}
#parte-btn {
background-color: red;
color: white;
border: none;
padding: 15px 32px;
text-align: center;
font-size: 24px;
margin: 20px;
cursor: pointer;
}
#parte-btn:hover {
background-color: #b30000;
}
p {
font-size: 18px;
margin-top: 50px;
}
body {
background-color: #f1f1f1;
text-align: center;
}
h1 {
margin-top: 50px;
}
#parte-btn {
background-color: red;
color: white;
border: none;
padding: 15px 32px;
border-radius: 10px;
text-align: center;
font-size: 24px;
margin: 20px;
cursor: pointer;
box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
}
#parte-btn:hover {
background-color: #b30000;
}
p {
font-size: 18px;
margin-top: 50px;
}
@NunteGamer
Copy link
Author

i coded this lmao

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment