-
Notifications
You must be signed in to change notification settings - Fork 0
/
heart beat animation.html
90 lines (82 loc) · 1.67 KB
/
heart beat animation.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
80
81
82
83
84
85
86
87
88
89
90
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Heart Beat Animation</title>
<style>
* {
margin: 0%;
padding: 0%;
box-sizing: border-box;
}
html {
font-size: 62.5%;
}
.main_header {
width: 100vw;
height: 100vh;
background-color: hsl(212, 29%, 94%);
display: grid;
place-items: center;
}
.center_div {
width: 20rem;
height: 20em;
/* background-color: #000; */
background-color: #ee5253;
position: relative;
transform: rotate(45deg);
box-shadow: 0 2.8px 80px rgba(0, 0, 0, 0.034),
0 6.7px 5.3px rgba(0, 0, 0, 0.048), 0 12.5px 10px rgba(0, 0, 0, 0.06),
0 22.3px 17.9px rgba(0, 0, 0, 0.072);
animation: hbeat 1s linear infinite;
}
.center_div::before {
content: "";
width: 100%;
height: 100%;
background-color: #ee5253;
position: absolute;
border-radius: 50%;
transform: translateY(-50%);
}
.center_div::after {
content: "";
width: 100%;
height: 100%;
background-color: #ee5253;
position: absolute;
border-radius: 50%;
transform: translateX(-55%);
}
@keyframes hbeat {
0% {
transform: rotate(45deg) scale(1);
}
20% {
transform: rotate(45deg) scale(1);
}
40% {
transform: rotate(45deg) scale(1.4);
}
60% {
transform: rotate(45deg) scale(1.2);
}
80% {
transform: rotate(45deg) scale(1.4);
}
100% {
transform: rotate(45deg) scale(1);
}
}
</style>
</head>
<body>
<div class="main_header">
<div class="center_div">
hii
</div>
</div>
</body>
</html>