Skip to content

Instantly share code, notes, and snippets.

@vladris
Created April 3, 2016 03:08
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 vladris/37a6133308e31c66b3c7f9a76b88518b to your computer and use it in GitHub Desktop.
Save vladris/37a6133308e31c66b3c7f9a76b88518b to your computer and use it in GitHub Desktop.
TV snow effect
@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