-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheartbeat.html
79 lines (79 loc) · 2.26 KB
/
heartbeat.html
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
74
75
76
77
78
79
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>heartbeat</title>
<style>
*{
padding: 0;
margin: 0;
}
html,body{
height: 100%;
}
body{
background: linear-gradient(to bottom,#ffa5a5 0%,#cccccc 100%);
}
.chest{
width: 500px;
height: 400px;
margin: 100px auto;
position: relative;
}
.chest div{
animation: jump 1s infinite;
}
.left{
position: absolute;
left: 62px;
width: 220px;
height: 220px;
background: linear-gradient(90deg, #F50A45 0%, #d5093c 40%);
/*background: linear-gradient(90deg, #FFFFFF 0%, #000 40%);*/
border-radius:50%;
z-index: 1;
}
.center{
position: absolute;
bottom:100px;
left: 145px;
/*background: linear-gradient(-45deg, #FFFFFF 0%, #000 40%);*/
/*0度从下到上渐变,逆时针负角度开始渐变,顺时针正角度开始渐变*/
background: linear-gradient(-45deg, #B80734 0%, #d5093c 40%);
width: 210px;
height: 210px;
transform: rotate(45deg);
}
.right{
position: absolute;
right: 62px;
width: 220px;
height: 220px;
background: linear-gradient(90deg, #F50A45 0%, #d5093c 40%);
border-radius:50%;
}
@keyframes jump {
0%{
transform: scale(1) rotate(45deg);
box-shadow: 0 0 30px #d5093c;
}
50%{
transform: scale(1.1) rotate(45deg);
box-shadow: 0 0 60px #d5093c;
}
100%{
transform: scale(1) rotate(45deg);
box-shadow: 0 0 30px #d5093c;
}
}
</style>
</head>
<body>
<div class="chest">
<div class="left"></div>
<div class="center"></div>
<div class="right"></div>
</div>
<audio src="heartbeat.mp3" autoplay loop></audio>
</body>
</html>