Cloud Animation Effect using HTML CSS
Download : Code
index.html
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="style.css" type="text/css">
<title>Cloud Animataion Effect Using HTML & CSS</title>
</head>
<body>
<div class="container">
<div class="Cloud1">
<img src="cloud1.png" alt="">
</div>
<div class="Cloud2">
<img src="cloud1.png" alt="">
</div>
<div class="Cloud3">
<img src="cloud1.png" alt="">
</div>
<div class="Cloud4">
<img src="cloud1.png" alt="">
</div>
</div>
</body>
</html>Style.css
body{
margin: 0;
padding: 0;
}
.container{
background: url(image.jpg);
background-size: cover;
height: 100vh;
width: 100%;
position: relative;
overflow: hidden;
}
.container img{
width: 100%;
}
.container .Cloud1{
position: absolute;
top: 60px;
animation: cloudOne infinite 30s linear;
}
.container .Cloud2{
position: absolute;
top: -50px;
animation: cloudOne infinite 45s linear;
}
.container .Cloud3{
position: absolute;
top: 0px;
animation: cloudOne infinite 15s linear;
}
.container .Cloud4{
position: absolute;
top: 0px;
animation: cloudOne infinite 60s linear;
}
@keyframes cloudOne {
0%{
transform: translateX(-100%);
}
100%{
transform: translateX(100%);
}
}
@keyframes cloudTwo {
0%{
transform: translateX(-100%);
}
100%{
transform: translateX(100%);
}
}
@keyframes cloudThree {
0%{
transform: translateX(-100%);
}
100%{
transform: translateX(100%);
}
}
@keyframes cloudFour {
0%{
transform: translateX(-100%);
}
100%{
transform: translateX(100%);
}
}

No comments:
Post a Comment