-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from billyrumbiak/main
Program
- Loading branch information
Showing
9 changed files
with
105 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,19 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Aplikasi Acak Nomor</title> | ||
<link rel="stylesheet" href="style.css"> | ||
</head> | ||
|
||
<body> | ||
|
||
<button id="tombolSaya">Roll</button><br> | ||
<label id="labelSaya"></label> | ||
<script src="index.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,10 @@ | ||
const tombolSaya = document.getElementById("tombolSaya"); | ||
const labelSaya = document.getElementById("labelSaya"); | ||
const min = 1; | ||
const max = 10; | ||
let nomorAcak; | ||
|
||
tombolSaya.onclick = function(){ | ||
nomorAcak = Math.floor(Math.random() * max) + min; | ||
labelSaya.textContent = nomorAcak; | ||
} |
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,12 @@ | ||
body{ | ||
font-family: Verdana; | ||
text-align: center; | ||
} | ||
#myButtons{ | ||
font-size: 3em; | ||
padding: 5px 25px; | ||
border-radius: 5px; | ||
} | ||
#myLabel{ | ||
font-size: 3em; | ||
} |
Empty file.
Empty file.
Empty file.
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,23 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Aplikasi Acak Nomor</title> | ||
<link rel="stylesheet" href="style.css"> | ||
</head> | ||
|
||
<body> | ||
|
||
<label id="labelHitung">0</label><br> | ||
<div id="btnContainer"> | ||
<button id="decreaseBtn" class="tombol">Decrease</button> | ||
<button id="resetBtn" class="tombol">Reset</button> | ||
<button id="increaseBtn" class="tombol">Increase</button> | ||
</div> | ||
<script src="index.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 @@ | ||
const decreaseBtn = document.getElementById("decreaseBtn"); | ||
const resetBtn = document.getElementById("resetBtn"); | ||
const increaseBtn = document.getElementById("increaseBtn"); | ||
const labelHitung = document.getElementById("labelHitung"); | ||
let hitung = 0; | ||
|
||
increaseBtn.onclick = function(){ | ||
hitung++; | ||
labelHitung.textContent = hitung; | ||
} | ||
|
||
decreaseBtn.onclick = function(){ | ||
hitung--; | ||
labelHitung.textContent = hitung; | ||
} | ||
|
||
resetBtn.onclick = function(){ | ||
hitung = 0; | ||
labelHitung.textContent = hitung; | ||
} |
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,21 @@ | ||
#labelHitung{ | ||
display: block; | ||
text-align: center; | ||
font-size: 10em; | ||
font-family: Helvetica; | ||
} | ||
#btnContainer{ | ||
text-align: center; | ||
} | ||
.tombol{ | ||
padding: 10px 20px; | ||
font-size: 1.5em; | ||
color: white; | ||
background-color: rgb(120, 122, 243); | ||
border-radius: 10px; | ||
cursor: pointer; | ||
transition: background-color 0.25s; | ||
} | ||
.tombol:hover{ | ||
background-color: rgb(30, 34, 242); | ||
} |