Ball Drop
by VisheshBansal
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta author="Vishesh Bansal">
<link rel="stylesheet" href="ballmovement.css">
</head>
<body>
<div class="ball-drop"></div>
</body>
</html>
CSS
.ball-drop {
position: absolute;
width: 80px;
height: 80px;
align-self: center;
border-radius: 100%;
animation: drop 1.5s;
transform: translateY(0px);
animation-iteration-count: infinite;
margin: 50px;
background: -webkit-radial-gradient(25px 25px, circle, red, #000);
background: -moz-radial-gradient(25px 25px, circle, red, #000);
background: radial-gradient(25px 25px, circle, red, #000);
}
@keyframes drop {
0% {
top: 0;
-webkit-animation-timing-function: ease-in;
}
40% {
}
50% {
top: 130px;
height: 80px;
-webkit-animation-timing-function: ease-out;
}
55% {
top: 120px;
height: 70px;
-webkit-animation-timing-function: ease-in;
}
65% {
top: 130px;
height: 80px;
-webkit-animation-timing-function: ease-out;
}
95% {
top: 130px;
-webkit-animation-timing-function: ease-in;
}
100% {
top: 120px;
-webkit-animation-timing-function: ease-in;
}
}