-
Notifications
You must be signed in to change notification settings - Fork 0
/
Clicker Game
38 lines (35 loc) · 937 Bytes
/
Clicker Game
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<!-- Definitly the most useful game ever... -->
<style>
body {
background-color: powderblue;
font-size: 30px;
text-align: center;
}
#button {
width: 200px;
height: 200px;
background-color: blue;
border-radius: 100px;
margin: 0 auto;
line-height: 200px;
user-select: none;
margin-top: 10px;
}
#score {
margin-top: 10px;
font-size: 60px;
font-weight: bold;
color: green;
}
</style>
<div id="score">0</div>
<div id="button">CLICK ME</div>
<script>
let counter = 0;
document.getElementById('button').onclick = () => {
counter = counter + 1;
document.getElementById('score').innerText = counter;
};
</script>
<!-- Epic updated version: https://replit.com/@DanielKolbin/Clicker-Game?v=1 -->
<!-- Original code from Will (@cyberbotmachines on HubPages) posted on September 4, 2021. Edited and improved by Daniel, ChatGPT, and Bard in August 2023. -->