Camp Fire by
Ivan Bogachev
On: 22 Jun 2016
Personal site: http://codepen.io/sfi0zy/
<div class="fire-wrapper">
<div class="fire-element"></div>
<div class="fire-element"></div>
<div class="fire-element"></div>
<div class="fire-element"></div>
<div class="fire-element"></div>
<div class="fire-element"></div>
<div class="fire-element"></div>
<div class="fire-element"></div>
<div class="fire-element"></div>
<div class="fire-element"></div>
<div class="fire-element"></div>
<div class="fire-element"></div>
<div class="fire-element"></div>
<div class="fire-element"></div>
<div class="fire-element"></div>
</div>
<div class="ground"></div>
<div class="stars">
<div class="star"></div>
<div class="star"></div>
<div class="star"></div>
<div class="star"></div>
<div class="star"></div>
<div class="star"></div>
<div class="star"></div>
<div class="star"></div>
<div class="star"></div>
<div class="star"></div>
</div>
*,
*:before,
*:after {
margin: 0;
padding: 0;
box-sizing: border-box;
}
@-webkit-keyframes fire {
0% {
-webkit-transform: scale(0.8) rotate(-10deg);
transform: scale(0.8) rotate(-10deg);
}
10% {
-webkit-transform: scale(1) rotateY(90deg);
transform: scale(1) rotateY(90deg);
}
20% {
-webkit-transform: scale(1.2) rotate(0deg);
transform: scale(1.2) rotate(0deg);
}
40% {
-webkit-transform: scale(0.8) rotate(10deg);
transform: scale(0.8) rotate(10deg);
}
50% {
-webkit-transform: scale(0.6) rotateY(-90deg);
transform: scale(0.6) rotateY(-90deg);
}
60% {
-webkit-transform: scale(0.8) rotate(-10deg);
transform: scale(0.8) rotate(-10deg);
}
70% {
-webkit-transform: scale(0.5) rotateY(60deg);
transform: scale(0.5) rotateY(60deg);
}
80% {
-webkit-transform: scale(1.1) rotate(15deg);
transform: scale(1.1) rotate(15deg);
}
100% {
-webkit-transform: scale(0.8) rotate(-10deg);
transform: scale(0.8) rotate(-10deg);
}
}
@keyframes fire {
0% {
-webkit-transform: scale(0.8) rotate(-10deg);
transform: scale(0.8) rotate(-10deg);
}
10% {
-webkit-transform: scale(1) rotateY(90deg);
transform: scale(1) rotateY(90deg);
}
20% {
-webkit-transform: scale(1.2) rotate(0deg);
transform: scale(1.2) rotate(0deg);
}
40% {
-webkit-transform: scale(0.8) rotate(10deg);
transform: scale(0.8) rotate(10deg);
}
50% {
-webkit-transform: scale(0.6) rotateY(-90deg);
transform: scale(0.6) rotateY(-90deg);
}
60% {
-webkit-transform: scale(0.8) rotate(-10deg);
transform: scale(0.8) rotate(-10deg);
}
70% {
-webkit-transform: scale(0.5) rotateY(60deg);
transform: scale(0.5) rotateY(60deg);
}
80% {
-webkit-transform: scale(1.1) rotate(15deg);
transform: scale(1.1) rotate(15deg);
}
100% {
-webkit-transform: scale(0.8) rotate(-10deg);
transform: scale(0.8) rotate(-10deg);
}
}
@-webkit-keyframes stars {
0% {
opacity: .5;
}
50% {
opacity: 1;
}
100% {
opacity: .5;
}
}
@keyframes stars {
0% {
opacity: .5;
}
50% {
opacity: 1;
}
100% {
opacity: .5;
}
}
body {
background-image: -webkit-linear-gradient(bottom, #000, #203);
background-image: linear-gradient(to top, #000, #305);
height: 100vh;
width: 100%;
overflow: hidden;
}
.ground {
background: #000;
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 25vh;
}
.ground:before {
content: "";
position: absolute;
left: 50%;
top: 0;
background: #000;
height: 50vh;
width: 50vh;
border-radius: 50%;
-webkit-transform: translateX(-50%) translateY(-10%);
transform: translateX(-50%) translateY(-10%);
}
.fire-wrapper {
height: 50vh;
width: 50vh;
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translateX(-50%) translateY(-50%);
transform: translateX(-50%) translateY(-50%);
}
.fire-wrapper .fire-element {
background-image: -webkit-linear-gradient(bottom, #f00, #ff0);
background-image: linear-gradient(to top, #f00, #ff0);
height: 50%;
width: 10%;
border-radius: 100% 0;
position: inherit;
left: 50%;
bottom: 0;
-webkit-animation: 1.5s fire infinite;
animation: 1.5s fire infinite;
}
.fire-wrapper .fire-element:nth-of-type(1) {
height: 100%;
left: 50%;
-webkit-animation-delay: .1s;
animation-delay: .1s;
}
.fire-wrapper .fire-element:nth-of-type(2) {
height: 90%;
left: 55%;
-webkit-animation-delay: .2s;
animation-delay: .2s;
}
.fire-wrapper .fire-element:nth-of-type(3) {
height: 80%;
left: 45%;
-webkit-animation-delay: .3s;
animation-delay: .3s;
}
.fire-wrapper .fire-element:nth-of-type(4) {
height: 70%;
left: 60%;
-webkit-animation-delay: .4s;
animation-delay: .4s;
}
.fire-wrapper .fire-element:nth-of-type(5) {
height: 60%;
left: 40%;
-webkit-animation-delay: .5s;
animation-delay: .5s;
}
.fire-wrapper .fire-element:nth-of-type(6) {
height: 50%;
left: 65%;
-webkit-animation-delay: .6s;
animation-delay: .6s;
}
.fire-wrapper .fire-element:nth-of-type(7) {
height: 40%;
left: 35%;
-webkit-animation-delay: .7s;
animation-delay: .7s;
}
.fire-wrapper .fire-element:nth-of-type(8) {
height: 30%;
left: 70%;
-webkit-animation-delay: .8s;
animation-delay: .8s;
}
.fire-wrapper .fire-element:nth-of-type(9) {
height: 20%;
left: 30%;
-webkit-animation-delay: .9s;
animation-delay: .9s;
}
.fire-wrapper .fire-element:nth-of-type(10) {
height: 10%;
left: 75%;
-webkit-animation-delay: 1s;
animation-delay: 1s;
}
.fire-wrapper .fire-element:nth-of-type(11) {
height: 60%;
left: 50%;
-webkit-animation-delay: .1s;
animation-delay: .1s;
}
.fire-wrapper .fire-element:nth-of-type(12) {
height: 50%;
left: 55%;
-webkit-animation-delay: .2s;
animation-delay: .2s;
}
.fire-wrapper .fire-element:nth-of-type(13) {
height: 40%;
left: 45%;
-webkit-animation-delay: .3s;
animation-delay: .3s;
}
.fire-wrapper .fire-element:nth-of-type(14) {
height: 30%;
left: 60%;
-webkit-animation-delay: .4s;
animation-delay: .4s;
}
.fire-wrapper .fire-element:nth-of-type(15) {
height: 20%;
left: 40%;
-webkit-animation-delay: .5s;
animation-delay: .5s;
}
.stars {
width: 100%;
height: 100%;
position: absolute;
}
.stars .star {
background: #fff;
height: .5vh;
width: .5vh;
border-radius: 50%;
position: absolute;
-webkit-animation: 5s stars infinite;
animation: 5s stars infinite;
opacity: .5;
}
.stars .star:nth-of-type(1) {
left: 10%;
top: 10%;
-webkit-animation-delay: 1s;
animation-delay: 1s;
}
.stars .star:nth-of-type(2) {
left: 5%;
top: 50%;
-webkit-animation-delay: 2s;
animation-delay: 2s;
}
.stars .star:nth-of-type(3) {
left: 80%;
top: 5%;
-webkit-animation-delay: 3s;
animation-delay: 3s;
}
.stars .star:nth-of-type(4) {
left: 60%;
top: 10%;
-webkit-animation-delay: 4s;
animation-delay: 4s;
}
.stars .star:nth-of-type(5) {
left: 90%;
top: 40%;
-webkit-animation-delay: 5s;
animation-delay: 5s;
}
.stars .star:nth-of-type(6) {
left: 30%;
top: 20%;
-webkit-animation-delay: 1s;
animation-delay: 1s;
}
.stars .star:nth-of-type(7) {
left: 20%;
top: 70%;
-webkit-animation-delay: 2s;
animation-delay: 2s;
}
.stars .star:nth-of-type(8) {
left: 70%;
top: 20%;
-webkit-animation-delay: 3s;
animation-delay: 3s;
}
.stars .star:nth-of-type(9) {
left: 25%;
top: 30%;
-webkit-animation-delay: 4s;
animation-delay: 4s;
}
.stars .star:nth-of-type(10) {
left: 30%;
top: 5%;
-webkit-animation-delay: 5s;
animation-delay: 5s;
}
46