准备一个测试页面

需要的依赖:

https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>跳动的心</title>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css" rel="stylesheet" />
<link href="a.css" rel="stylesheet" />
</head>
<body>
<i class="fa-fw fas fa-heartbeat card-announcement-animation cc_pointer" style="color:red"></i>跳动的心
</body>
</html>

a.css

1
2
3
4
5
6
7
8
9
10
11
12
13
14
.fa-heartbeat {
font-size: 15px;
color: rgba(255, 0, 0, 0.1);
animation: donghua 1000ms 0ms infinite linear reverse;
}
@keyframes donghua {
from {
color: rgba(255, 0, 0, 0.1);
}
to {
color: rgba(255, 0, 0, 1);
}
}

跳动的心