Skip to content

Instantly share code, notes, and snippets.

@ja-k-e
Last active August 29, 2015 14:21
Show Gist options
  • Save ja-k-e/76c66dbded18d611295e to your computer and use it in GitHub Desktop.
Save ja-k-e/76c66dbded18d611295e to your computer and use it in GitHub Desktop.
Amoebic Mass
.container
- (1..60).each do |l|
%span{:class => "light light-#{l}"}
*, *::before, *::after {
box-sizing: border-box;
}
html {
background: radial-gradient(#222, #000);
background-attachment: fixed;
}
body {
margin: 0;
overflow: hidden;
text-align: center;
}
$lights: 60;
$margin: 30px;
$speed: 4s;
.container {
width: 80%;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
}
@mixin light($color, $delay){
position: relative;
display: inline-block;
width: 0;
height: 0;
margin: $margin;
background-color: rgba(255,255,255,0);
opacity: 0;
animation: light $speed linear infinite;
animation-delay: $delay;
border-radius: 50%;
box-shadow:
0 0 40px 20px rgba(255,255,255,0.5),
0 0 50px 40px $color;
}
@for $i from 1 through $lights {
$random: (random(100)/100);
$random_timing: 0.5s * (random(1000)/100);
$random_color: hsl($random*360,50%,50%);
.light-#{$i} {
@include light($random_color, $random_timing);
}
}
@keyframes light {
0% {
opacity: 0;
}
30% {
opacity: 0.5;
}
70% {
opacity: 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment