A Pen by Chad S Conway on CodePen.
Created
February 23, 2021 22:01
-
-
Save chadsconway/7db8d53944a6e701b81b0929b12c0a74 to your computer and use it in GitHub Desktop.
CSS Border Animation
This file contains hidden or 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="block"></block> |
This file contains hidden or 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
body { | |
margin: 0; | |
padding: 0; | |
background-color: #000; | |
} | |
.block { | |
position: relative; | |
margin: 300px auto 0; | |
width: 500px; | |
height: 250px; | |
background: linear-gradient(0deg, #000, #272727); | |
} | |
.block:before, .block:after { | |
content: ''; | |
position: absolute; | |
left: -2px; | |
top: -2px; | |
background: linear-gradient(45deg, #fb0094, #0000ff, #00ff00,#ffff00, #ff0000, #fb0094, | |
#0000ff, #00ff00,#ffff00, #ff0000); | |
background-size: 400%; | |
width: calc(100% + 4px); | |
height: calc(100% + 4px); | |
z-index: -1; | |
animation: steam 20s linear infinite; | |
} | |
@keyframes steam { | |
0% { | |
background-position: 0 0; | |
} | |
50% { | |
background-position: 400% 0; | |
} | |
100% { | |
background-position: 0 0; | |
} | |
} | |
.block:after { | |
filter: blur(50px); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment