Flying Rocket by

Simone Bernabè

On: 4 Aug 2016

Personal site: http://codepen.io/simoberny/

<div class="container">
    <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 class="earth">
    <div class="overflow">
      <div class="terrain"></div>
      <div class="cloud c1"></div>
      <div class="cloud c2"></div>
    </div>
    <div class="station">
      <div class="gas"></div>
      <div class="gas"></div>
      <div class="gas"></div>
      <div class="gas"></div>
      <div class="gas"></div>
    </div>
  </div>
  <div class="eli-moon">
    <div class="moon"></div>
  </div>
  <div class="eli-rocket">
    <div class="rocket">
      <div class="antenna"></div>
      <div class="window"></div>
      <div class="flame-side"></div>
      <div class="flame-center"></div>
      <div class="flame-side2"></div>
      <div class="propulsion"></div>
      <div class="flame"></div>
    </div>
  </div>
</div>
html, body {
  margin: 0;
  background: #0D0D0D;
  overflow: hidden;
}

.container {
  position: relative;
  width: 580px;
  height: 580px;
  margin: 12vh auto;
}
.container .earth {
  position: absolute;
  width: 200px;
  height: 200px;
  background: #5fbcff;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  margin: auto;
  border-radius: 50%;
}
.container .earth .overflow {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  margin: auto;
  border-radius: 50%;
}
.container .earth .overflow .terrain {
  position: absolute;
  background: #acef62;
  width: 100px;
  height: 50px;
  top: 10px;
  border-radius: 20% 10% 50% 20%;
  transform: rotateZ(-20deg);
  -webkit-transform: rotateZ(-20deg);
}
.container .earth .overflow .terrain:after {
  content: '';
  position: absolute;
  display: block;
  background: #acef62;
  width: 50px;
  height: 150px;
  top: 10px;
  border-radius: 20% 50% 110% 20%;
  border-bottom: 10px solid #e49b2f;
}
.container .earth .overflow .terrain:before {
  content: '';
  position: absolute;
  display: block;
  background: #acef62;
  width: 50px;
  height: 150px;
  top: 30px;
  left: 150px;
  border-radius: 50% 50% 80% 30%;
  transform: rotateZ(20deg);
  -webkit-transform: rotateZ(20deg);
  border-left: 10px solid #e49b2f;
}
.container .earth .overflow .cloud {
  position: absolute;
  width: 60px;
  height: 35px;
  background: white;
  border-radius: 50%;
  border-top: 2px solid rgba(100, 100, 100, 0.4);
}
.container .earth .overflow .cloud:after {
  content: '';
  position: absolute;
  display: block;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: white;
  left: -10px;
  top: 0;
  bottom: 0;
  margin: auto;
}
.container .earth .overflow .cloud:before {
  content: '';
  position: absolute;
  display: block;
  width: 50px;
  height: 42px;
  border-radius: 50%;
  background: white;
  right: -10px;
  bottom: 0px;
  z-index: 5;
}
.container .earth .overflow .c1 {
  left: 40px;
  top: 120px;
  -webkit-animation: wind 4.5s ease-in-out 1s infinite;
          animation: wind 4.5s ease-in-out 1s infinite;
}
.container .earth .overflow .c2 {
  right: 30px;
  top: 50px;
  -webkit-animation: wind 4s ease-in-out infinite;
          animation: wind 4s ease-in-out infinite;
}
.container .earth .station {
  position: absolute;
  top: -90px;
  width: 40px;
  height: 100px;
  border-left: 4px solid #990000;
  border-right: 4px solid #990000;
  border-top: 3px solid #990000;
  margin: auto;
  left: 0;
  right: 0;
}
.container .earth .station .gas {
  position: absolute;
  width: 30px;
  height: 30px;
  background: #777;
  opacity: 0;
  border-left: 3px solid #555;
  border-right: 2px solid white;
  z-index: 0;
  border-radius: 50%;
  -webkit-animation: gas-on 0.3s linear;
          animation: gas-on 0.3s linear;
}
.container .earth .station .gas:nth-child(1) {
  top: 65px;
  right: -29px;
  -webkit-animation-delay: 0.3s;
          animation-delay: 0.3s;
  -webkit-animation-iteration-count: 10;
          animation-iteration-count: 10;
}
.container .earth .station .gas:nth-child(2) {
  top: 85px;
  right: -23px;
  -webkit-animation-delay: 0.6s;
          animation-delay: 0.6s;
  -webkit-animation-iteration-count: 10;
          animation-iteration-count: 10;
  z-index: 7;
}
.container .earth .station .gas:nth-child(3) {
  top: 105px;
  right: -39px;
  -webkit-animation-delay: 0.9s;
          animation-delay: 0.9s;
  -webkit-animation-iteration-count: 10;
          animation-iteration-count: 10;
}
.container .earth .station .gas:nth-child(4) {
  top: 85px;
  right: -55px;
  -webkit-animation-delay: 1.2s;
          animation-delay: 1.2s;
  -webkit-animation-iteration-count: 5;
          animation-iteration-count: 5;
}
.container .earth .station .gas:nth-child(5) {
  top: 65px;
  right: -49px;
  -webkit-animation-delay: 1s;
          animation-delay: 1s;
  -webkit-animation-iteration-count: 7;
          animation-iteration-count: 7;
}
.container .earth .station:after {
  content: '';
  position: absolute;
  display: block;
  width: 61px;
  height: 3px;
  background: #990000;
  transform: rotateZ(45deg);
  -webkit-transform: rotateZ(45deg);
  top: 50px;
  left: -10px;
}
.container .earth .station:before {
  content: '';
  position: absolute;
  display: block;
  width: 61px;
  height: 3px;
  background: #990000;
  transform: rotateZ(-45deg);
  -webkit-transform: rotateZ(-45deg);
  top: 50px;
  left: -10px;
}
.container .eli-moon {
  position: absolute;
  width: 500px;
  height: 500px;
  margin: auto;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  -webkit-transform-origin: center center;
          transform-origin: center center;
  -webkit-animation: moon-rotation 10s linear infinite;
          animation: moon-rotation 10s linear infinite;
}
.container .eli-moon .moon {
  position: absolute;
  width: 50px;
  height: 50px;
  background: #c2e3f4;
  border-radius: 50%;
}
.container .eli-moon .moon:before {
  content: '';
  display: block;
  position: absolute;
  width: 15px;
  height: 15px;
  background: #8caeca;
  border-radius: 50%;
  top: 10px;
  right: 30px;
}
.container .eli-moon .moon:after {
  content: '';
  display: block;
  position: absolute;
  width: 11px;
  height: 11px;
  background: #8caeca;
  border-radius: 50%;
  bottom: 20px;
  left: 30px;
}

.eli-rocket {
  position: absolute;
  width: 500px;
  height: 500px;
  margin: auto;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  -webkit-transform-origin: center center;
          transform-origin: center center;
  -webkit-animation: moon-rotation 5s ease-in 5s 1,moon-rotation 5s linear 10s infinite;
          animation: moon-rotation 5s ease-in 5s 1, moon-rotation 5s linear 10s infinite;
}

.rocket {
  position: absolute;
  background: #ddd;
  width: 28px;
  height: 115px;
  top: 30px;
  left: 56%;
  border-radius: 50% 50% 40% 40%;
  -webkit-transform-origin: center center;
          transform-origin: center center;
  -webkit-animation: rocket-shake 1s linear 12, rocket-up 2s ease-in 3.5s forwards;
          animation: rocket-shake 1s linear 12, rocket-up 2s ease-in 3.5s forwards;
  -webkit-animation-fill-mode: forwards;
  /* Chrome, Safari, Opera */
  animation-fill-mode: forwards;
  z-index: 5;
}
.rocket .antenna {
  position: absolute;
  width: 3px;
  height: 20px;
  background: #aaa;
  top: -20px;
  border-bottom: 3px solid #444;
  margin: auto;
  left: 0;
  right: 0;
  border-radius: 10px 10px 0 0;
}
.rocket .window {
  position: absolute;
  margin: auto;
  left: 0;
  right: 0;
  width: 10px;
  height: 10px;
  top: 40px;
  border: 4px solid #111;
  border-radius: 50%;
  background: #ccffff;
}
.rocket .flame-side {
  position: absolute;
  width: 20px;
  height: 40px;
  background: #ddd;
  bottom: -4px;
  left: -7px;
  /* IE 9 */
  -webkit-transform: skewY(-35deg);
  /* Safari */
  transform: skewY(-35deg);
}
.rocket .flame-side2 {
  position: absolute;
  width: 20px;
  height: 40px;
  background: #ddd;
  bottom: -4px;
  right: -7px;
  /* IE 9 */
  -webkit-transform: skewY(35deg);
  /* Safari */
  transform: skewY(35deg);
}
.rocket .flame-center {
  position: absolute;
  width: 4px;
  height: 35px;
  background: #ddd;
  bottom: -8px;
  right: 0;
  left: 0;
  margin: auto;
  border-left: 1px solid #555;
  border-right: 1px solid #555;
  z-index: 6;
}

.propulsion {
  position: absolute;
  left: 0;
  right: 0;
  margin: auto;
  bottom: -15px;
  width: 20px;
  height: 15px;
  background: #555;
  border-bottom: 2px solid black;
  z-index: 5;
  border-radius: 60% 60% 0 0;
}

.flame,
.flame:after,
.flame:before {
  border-radius: 50% 50% 0% 50%;
}

.flame {
  position: absolute;
  left: 0;
  right: 0;
  margin: auto;
  bottom: -30px;
  z-index: 4;
  -webkit-transform: rotate(45deg);
          transform: rotate(45deg);
  width: 25px;
  height: 28px;
  background-color: #C62828;
  -webkit-animation: flame 0.5s linear infinite alternate;
          animation: flame 0.5s linear infinite alternate;
  opacity: 0.3;
  z-index: 0;
}
.flame:before {
  position: absolute;
  content: "";
  background-color: #FFC107;
  width: 20px;
  height: 20px;
  margin: 5px auto 3px auto;
  left: 0;
  right: 0;
}

@-webkit-keyframes flame {
  from {
    -webkit-transform: scale(1) rotate(40deg);
            transform: scale(1) rotate(40deg);
    height: 28px;
    opacity: 0.3;
  }
  to {
    -webkit-transform: scale(1.1) rotate(50deg);
            transform: scale(1.1) rotate(50deg);
    height: 35px;
    bottom: -40px;
    opacity: 1;
  }
}

@keyframes flame {
  from {
    -webkit-transform: scale(1) rotate(40deg);
            transform: scale(1) rotate(40deg);
    height: 28px;
    opacity: 0.3;
  }
  to {
    -webkit-transform: scale(1.1) rotate(50deg);
            transform: scale(1.1) rotate(50deg);
    height: 35px;
    bottom: -40px;
    opacity: 1;
  }
}
@-webkit-keyframes moon-rotation {
  to {
    -webkit-transform: rotateZ(360deg);
            transform: rotateZ(360deg);
  }
}
@keyframes moon-rotation {
  to {
    -webkit-transform: rotateZ(360deg);
            transform: rotateZ(360deg);
  }
}
@-webkit-keyframes rocket-up {
  from {
    top: 30px;
  }
  to {
    top: -50px;
    transform: rotateZ(90deg);
    -webkit-transform: rotateZ(90deg);
  }
}
@keyframes rocket-up {
  from {
    top: 30px;
  }
  to {
    top: -50px;
    transform: rotateZ(90deg);
    -webkit-transform: rotateZ(90deg);
  }
}
@-webkit-keyframes rocket-shake {
  0% {
    transform: rotateZ(0deg);
    -webkit-transform: rotateZ(0deg);
  }
  33% {
    transform: rotateZ(6deg);
    -webkit-transform: rotateZ(6deg);
  }
  66% {
    transform: rotateZ(-6deg);
    -webkit-transform: rotateZ(-6deg);
  }
  100% {
    transform: rotateZ(0deg);
    -webkit-transform: rotateZ(0deg);
  }
}
@keyframes rocket-shake {
  0% {
    transform: rotateZ(0deg);
    -webkit-transform: rotateZ(0deg);
  }
  33% {
    transform: rotateZ(6deg);
    -webkit-transform: rotateZ(6deg);
  }
  66% {
    transform: rotateZ(-6deg);
    -webkit-transform: rotateZ(-6deg);
  }
  100% {
    transform: rotateZ(0deg);
    -webkit-transform: rotateZ(0deg);
  }
}
@-webkit-keyframes gas-on {
  from {
    opacity: 0.5;
  }
  to {
    opacity: 1;
    top: 90px;
  }
}
@keyframes gas-on {
  from {
    opacity: 0.5;
  }
  to {
    opacity: 1;
    top: 90px;
  }
}
@-webkit-keyframes wind {
  0% {
    -webkit-transform: translateX(0px);
            transform: translateX(0px);
  }
  33% {
    -webkit-transform: translateX(15px) translateY(5px);
            transform: translateX(15px) translateY(5px);
  }
  66% {
    -webkit-transform: translateX(-20px) translateY(0px);
            transform: translateX(-20px) translateY(0px);
  }
  100% {
    -webkit-transform: translateX(0px) translateY(0px);
            transform: translateX(0px) translateY(0px);
  }
}
@keyframes wind {
  0% {
    -webkit-transform: translateX(0px);
            transform: translateX(0px);
  }
  33% {
    -webkit-transform: translateX(15px) translateY(5px);
            transform: translateX(15px) translateY(5px);
  }
  66% {
    -webkit-transform: translateX(-20px) translateY(0px);
            transform: translateX(-20px) translateY(0px);
  }
  100% {
    -webkit-transform: translateX(0px) translateY(0px);
            transform: translateX(0px) translateY(0px);
  }
}
.star {
  background: #fff;
  height: .3vh;
  width: .3vh;
  position: absolute;
  opacity: 1;
}
.star:nth-of-type(1) {
  left: -10%;
  top: 10%;
}
.star:nth-of-type(2) {
  left: 5%;
  top: 50%;
}
.star:nth-of-type(3) {
  left: 80%;
  top: 5%;
}
.star:nth-of-type(4) {
  left: 60%;
  top: 10%;
}
.star:nth-of-type(5) {
  left: 90%;
  top: 40%;
}
.star:nth-of-type(6) {
  left: 30%;
  top: 20%;
}
.star:nth-of-type(7) {
  left: 20%;
  top: 80%;
}
.star:nth-of-type(8) {
  left: 120%;
  top: 20%;
}
.star:nth-of-type(9) {
  left: 25%;
  top: 30%;
}
.star:nth-of-type(10) {
  left: 30%;
  top: 5%;
}

35