Last active
February 7, 2017 09:12
-
-
Save xto3na/e2c0e44c9b22553bbba3c875e5de3924 to your computer and use it in GitHub Desktop.
Keyframes Explosion Animation
This file contains hidden or 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
| .particle*400 |
This file contains hidden or 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
| $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