Skip to content

Instantly share code, notes, and snippets.

@xto3na
Last active February 7, 2017 09:12
Show Gist options
  • Select an option

  • Save xto3na/e2c0e44c9b22553bbba3c875e5de3924 to your computer and use it in GitHub Desktop.

Select an option

Save xto3na/e2c0e44c9b22553bbba3c875e5de3924 to your computer and use it in GitHub Desktop.
Keyframes Explosion Animation
$d: 4px;
html { overflow: hidden; background: #222; }
.particle {
position: absolute;
width: $d; height: $d;
border-radius: 50%;
animation: shoot 3s ease-out infinite;
animation-name: shoot, fade;
@for $i from 0 to 400 {
$t: (1 + .01*random(100))*1s;
&:nth-child(#{$i + 1}) {
transform: translate(random(100)*1vw,
random(100)*1vh);
background: hsl(random(360), 100%, 65%);
animation-duration: $t;
animation-delay: -.01*random(100)*$t;
}
}
}
@keyframes shoot {
0% { transform: translate(50vw, 50vh); }
}
@keyframes fade { to { opacity: 0 } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment