Skip to content

Commit

Permalink
Merge pull request #24 from billyrumbiak/main
Browse files Browse the repository at this point in the history
Program
  • Loading branch information
billyrumbiak19 authored Jun 25, 2024
2 parents 056d252 + f2f81f6 commit 789220c
Show file tree
Hide file tree
Showing 9 changed files with 105 additions and 0 deletions.
19 changes: 19 additions & 0 deletions billy-aplikasi-acak-no/index.html
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>
10 changes: 10 additions & 0 deletions billy-aplikasi-acak-no/index.js
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;
}
12 changes: 12 additions & 0 deletions billy-aplikasi-acak-no/style.css
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 removed billy-aplikasi-acak-nomor/index.js
Empty file.
Empty file.
23 changes: 23 additions & 0 deletions billy-aplikasi/index.html
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>
20 changes: 20 additions & 0 deletions billy-aplikasi/index.js
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;
}
21 changes: 21 additions & 0 deletions billy-aplikasi/style.css
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);
}

0 comments on commit 789220c

Please sign in to comment.