Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save GradientAnimator/be92e76a55724264753601af4b1efdb5 to your computer and use it in GitHub Desktop.
Save GradientAnimator/be92e76a55724264753601af4b1efdb5 to your computer and use it in GitHub Desktop.
CSS Gradient Animation
.css-selector {
    background: linear-gradient(127deg, #10100e, #310fd1, #ff6157, #520c33, #23c0bf);
    background-size: 1000% 1000%;
    -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