Created
April 3, 2016 03:08
-
-
Save vladris/37a6133308e31c66b3c7f9a76b88518b to your computer and use it in GitHub Desktop.
TV snow effect
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 random-gray(){ | |
$col:random(5); | |
@return rgb($col * 51, $col * 51, $col * 51); | |
} | |
@function grid-dots(){ | |
$sh:(); | |
@for $j from 1 through 20 { | |
@for $i from 1 through 20 { | |
$sh: $sh, (($i*10px)-(10px)) (($j*10px)-(10px)) 0 random-gray(); | |
} | |
} | |
@return $sh; | |
} | |
.snow { | |
margin: auto; | |
width: 200px; | |
height: 200px; | |
&:before{ | |
content:''; | |
position: absolute; | |
width: 10px; | |
height: 10px; | |
background: black; | |
box-shadow: grid-dots(); | |
animation: snow 1.5s linear infinite; | |
} | |
} | |
@keyframes snow { | |
@for $i from 1 through 10{ | |
#{$i*10}% { box-shadow: grid-dots(); } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment