Wednesday, October 16

Pure CSS Rainfall Effect

Pure CSS Rainfall Effect

HTML

 

<!DOCTYPE html>
<html>
<head>
<title> Pure CSS Rain fall Effect</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
<section></section>
</body>
</html>

CSS

body{
    margin: 0;
    padding: 0''
}
section{
    position: relative;
    width: 100%;
    height: 100vh;
    background: url(pic.jpg);
    background-size: cover;
    animation:color-change 3s linear infinite;
}
section:before{
    content:"";
    position:absolute;
    top:0;
    left:0;
    width:100%;
    height: 100%;
    background: url(rain.png);
    animation: rain 0.2s linear infinite;
        
}
@keyframes color-change{
    {
    0% 100%
    filter:hue-rotate(0deg);
}
    50%{
        filter:hue-rotate(360deg);
    }
}
@keyframes rain
{
    0%{
        background-position: 0 0; 
    }
    100%{
        background-position: 20% 100%;
    }
}

Leave a Reply

Your email address will not be published. Required fields are marked *