Last active
November 9, 2020 09:33
Star
You must be signed in to star a gist
Seamless Animated RGB Rainbow strip - https://codepen.io/richarddewit/pen/VwjEWEL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.rainbow-wrapper { | |
position: absolute; | |
left: 0; | |
right: 0; | |
top: 0; | |
height: 10px; | |
width: 100%; | |
overflow: hidden; | |
} | |
.rainbow { | |
position: absolute; | |
left: 0; | |
top: 0; | |
height: 100%; | |
width: 200%; | |
background: linear-gradient( | |
90deg, | |
#ff2400, | |
#e81d1d, | |
#e8b71d, | |
#e3e81d, | |
#1de840, | |
#1ddde8, | |
#2b1de8, | |
#dd00f3, | |
#dd00f3, | |
#ff2400, | |
#e81d1d, | |
#e8b71d, | |
#e3e81d, | |
#1de840, | |
#1ddde8, | |
#2b1de8, | |
#dd00f3, | |
#dd00f3, | |
#ff2400 | |
); | |
transform: translate3d(0, 0, 0); | |
animation: rainbow 6s linear infinite; | |
} | |
@keyframes rainbow { | |
100% { | |
transform: translateX(-50%); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="rainbow-wrapper"> | |
<div class="rainbow"></div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment