cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

Quick-add: + add another resource

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <div class="rocket">
  <div class="rocket--ship">
    <svg class="rocket--fuselage" x="0px" y="0px" viewBox="0 0 279 302.9">
					<path class="wing" d="M59.9,218.5l1.9,19.1c0.9,6.9,2.1,13.6,3.4,19.9l3.8,15L34.1,282
						l-0.7-6.4c-1.3-10.4-2.7-19.8-4.4-28.4l-0.6-2.6L59.9,218.5L59.9,218.5z M218.1,218.5l32.5,26.9l-1.6,6.8c-1.7,8.6-3.2,18-4.4,28.4 l-0.2,1.6l-35.4-9.6l3.8-15c1.3-6.4,2.5-13,3.4-19.9L218.1,218.5z"/>
					<path class="body" d="M66.4,112.5h145.1l1,4.4c4.4,21.9,6.6,46.9,6.6,75.7 c0,32.3-4,60-10.8,83.1l-2.3,7.1h-67H72l-2.3-7.1c-6.9-23.1-10.8-50.8-10.8-83.1c0-28.9,2.1-53.9,6.6-75.7L66.4,112.5z"/>
					<path class="tip" d="M139,4.7l9.2,6.4c24.5,18.2,42.2,40.5,53.9,69.8l5.4,16.6H70.6 L76,80.9c11.6-29.3,29.4-51.6,53.9-69.8L139,4.7z"/>
					<path class="stripe" d="M70.4,97.5 207.6,97.5 209.6,104.2 211.5,112.5 66.5,112.5 68.4,104.2 70.4,97.5 	"/>
					<path class="frame" d="M91,145.4c0-26.5,21.5-47.9,48-47.9s48,21.5,48,47.9 s-21.5,47.9-48,47.9S91,171.9,91,145.4L91,145.4z"/>
					<path class="window" d="M106.1,145.3c0-18.2,14.7-32.9,32.9-32.9s32.9,14.7,32.9,32.9 c0,18.2-14.7,32.9-32.9,32.9S106.1,163.5,106.1,145.3L106.1,145.3z"/>
					<path class="foil" d="M18.5,210.1l2.3,6.4c6.3,18.2,10.8,40.5,13.8,69.8l1.4,16.6H1 l1.4-16.6c3-29.3,7.5-51.6,13.8-69.8L18.5,210.1z"/>
					<path class="foil" d="M259.5,210.1l2.3,6.4c6.3,18.2,10.8,40.5,13.8,69.8l1.4,16.6 h-34.9l1.4-16.6c3-29.3,7.5-51.6,13.8-69.8L259.5,210.1z"/>
					<path class="foil" d="M139,210.1l2.3,6.4c6.2,18.2,10.7,40.5,13.7,69.8l1.4,16.6h-34.8 l1.4-16.6c3-29.3,7.5-51.6,13.7-69.8L139,210.1z"/>
				</svg>
    <div class="rocket--contrail">
      <div class="rocket--tail">
        <div class="rocket--flame"></div>
      </div>
      <div class="rocket--cloud">
        <div class="rocket--smoke -one"></div>
        <div class="rocket--smoke -two"></div>
        <div class="rocket--smoke -three"></div>
        <div class="rocket--smoke -four"></div>
        <div class="rocket--smoke -five"></div>
        <div class="rocket--smoke -six"></div>
      </div>
    </div>
  </div>

  <div class="rocket--planet"></div>
</div>
            
          
!
            
              $measure: 1em;
$bg: mediumvioletred;
$crater: 40%;
@function m($multiplier: 1) {
  @return #{$multiplier * $measure};
}

@function col($mix) {
  @return mix(white, mediumvioletred, $mix);
}

@mixin dim($width, $height) {
  width: m($width);
  height: m($height);
}

@mixin pos($top, $left) {
  top: m($top);
  left: m($left);
}

@mixin bg($mix) {
  background-color: col($mix);
}

