How to create awesome Bouncing Ball animation effect |animation || HTML and CSS Important Tricks

preview_player
Показать описание
How to create awesome Bouncing Ball animation effect |animation || HTML and CSS Important Tricks
Рекомендации по теме
Комментарии
Автор

<!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>Document</title>
<style>
*{
margin: 0px;
padding: 0px;
box-sizing: border-box;
}
body{
height: 100vh;
width: 100vw;
display: flex;
justify-content: center;
align-items: center;
background-color: black;
}
ul{
display: flex;
border-bottom: 20px solid blue;
border-radius: 10px;
}
ul li{
height: 50px;
width: 50px;
list-style: none;
background-color: gold;
margin: auto 10px;
border-radius: 50%;
animation: ball 4s linear infinite;
}

@keyframes ball{
0%{
transform: translateY(0);
}
50%{
transform: translateY(-150px);
}
0%{
transform: translateY(0);
}
}
ul li:nth-child(2){
animation-delay: 0.8s;
}
ul li:nth-child(3){
animation-delay: 1.6s;
}
ul li:nth-child(4){
animation-delay: 2.4s;
}
ul li:nth-child(5){
animation-delay: 3.2s;
}
</style>
</head>
<body>
<ul>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</body>
</html>

sarcodertech