Not sure why, but here. At least it's oddly responsive. #useless
A Pen by Jake Albaugh on CodePen.
Not sure why, but here. At least it's oddly responsive. #useless
A Pen by Jake Albaugh on CodePen.
| .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; | |
| } | |
| } |