@mixin fill($mix) {
  fill: col($mix);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

// round things
.rocket {
  &::before,
  &--planet,
  &--planet::after,
  &--smoke {
    border-radius: 50%;
  }
}

// colours
.rocket {
  @include bg(0%);
  &::before {
    background-image: radial-gradient(ellipse at center, col(100%) 0%, col(0%) 70%);
  }
  &--fuselage {
    .body {
      @include fill(50%);
    }
    .tip,
    .foil {
      @include fill(70%);
    }
    .stripe,
    .frame {
      @include fill(30%);
    }
    .window {
      @include fill(100%);
    }
    .wing {
      @include fill(40%);
    }
  }
  &--tail,
  &--smoke {
    @include bg(80%);
  }
  &--planet {
    @include bg(70%);
  }
}

// dimensions and position
.rocket {
  display: block;
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
  &::before,
  *,
  *::before,
  *::after {
    display: block;
    position: absolute;
  }
  &::before {
    @include dim(100, 100);
    content: "";
    bottom: m(-60);
    left: calc(50% - #{m(50)});
  }
  &--ship {
    bottom: m(40);
    left: calc(50% - #{m(10)});
    transform: translate3d(0, 0, 0) rotate(55deg);
  }
  &--fuselage {
    @include dim(12, 13);
    transform-origin: center bottom;
  }
  &--contrail {
    @include pos(13.5, 1);
  }
  &--tail {
    @include dim(4, 11.5);
    @include pos(0, 3);
    border-radius: 0 0 m(2) m(2);
  }
  &--flame {
    @include dim(0, 0);
    @include pos(0, 1);
    border: {
      width: m(4) m(1) 0 m(1);
      style: solid;
      color: col(50%) transparent;
    }
  }
  &--cloud {
    @include pos(6, 0);
  }
  &--smoke {
    @include dim(4, 4);
    &.-one {
      @include pos(1, 0.5);
    }
    &.-two {
      @include pos(0, 5);
    }
    &.-three {
      @include pos(2, 6);
    }
    &.-five {
      @include pos(4, 2);
    }
    &.-six {
      @include pos(3, 4);
    }
  }
  &--planet {
    @include dim(60, 60);
    margin-left: m(-30);
    bottom: m(-44);
    left: 50%;
    &::after {
      @include dim(4, 4);
      content: "";
      top: calc(50% - #{m(2)});
      left: calc(50% - #{m(2)});
      box-shadow: m(10) m(20) 0 0 col($crater), m(20) m(10) 0 m(2) col($crater), m(21) m(-1) 0 m(1) col($crater), m(18) m(-6) 0 0 col($crater), m(17) m(-15) 0 m(2) col($crater), m(8) m(-22) 0 0 col($crater), m(-1) m(-24) 0 m(1) col($crater), m(-10) m(-21) 0 0 col($crater), m(-18) m(-12) 0 m(2) col($crater), m(-23) m(7) 0 m(1) col($crater), m(-16) m(18) 0 0 col($crater), m(-24) 0 0 0 col($crater), m(-4) m(20) 0 m(2) col($crater);
    }
  }
  @media (orientation: landscape) {
    font-size: 2vh;
  }
  @media (orientation: portrait) {
    font-size: 1.6vw;
  }
}

// animation
.rocket {
  &--fuselage {
    animation: rocket-ani--ship 800ms linear infinite;
  }
  &--flame {
    animation: rocket-ani--flame 1500ms ease-in-out infinite;
  }
  &--smoke {
    animation: rocket-ani--smoke 2000ms ease infinite;
    &.-one {
      animation-delay: .2s;
    }
    &.-two {
      animation-delay: .3s;
    }
    &.-three {
      animation-delay: .5s;
    }
    &.-five {
      animation-delay: .5s;
    }
    &.-six {
      animation-delay: 1s;
    }
  }
  &--planet {
    animation: rocket-ani--planet 14000ms linear infinite;
  }
}

@keyframes rocket-ani--ship {
  0%,
  100% {
    transform: scale(1, 1);
  }
  50% {
    transform: scale(0.95, 1.05);
  }
}

@keyframes rocket-ani--smoke {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(0);
  }
}

@keyframes rocket-ani--flame {
  0%,
  25%,
  60%,
  100% {
    border-width: m(4) m(1) 0 m(1);
  }
  10%,
  90% {
    border-width: m(2) m(1) 0 m(1);
  }
  40% {
    border-width: m(3) m(1) 0 m(1);
  }
}

@keyframes rocket-ani--planet {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(-360deg);
  }
}
            
          
!
999px
Loading ..................

Console