Skip to content

Instantly share code, notes, and snippets.

@raphael22
Created November 15, 2013 00:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raphael22/7477361 to your computer and use it in GitHub Desktop.
Save raphael22/7477361 to your computer and use it in GitHub Desktop.
A Pen by Raphael.
-(1..36).each do |i|
.s
@import "compass";
$n: 36;
$h: 1px;
$a: 360deg/$n;
html {
position: fixed;
height: 100%;
width: 100%;
background: linear-gradient(1deg, rgba(blue, .5), rgba(red,.8));
}
.s, .s:before {
position: absolute;
top: 50%; left: 50%;
}
.s {
@for $i from 0 to $n {
&:nth-child(#{$i + 1}) {
transform: rotate($i*$a) translate(0px);
&:before {
background:hsl($i*10,50%,50%);
$rand:random(25)+10;
width: $rand+px;
height: $rand+px;
$rand:random(15)+5;
animation: translate $rand+s ease-in-out infinite;
}
}
}
}
.s:before {
margin : 2px 0;
border-radius:50%;
content: '';
transition:width 1s,height 1s;
}
#container{
position: relative;
top: 50%;
}
@keyframes translate { 0% { transform: translate(0px); }
25% { transform: translate(-100px); }
50% { transform: translate(0px); }
75% { transform: translate( 100px); }
100% { transform: translate(0px); } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment