-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathapp.js
More file actions
73 lines (71 loc) · 2.37 KB
/
app.js
File metadata and controls
73 lines (71 loc) · 2.37 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
var progress = document.querySelector(".progress");
var percent = document.querySelector(".percent");
var textBox = document.querySelector(".textBox");
var button = document.querySelector(".button");
var textBtn = document.querySelector(".textBtn");
var heartBox = document.querySelector(".heartBox");
var cursor = document.querySelector(".buttonCLick img");
var heartItem1 = document.querySelector(".heartItem.item1")
var heartItem2 = document.querySelector(".heartItem.item2")
var heartItem3 = document.querySelector(".heartItem.item3")
var count = 0;
var percentWidth = 0;
var heartLeft = -3.2;
var progressLoad = setInterval(progressInterva,100)
button.addEventListener("click", function(){
button.style.transform = "scale(0.8)";
setTimeout(()=>{
button.style.transform = "scale(1)";
window.location.href = "./love/love.html"
},200)
})
function progressInterva(){
if(count == 100 && percentWidth == 100){
clearInterval(progressLoad)
percent.textContent = "Ok rùi đó:)";
percent.style.letterSpacing = "1px";
textBox.style.transform = "scale(1.3)"
heartItem3.style.animation = "1s heartScale forwards"
setTimeout(()=>{
textBox.style.transform = "scale(0)"
},400)
setTimeout(()=>{
textBox.style.opacity = "0"
},600)
setTimeout(()=>{
button.style.transform= "scale(1)";
},800);
setTimeout(()=>{
button.style.background = "rgb(244,118,121)"
button.style.width = "130px";
button.style.borderRadius = "20px"
},1500)
setTimeout(()=>{
button.style.height = "40px";
},2000)
setTimeout(()=>{
textBtn.textContent = "Click me!"
textBtn.style.color = "#fff"
},2500)
setTimeout(()=>{
cursor.style.opacity = "1";
},3000)
}
else{
if(count == 10){
heartItem1.style.animation = "1s heartScale forwards"
}
if(count ==46){
percent.style.color= "#fff"
}
if(count == 60){
heartItem2.style.animation = "1s heartScale forwards"
}
count += 1;
percentWidth += 1;
heartLeft += 0.968;
progress.style.width = percentWidth + '%'
percent.innerText = count + '%'
heartBox.style.left = heartLeft + '%'
}
}