xxxxxxxxxx
1
<div style="height: 100vh">
2
<div class="container color-block blue-gradient">
3
<i class="fas fa-arrow-down arrow"></i>
4
<div class="floor">
5
<div class="box peach-gradient"></div>
6
<div class="box peach-gradient"></div>
7
<div class="box peach-gradient"></div>
8
<div class="box peach-gradient"></div>
9
</div>
10
<button class="btn peach-gradient button">Download</button>
11
</div>
12
</div>
xxxxxxxxxx
1
.container {
2
background-color: #333;
3
height: 100%;
4
color: #eee;
5
font-size: 9rem;
6
display: flex;
7
flex-direction: column;
8
justify-content: center;
9
align-items: center;
10
overflow: hidden;
11
}
12
13
.floor {
14
background-color: #eee;
15
width: 200px;
16
height: 20px;
17
border-radius: 10px;
18
display: flex;
19
padding: 3px;
20
}
21
22
.box {
23
height: 100%;
24
flex-basis: 25%;
25
border-radius: 10px;
26
opacity: 0;
27
transition: all 0.3 ease-in;
28
}
29
30
.arrow {
31
position: relative;
32
top: -100%;
33
transform-origin: bottom center;
34
}
35
36
.button {
37
margin-top: 100px;
38
}
39
xxxxxxxxxx
1
$(document).ready(function () {
2
3
function animate() {
4
const $arrow = $('.arrow');
5
const $floor = $('.floor');
6
$('.box').css({opacity: 0})
7
$arrow.velocity({
8
opacity: 1,
9
top: '10px'
10
}, {
11
duration: 900,
12
easing: "swing",
13
complete: function() {
14
$('.box:nth-child(1)').css({opacity: 1})
15
}
16
}).velocity({
17
rotateZ: '-45'
18
}, {
19
duration: 700,
20
easing: 'ease-in',
21
complete: function () {
22
$('.box:nth-child(2)').css({opacity: 1})
23
$floor.velocity({
24
rotateZ: '-30'
25
}, {
26
delay: 0,
27
duration: 400,
28
easing: 'ease-in'
29
})
30
$arrow.velocity({
31
rotateZ: '-75'
32
}, {
33
delay: 0,
34
duration: 400,
35
easing: 'ease-in',
36
complete: function () {
37
$('.box:nth-child(3)').css({opacity: 1})
38
$arrow.velocity({
39
left: '-60',
40
top: '60'
41
}, {
42
delay: 0,
43
duration: 400,
44
easing: 'ease-in'
45
}).velocity({
46
left: '-60',
47
top: '60',
48
rotateZ: -160,
49
}, {
50
duration: 400,
51
complete: function () {
52
$('.box:nth-child(4)').css({opacity: 1})
53
$arrow.velocity({
54
top: '100vh',
55
left: '-60',
56
rotateZ: -180,
57
}, {
58
easing: 'ease-in',
59
delay: 0,
60
duration: 1200,
61
})
62
$floor.velocity({
63
rotateZ: 0
64
})
65
$arrow.velocity({
66
top: '-100%',
67
rotateZ: 0,
68
left: 0,
69
opacity: 0
70
}, 10)
71
}
72
})
73
}
74
})
75
}
76
})
77
}
78
79
$('.button').on('click', animate);
80
81
});
Console errors: 0