Skip to content

Instantly share code, notes, and snippets.

@CodeMyUI
Created January 10, 2017 04:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save CodeMyUI/aa3d7a4b253c15ef772d30363de3a3ab to your computer and use it in GitHub Desktop.
Save CodeMyUI/aa3d7a4b253c15ef772d30363de3a3ab to your computer and use it in GitHub Desktop.
Animated Back Glow
<div>BACKLIGHT</div>
*{box-sizing: border-box;}
html,
body {
margin: 0 auto;
height: 100%;
}
body {
display: flex;
align-items: center;
font-family: monospace;
justify-content: center;
background-color:darken(#252B37, 4%);
}
@mixin backlight($x, $y, $spread, $size, $colorA, $colorB, $duration) {
&:after {
position: absolute;
content: "";
top: $y;
left: $x;
right: 0;
z-index: -1;
height: 100%;
width: 100%;
margin: 0 auto;
transform: scale($size);
-webkit-filter: blur($spread);
background: linear-gradient(270deg, $colorA, $colorB);
background-size: 200% 200%;
animation: animateGlow $duration ease infinite;
@keyframes animateGlow {
0%{background-position:0% 50%}
50%{background-position:100% 50%}
100%{background-position:0% 50%}
}
}
}
div {
position: relative;
width: 30vw;
height: 30vw;
line-height: 30vw;
text-align: center;
color: #252B37;
background-color: #151823;
animation: textColor 10s ease infinite;
@include backlight(0, 5vw, 5vw, 0.75, #0fffc1, #7e0fff, 10s);
@keyframes textColor {
0% {
color: #7e0fff;
}
50% {
color: #0fffc1;
}
100% {
color: #7e0fff;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment