litt oppdatering av landing-siden
This commit is contained in:
parent
9929d0349f
commit
9f2b5a393b
4 changed files with 21 additions and 7 deletions
|
@ -1,10 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=<device-width>, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
Poeng <span id="points"></span><br>
|
||||
<button onclick="addPoints()">Klikk her</button>
|
||||
|
@ -13,19 +15,22 @@
|
|||
<script>
|
||||
let points = 0;
|
||||
let upgrades = 1;
|
||||
function addPoints(){
|
||||
function addPoints() {
|
||||
points += upgrades;
|
||||
document.getElementById('points').innerHTML = points;
|
||||
};
|
||||
function upgrade(){
|
||||
upgrades++;
|
||||
points -= 10;
|
||||
document.getElementById('points').innerHTML = points;
|
||||
function upgrade() {
|
||||
if (points >= 10) {
|
||||
upgrades++;
|
||||
points -= 10;
|
||||
document.getElementById('points').innerHTML = points;
|
||||
}
|
||||
}
|
||||
function reset(){
|
||||
function reset() {
|
||||
points = 0;
|
||||
upgrades = 1;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue