Created
September 16, 2016 23:55
-
-
Save zeekay/a797362c0a6e058c6890189acef3a768 to your computer and use it in GitHub Desktop.
Candle
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
.candle | |
-10.times do | |
.flame |
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
body{ | |
background: #000; | |
overflow: hidden; | |
} | |
.candle{ | |
width: 150px; | |
height: 250px; | |
background: linear-gradient(to right, #75776a 0%,#fcfff4 50%,#75776a 100%); | |
border-radius: 10px 10px 0 0; | |
box-shadow: 0 0 5px #000 inset; | |
position: absolute; | |
top: 80%; | |
left: 40%; | |
perspective: 400px; | |
transform-style: preserve-3d; | |
&:before{ | |
content:''; | |
width: 10px; | |
height: 30px; | |
background: linear-gradient(to bottom, #f92302 0%,#444 30%); | |
border-radius: 2px 2px 0 0; | |
position: absolute; | |
top: -32px; | |
left: 70px; | |
} | |
} | |
@for $i from 1 through 10{ | |
.flame:nth-child(#{$i}){ | |
transform: rotate(180deg) translateZ($i*-10px); | |
&:before{ | |
content:''; | |
width: 70px; | |
height: 300px; | |
border-radius: 50%; | |
box-shadow: | |
0 30px 20px rgba(255,255,0,.06), | |
0 -50px 40px rgba(255,255,0,.06) inset; | |
position: absolute; | |
top: 30px; | |
left: 40px; | |
animation: flame .75s $i*-.04s alternate linear infinite; | |
} | |
} | |
@keyframes flame{ | |
50%{transform: rotateY(.2turn) translateY(50px); filter: blur(10px); | |
box-shadow: | |
0 30px 20px #E25822, | |
0 -50px 40px #ff0 inset; | |
} | |
100%{transform-origin: 50px 0; | |
transform: rotateX(.05turn);} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment