Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save GradientAnimator/965ec7e6b07d502b305da158146320fd to your computer and use it in GitHub Desktop.
Save GradientAnimator/965ec7e6b07d502b305da158146320fd to your computer and use it in GitHub Desktop.
CSS Gradient Animation
.css-selector {
    background: linear-gradient(127deg, #10100e, #310fd1, #ff6157, #520c33);
    background-size: 800% 800%;
    -webkit-animation: hero-home 38s ease infinite;
    -moz-animation: hero-home 38s ease infinite;
    -o-animation: hero-home 38s ease infinite;
    animation: hero-home 38s ease infinite;
}
@-webkit-keyframes hero-home {
    0%{background-position:0% 50%}
    50%{background-position:100% 50%}
    100%{background-position:0% 50%}
}
@-moz-keyframes hero-home {
    0%{background-position:0% 50%}
    50%{background-position:100% 50%}
    100%{background-position:0% 50%}
}
@-o-keyframes hero-home {
    0%{background-position:0% 50%}
    50%{background-position:100% 50%}
    100%{background-position:0% 50%}
}
@keyframes hero-home {
    0%{background-position:0% 50%}
    50%{background-position:100% 50%}
    100%{background-position:0% 50%}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment