-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
36 lines (30 loc) · 831 Bytes
/
script.js
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
let angkaRandom;
let acak;
let x;
function myFunction() {
randomLoad();
x = document.getElementById("pria").value;
y = document.getElementById("wanita").value;
document.getElementById("cowo").innerHTML = x;
document.getElementById("cewe").innerHTML = y;
}
function random(){
angkaRandom = Math.floor(Math.random()*100)+1;
document.getElementById("persentase").innerHTML = `${angkaRandom} %`;
}
function randomLoad(){
acak = setInterval(function(){
random();
}, 100);
setTimeout(function(){
// buatAnimasi();
clearInterval(acak);
}, 4000);
setTimeout(function(){
buatAnimasi();
}, 4000)
}
function buatAnimasi(){
img = document.getElementsByClassName("bimlek");
img.style.animation = "melayang .3s ease-in-out alternate infinite;";
}