A Pen by Caree Youngman on CodePen.
Created
April 6, 2019 05:12
-
-
Save CodeMyUI/226a1ad2168b6125851f167dee65ff86 to your computer and use it in GitHub Desktop.
SCSS Radiating Text
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
<h1 class="name"> | |
Chris is the bomb | |
</h1> |
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
//Inspired by Johan Fagerbeg's pen: https://codepen.io/birjolaxew/pen/EPOobx?editors=0100 |
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
$colors: red, orange, yellow, blue; | |
$size: 25; | |
@mixin rainbow-shadow($colors, $offset: 0, $size: $size) { | |
$len: length($colors); | |
$outp: 0px 0px transparent; | |
@for $i from 1 through $size { | |
$ind: floor( max($i + $offset, 1) / $size * length($colors) ) % $len + 1; | |
$col: nth($colors, $ind); | |
$outp: #{$outp}, #{$i}px #{$i}px #{$col}; | |
} | |
text-shadow: $outp; | |
} | |
body { margin: 0; background: #171717; } | |
h1 { | |
position: absolute; left: 50%; top: 50%; | |
transform: translate(-50%, -50%); | |
margin: -#{$size/2}px 0 0; | |
font-family: 'Pacifico', cursive; | |
font-size: 15vh; | |
color: white; | |
text-align: center; | |
} | |
.name { | |
animation: animated-rainbow-shadow 1s infinite; | |
} | |
@keyframes animated-rainbow-shadow { | |
@for $i from 0 to $size + 1 { | |
#{$i / $size * 100}% { | |
@include rainbow-shadow($colors, $i); | |
} | |
} | |
} |
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
<link href="https://fonts.googleapis.com/css?family=Pacifico" rel="stylesheet" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment