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 CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

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.

            
              <article id="stars">
  <div class="star star--1">
    <div class="star__core"></div>
  </div>

  <div class="star star--2">
    <div class="star__core"></div>
  </div>

  <div class="star star--3">
    <div class="star__core"></div>
  </div>

  <div class="star star--4">
    <div class="star__core"></div>
  </div>

  <div class="star star--5">
    <div class="star__core"></div>
  </div>

  <div class="star star--6">
    <div class="star__core"></div>
  </div>

  <div class="star star--7">
    <div class="star__core"></div>
  </div>
</article>

<article id="astro-not">

  <div class="astro-not__head">
    <div class="astro-not__head-eye"></div>
    <div class="astro-not__head-eye"></div>
    <div class="astro-not__head-mouth"></div>
  </div>

  <div class="astro-not__trunk">
    <div class="astro-not__body-arm sx"></div>
    <div class="astro-not__body"></div>
    <div class="astro-not__body-arm dx"></div>
  </div>

  <div class="astro-not__legs">
    <div class="astro-not__legs-sx"></div>
    <div class="astro-not__legs-dx"></div>
  </div>
</article>
            
          
!
            
              html {
  box-sizing: border-box;
}

*,
*:before,
*:after {
  box-sizing: inherit;
}

@mixin clearfix {
  &:after {
    content: "";
    display: table;
    clear: both;
  }
}

@keyframes float-simple {
  50% {
    transform: rotate3d(0, 0, 1, 10deg) translate3d(-50%, -40%, 0);
  }
}

@keyframes flap-arm-sx {
  50% {
    transform: rotateY(60deg);
  }
}

@keyframes flap-arm-dx {
  50% {
    transform: rotateY(-40deg);
  }
}

@keyframes flap-leg-sx {
  50% {
    transform: rotateX(-65deg);
  }
}

@keyframes flap-leg-dx {
  50% {
    transform: rotateX(45deg);
  }
}

// VARS
$line-color: #fcfcfc;
$bg-color: #100e23;
$bg-color-2: #201e4c;
// MIXINS
@mixin drawLine($width, $height, $border, $borderRadius: 50%) {
  width: $width;
  height: $height;
  border: $border solid $line-color;
  border-radius: $borderRadius;
  background-color: rgba(252, 252, 252, 0.2);
}

@mixin bgGradient {
  background: $bg-color; /* Old browsers */
  background: -moz-linear-gradient(top,  $bg-color 0%, $bg-color-2 100%); /* FF3.6-15 */
  background: -webkit-linear-gradient(top,  $bg-color 0%,$bg-color-2 100%); /* Chrome10-25,Safari5.1-6 */
  background: linear-gradient(to bottom,  $bg-color 0%,$bg-color-2 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#100e23', endColorstr='#201e4c',GradientType=0 ); /* IE6-9 */


}

body {
  //@include bgGradient();
  background: $bg-color;
}

#astro-not {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  transform: translate3d(-50%, -50%, 0);
  width: 200px;
  animation: float-simple 15s infinite alternate ease;
  perspective: 2000px;
  &::before {
    content: '';
    display: block;
    width: 1px;
    height: 30px;
    background-color: $line-color;
    position: absolute;
    left: 50%;
    top: 0;
    transform: translate3d(-50%, -30px, 0);
  }
  &::after {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    background-color: $line-color;
    position: absolute;
    left: 50%;
    top: 0;
    transform: translate3d(-50%, -30px, 0);
    border-radius: 50%;
  }
  .astro-not__head {
    position: relative;
    @include drawLine(80px, 75px, 2px, 50%);
    border-radius: 50% 50% 0 0; // overrides drawLine
    text-align: center;
    margin: 0 auto;
    &::before {
      content: '';
      display: block;
      width: 23px;
      height: 25px;
      position: absolute;
      left: 8px;
      top: 8px;
      border-top: 2px solid $line-color;
      border-top-left-radius: 26px;
    }
    .astro-not__head-eye {
      @include drawLine(10px, 10px, 2px, 50%);
      display: inline-block;
      transform: translate3d(0, 30px, 0);
    }
    .astro-not__head-mouth {
      @include drawLine(40px, 10px, 2px, 4px);
      position: absolute;
      bottom: 10px;
      left: 50%;
      transform: translate3d(-50%, 0, 0);
    }
  }
  .astro-not__body {
    margin: 2px auto;
    @include drawLine(100px, 100px, 2px, 15%);
    display: inline-block;
    position: relative;
    &::before {
      content: '';
      display: block;
      width: 20px;
      height: 20px;
      position: absolute;
      left: 8px;
      top: 8px;
      border-top: 2px solid $line-color;
      border-top-left-radius: 13px;
    }
    &::after {
      content: '';
      display: block;
      width: 20px;
      height: 20px;
      position: absolute;
      right: 8px;
      bottom: 8px;
      border-bottom: 2px solid $line-color;
      border-bottom-right-radius: 13px;
    }
  }
  .astro-not__trunk {
    perspective: 2000px;
    text-align: center;
    .astro-not__body-arm {
      @include drawLine(40px, 40px, 2px, 4px);
      border-radius: 50% 0 0 50%; // overrides drawLine
      display: inline-block;
      vertical-align: top;
      margin-top: 12px;
      &.dx {
        border-radius: 0 50% 50% 0; // overrides drawLine
        animation: flap-arm-dx 4.8s infinite alternate ease;
        transform-origin: left center;
      }
      &.sx {
        transform-origin: right center;
        animation: flap-arm-sx 3.9s infinite alternate ease;
      }
    }
  }
  .astro-not__legs {
    margin: 0 auto;
    width: 100px;
    text-align: center;
    perspective: 2000px;
    .astro-not__legs-sx,
    .astro-not__legs-dx {
      @include drawLine(44px, 50px, 2px, 15%);
      display: inline-block;
      transform-origin: center top;
      &::before {
        content: '';
        display: block;
        width: 13px;
        height: 10px;
        position: absolute;
        left: 50%;
        top: 50%;
        border-top: 2px solid $line-color;
        border-top-left-radius: 7px;
        border-top-right-radius: 7px;
        transform: translate3d(-50%, -50%, 0);
      }
    }
    .astro-not__legs-sx {
      animation: flap-leg-sx 2.8s infinite alternate linear;
    }
    .astro-not__legs-dx {
      animation: flap-leg-dx 1.8s infinite alternate linear;
    }
  }
}

