-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
50 lines (39 loc) · 1.49 KB
/
app.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
var heydostum = 0;
var rotate = 0;
var size = 100;
var audio = new Audio('discord.mp3');
const resim = document.getElementById("img");
const ana = document.getElementById("section");
const baslik = document.getElementById("header");
document.getElementById("many").innerHTML = ` ${heydostum} `;
document.getElementById("ever").onclick = function() {bahsetti()};
document.getElementById("button").onclick = function() {okudumKabulEttim()};
//ANIMATIONS
resim.style.animationPlayState = "paused";
baslik.style.animationPlayState = "paused";
ana.style.animationPlayState = "paused";
//FUNCTIONS
async function bahsetti() {
audio.play();
heydostum = heydostum + 1;
rotate = rotate + 10;
size = size + 5;
resim.style.animationPlayState = "running";
baslik.style.animationPlayState = "running";
ana.style.animationPlayState = "running";
await new Promise(r => setTimeout(r, 100));
resim.style.animationPlayState = "paused";
baslik.style.animationPlayState = "paused";
ana.style.animationPlayState = "paused";
resim.style.width = `${size}px`;
resim.style.filter = `hue-rotate(${rotate}deg)`;
document.getElementById("many").innerHTML = ` ${heydostum} `;
}
function okudumKabulEttim(){
heydostum = 0;
size = 100;
rotate = 0;
document.getElementById("many").innerHTML = ` ${heydostum} `;
resim.style.width = `${size}px`;
resim.style.filter = `hue-rotate(${rotate}deg)`;
}