Skip to content

Instantly share code, notes, and snippets.

@Et7f3
Forked from anonymous/my.css
Last active November 23, 2017 07:22
Show Gist options
  • Save Et7f3/740b8cda1c83fba847ccb412773e9d48 to your computer and use it in GitHub Desktop.
Save Et7f3/740b8cda1c83fba847ccb412773e9d48 to your computer and use it in GitHub Desktop.
CSS Gradient Animation
<!DOCTYPE html>
<html>
<head>
<style>
/*an exemple for my friend
**voici un exemple d'animation*/
div
{
width: 100px;
height: 100px;
}
div.anim1
{
background-color: red;
animation-name: anim1;
animation-duration: 4s;
animation-iteration-count: infinite;
}
@keyframes anim1
{
0% {background-color: red;}
50% {background-color: yellow;}
}
div.anim2
{
background: linear-gradient(270deg, #ff0000, #ff0000, #ff8080, #ff0000, #ff0000);
background-size: 1000% 1000%;
animation-name: anim2;
animation-duration: 4s;
animation-iteration-count: infinite;
}
@keyframes anim2
{
0%{background-position:0% 50%}
50%{background-position:100% 50%}
100%{background-position:0% 50%}
}
div.anim3
{
background: linear-gradient(225deg, #ff0000, #ff0000, #ff8080, #ff0000, #ff0000);
background-size: 1000% 1000%;
animation-name: anim3;
animation-duration: 4s;
animation-iteration-count: infinite;
}
@keyframes anim3
{
0%{background-position:0% 50%}
50%{background-position:100% 50%}
100%{background-position:0% 50%}
}
</style>
</head>
<body>
<div class="anim1"></div>
<div class="anim2"></div>
<div class="anim3"></div>
<div class="anim1"></div>
<div class="anim2"></div>
<div class="anim3"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment