1、实现一个小球抛物线动画
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
.ball{
position: absolute;
top: 500px;
width: 50px;
height: 50px;
border-radius: 50%;
/*background: red;*/
animation: moveX 2s linear forwards;
/*border: 1px dashed red;*/
}
.inner{
width: 100%;
height: 100%;
border-radius: 50%;
background: red;
animation: moveY 2s cubic-bezier(0.5, -1, 1, 1) forwards;
}
@keyframes moveX {
to {
transform: translateX(500px);
}
}
@keyframes moveY {
to {
transform: translateY(400px);
}
}
</style>
</head>
<body>
<div class="ball">
<div class="inner"></div>
</div>
</body>
</html>