box animation
SOURCE CODE
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="style.css" />
<title>Landing Page</title>
</head>
<body>
<div class="container">
<div class="rectangle"></div>
<div class="rectangle"></div>
<div class="rectangle"></div>
<div class="rectangle"></div>
</div>
</body>
</html>
CSS
body {
display: flex;
justify-content: center;
align-items: end;
margin: 0%;
height: 100vh;
overflow: hidden;
background: #003566;
}
.container {
display: flex;
/* gap: 20px; */
}
.rectangle {
height: 20px;
width: 50px;
background-color: red;
animation: fun 5s ease infinite ;
}
.rectangle:nth-child(2) {
background: yellow;
animation-delay: 0.6s;
}
.rectangle:nth-child(3) {
background: blue;
animation-delay: 0.8s;
}
.rectangle:nth-child(4) {
background: orange;
animation-delay: 1s;
}
@keyframes fun {
0% ,100%{
transform: translateY(0) rotate(0deg);
}
50% {
transform: translateY(-350px) rotate(110deg);
}
}
Comments
Post a Comment