A bit of JS and CSS3 to make a stack of "needles" that eventually start spinning and cycling through the color wheel. You can play with the first variable to change the pattern and effects.
Created
April 26, 2014 10:36
-
-
Save findix/11316784 to your computer and use it in GitHub Desktop.
A Pen by Lawren.
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="ring"> | |
<ul> | |
</ul> | |
</div> | |
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
$(function(){ | |
var numLines = 50; | |
for (var i = 0; i < numLines; i++) { | |
$('ul').append('<li></li>'); | |
} | |
var zInc = 360 / $('li').length; | |
for (var i = 0; i < $('li').length; i++) { | |
$('li').eq(i).css('-webkit-animation-delay', (i * 3/numLines) + 's') | |
//.css('border-color', 'hsla(' + ( 255/numLines * i) + ', 50%, 50%, 1)') | |
} | |
}) |
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
.ring { | |
-webkit-transform-style: preserve-3d; | |
-webkit-perspective: 800; | |
} | |
ul { list-style-type: none; width:100%; height: 100%; } | |
li { | |
display: block; | |
width: 100%; | |
border: #000 5px solid; | |
border-radius: 100%; | |
-webkit-animation: spin linear 3s infinite; | |
} | |
@-webkit-keyframes spin { | |
0% { border-color: hsla(0, 50%, 50%, 1);} | |
10% { border-color: hsla(36, 50%, 50%, 1);} | |
20% { border-color: hsla(72, 50%, 50%, 1);} | |
30% {border-color: hsla(108, 50%, 50%, 1);} | |
40% {border-color: hsla(144, 50%, 50%, 1);} | |
50% {border-color: hsla(180, 50%, 50%, 1);} | |
60% {border-color: hsla(216, 50%, 50%, 1);} | |
70% { border-color: hsla(252, 50%, 50%, 1);} | |
80% {border-color: hsla(288, 50%, 50%, 1);} | |
90% {border-color: hsla(324, 50%, 50%, 1);} | |
100% {-webkit-transform: rotateZ(360deg); border-color: hsla(360, 50%, 50%, 1);} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment