A Pen by Nunte Gamer on CodePen.
Created
March 31, 2023 23:05
-
-
Save NunteGamer/21ebbb7465c4f52fd68928f3cc22ee3e to your computer and use it in GitHub Desktop.
Clicker Game by Nunte Gamer
This file contains hidden or 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
<!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> |
This file contains hidden or 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
var score = 0; | |
var parteBtn = document.getElementById("parte-btn"); | |
var scoreText = document.getElementById("score"); | |
parteBtn.addEventListener("click", function() { | |
score++; | |
scoreText.innerHTML = score; | |
}); |
This file contains hidden or 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
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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
i coded this lmao