// STARS
// VARS (various colors)
$color-white: #fff;
$color-blue:#61b3cb;
$color-red: #e32631;
$color-lime: #b1ce5c;
$bg-color: #100e23;
$star-color-1: $color-white;
$star-color-2: $color-blue;
$star-color-3: $color-red;
$star-color-4: $color-lime;
$star-color-5: $color-red;
$star-color-6: $color-red;
$star-color-7: $color-white;
// STAR POSITIONS
$top-1: 37%;
$left-1: 49%;
$top-2: 37%;
$left-2: 37%;
$top-3: 35%;
$left-3: 36%;
$top-4: 26%;
$left-4: 51%;
$top-5: 50%;
$left-5: 60%;
$top-6: 69%;
$left-6: 69%;
$top-7: 93%;
$left-7: 73%;
// STAR MAKER MIXIN
@mixin makeStar($starColor: $star-color-1, $starWidth: 6px, $starHeight:6px) {
  width: $starWidth;
  height: $starHeight;
  background: $starColor;
  background: radial-gradient(circle at top left, lighten($starColor, 15%), $starColor);
  box-shadow: 0 0 25px 3px lighten($starColor, 5%);
  animation: pulse (random(1)/100)+s forwards alternate infinite ease;
  @at-root {
    @keyframes pulse {
      from {
        transform: scale(1);
      }
      to {
        transform: scale(0.8);
      }
    }
  }
}

#stars {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate3d(-50%, -50%, 0);
  z-index: 1;
  width: 100%;
  height: 100%;
}

.star {
  position: absolute;
  .star__core {
    border-radius: 50%;
  }
}

.star--1 {
  top: $top-1;
  left: $left-1;
  transform: translate3d(-$top-1, -$left-1, 0);
  .star__core {
    @include makeStar($star-color-1, 2px, 2px);
  }
}

.star--2 {
  top: 37%;
  left: 37%;
  transform: translate3d(-37%, -37%, 0);
  .star__core {
    @include makeStar($star-color-7, 3px, 3px);
  }
}

.star--3 {
  top: 24%;
  left: 36%;
  transform: translate3d(-36%, -24%, 0);
  .star__core {
    @include makeStar($star-color-7, 2px, 3px);
  }
}

.star--4 {
  top: 26%;
  left: 51%;
  transform: translate3d(-51%, -26%, 0);
  .star__core {
    @include makeStar($star-color-7, 1px, 1px);
  }
}

.star--5 {
  top: 50%;
  left: 60%;
  transform: translate3d(-60%, -50%, 0);
  .star__core {
    @include makeStar($star-color-7, 1px, 1px);
  }
}

.star--6 {
  top: 69%;
  left: 69%;
  transform: translate3d(-69%, -69%, 0);
  .star__core {
    @include makeStar($star-color-7, 2px, 2px);
  }
}

.star--7 {
  top: 93%;
  left: 73%;
  transform: translate3d(-73%, -93%, 0);
  .star__core {
    @include makeStar($star-color-7, 3px, 3px);
  }
}
            
          
!
999px
Loading ..................

Console