1<!DOCTYPE html>
2<html lang="en">
3<head>
4 <meta charset="UTF-8">
5 <meta name="viewport" content="width=device-width, initial-scale=1.0">
6 <title>Animation</title>
7 <style>
8 body {
9 margin: 0;
10 background-color: #fff;
11 }
12 .circle {
13 position: relative;
14 width: 100%;
15 height: 50vh;
16 background-color: #ff0000;
17 display: flex;
18 justify-content: center;
19 align-items: center;
20 }
21 .circle::before {
22 content: '';
23 width: 20px;
24 height: 20px;
25 border-radius: 50%;
26 background-color: #000;
27 opacity: 0.2;
28 }
29 .animate {
30 animation: move 4s infinite;
31 }
32 @keyframes move {
33 0% {
34 transform: translateY(0);
35 }
36 50% {
37 transform: translateY(-50vh);
38 }
39 100% {
40 transform: translateY(0);
41 }
42 }
43 </style>
44</head>
45<body>
46 <div class="circle animate"></div>
47</body>
48</html>