Loading CSS animation
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<img src="ghost.png" class="ghost" alt="">
<img src="shadow.png" class="shadow" alt="">
</div>
</body>
</html>
CSS
* {
margin: 0;
padding: 0;
box-sizing: border-box;
background-color: #ff4814;
}
.container{
display: flex;
flex-direction: column;
height: 100vh;
align-items: center;
justify-content: center;
}
.ghost{
margin-bottom: 5px;
width: 20%;
animation: float 3s ease-out infinite;
}
@keyframes float{
50%{
transform: translate(0,20px);
}
}
.shadow{
margin-left: 15px;
animation: shrink 3s ease-out infinite;
transform-origin: center;
}
@keyframes shrink{
0%, 100%{
width: 18%;
}
50%{
width: 10%;
}
}
PNG Files
👇👇👇
Comments
Post a Comment