Bouncing Ball animation using CSS
PROGRAM SOURCE CODE :-
1) HTML coding :-
<!DOCTYPE html>
<html>
<head>
<title>Bouncing Ball's Animation</title>
<link rel="stylesheet" type="text/css"
href="Bouncing_Ball.css">
</head>
<body>
<div class="main">
<ul>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</div>
</body>
</html>
2) CSS coding :-
*{
margin:0px;
padding: 0px;
box-sizing: border-box;
}
.main{
width: 100vw;
height: 100vh;
background-color:black;
display:grid;
place-items: center;
position: relative;
}
.main ul{
display: inline-flex;
border-bottom: 15px solid #fff;
}
.main ul li{
list-style-type: none;
width: 50px;
height: 50px;
margin:20px 20px 0px 20px;
border-radius: 50%;
animation: bounce 1s linear infinite;
}
@keyframes bounce{
0%{
transform: translateY(0px);
}
50%{
transform: translateY(-200px);
}
100%{
transform: translateY(0px);
}
}
.main ul li:nth-child(1){
background-color: red;
animation-delay: 0s;
}
.main ul li:nth-child(2){
background-color:yellow;
animation-delay: 0.2s;
}
.main ul li:nth-child(3){
background-color:cyan;
animation-delay: 0.4s;
}
.main ul li:nth-child(4){
background-color:#fff;
animation-delay: 0s;
}
.main ul li:nth-child(5){
background-color: magenta;
animation-delay: 0.3s;
}
.main ul li:nth-child(6){
background-color: blue;
animation-delay: 0.1s;
}
OUTPUT :-
( NOTE : - While executing program you have to replace links of images , audio's or video's in this program by your links. So take care of it ! )