Pen Settings

HTML

CSS

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.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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.

+ add another resource

Behavior

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                .dinosaur
  .dinosaur__face
    .dinosaur__face-inner
      .dinosaur__eye.dinosaur__eye--right
      .dinosaur__eye.dinosaur__eye--left
      .dinosaur__face-jagged
        .dinosaur__face-jagged-part
      .dinosaur__mouth-top
        .dinosaur__mouth-top-inner
      .dinosaur__mouth-bottom
        .dinosaur__mouth-bottom-inner
    .dinosaur__tails
      .dinosaur__tails-jagged
  .egg
      .egg__top
        .egg__top-body
      .egg__top-jagged
        - for (var x = 0; x < 4; x++)
         .egg__top-jagged-part
      .egg__bottom
        .egg__bottom-body
      .egg__bottom-jagged
        - for (var x = 0; x < 4; x++)
          .egg__bottom-jagged-part
  .dinosaur__hand.dinosaur__hand--right
    .dinosaur__claw
  .dinosaur__hand.dinosaur__hand--left
    .dinosaur__claw
  .balloon
    .heart
              
            
!

CSS

              
                $EGG_COLOR: #98adbb;
$DINOSAURS_COLOR: #aadca9;
$DINOSAURS_JAGGED_COLOR: #7abd9a;
$DINOSAURS_HAND_COLOR: #7abd9a;
$BG_COLOR: #ece6ce;
$HEART_COLOR: #f99b9a;

$EGG_TOP_TOP: -2px;
$EGG_BOTTOM_TOP: 110px;
$DINOSAURS_TOP_BEFORE: 42px;
$DINOSAURS_TOP_AFTER: 0;
$EGG_TOP_CLOSE_TOP: 34px;

html {
  width: 100%;
  height: 100%;
}

body {
  width: 100%;
  height: 100%;
  margin: 0;
  background-color: $BG_COLOR;
}

.dinosaur {
  $base: &;
  position: absolute;
  top: calc(50% - 105px);
  left: calc(50% - 100px);
  &__face {
    position: absolute;
    top: 34px;
    left: 0;
    width: 155px;
    height: 105px;
    z-index: 0;
  }
  &__face-inner {
    position: absolute;
    top: $DINOSAURS_TOP_BEFORE;
    left: 39px;
    width: 114px;
    height: 103px;
    border-radius: 18px;
    background-color: $DINOSAURS_COLOR;
    animation: face 4s linear normal infinite;
    &:before {
      content: "";
      position: absolute;
      top: 76px;
      left: -13px;
      width: 50px;
      height: 42px;
      border-radius: 50%;
      background-color: $DINOSAURS_COLOR;
    }
  }
  &__eye {
    position: absolute;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background-color: #fff;
    top: 26px;
    z-index: 5;
    &:before {
      content: "";
      position: absolute;
      top: 2px;
      left: 2px;
      width: 5px;
      height: 5px;
      border-radius: 50%;
      background-color: #000;
    }
    /*
    &:after {
      content: "";
      position: absolute;
      top: -5px;
      left: -2px;
      width: 23px;
      height: 22px;
      border-radius: 50%;
      background-color: $DINOSAURS_COLOR;
      transition: all 400ms cubic-bezier(0.7, -0.6, 0.3, 1.6);
    }
    */
    &--right {
      left: 42px;
    }
    &--left {
      top: 20px;
      left: 0px;
    }
  }
  &__face-jagged {
    position: absolute;
    top: 31px;
    right: -23px;
    width: 23px;
    height: 59px;
    overflow: hidden;
  }
  &__face-jagged-part {
    position: absolute;
    width: 0;
    height: 0;
    border-left: 18px solid $DINOSAURS_JAGGED_COLOR;
    border-top: 9px solid transparent;
    border-bottom: 16px solid transparent;
    top: 3px;
    left: 0;
    transform: rotate(0deg);
    animation: beforenone 4s linear normal infinite;
    &:before {
      content: "";
      position: absolute;
      width: 0;
      height: 0;
      border-left: 14px solid $DINOSAURS_JAGGED_COLOR;
      border-top: 12px solid transparent;
      border-bottom: 12px solid transparent;
      top: 8px;
      left: -19px;
      transform: rotate(0deg);
    }
    &:after {
      content: "";
      position: absolute;
      width: 0;
      height: 0;
      border-left: 11px solid $DINOSAURS_JAGGED_COLOR;
      border-top: 9px solid transparent;
      border-bottom: 8px solid transparent;
      top: 26px;
      left: -19px;
      transform: rotate(0deg);
    }
  }
  &__mouth-top {
    position: absolute;
    top: 27px;
    left: -39px;
    width: 114px;
    height: 35px;
    transform: rotate(6deg);
    overflow: hidden;
    animation: beforenone 4s linear normal infinite;
  }
  &__mouth-top-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 122px;
    height: 103px;
    border-radius: 27px;
    background-color: $DINOSAURS_COLOR;
  }
  &__mouth-bottom {
    position: absolute;
    top: 46px;
    left: -40px;
    width: 114px;
    height: 35px;
    transform: rotate(6deg);
    overflow: hidden;
  }
  &__mouth-bottom-inner {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 122px;
    height: 103px;
    border-radius: 27px;
    background-color: $DINOSAURS_COLOR;
  }
  &__tails {
    position: absolute;
    width: 0;
    height: 0;
    border-top: 66px solid $DINOSAURS_COLOR;
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    transform-origin: top center;
    -webkit-transform: translate(138px, 115px) rotate(-180deg);
    transform: translate(138px, 115px) rotate(180deg);
    animation: tail 4s linear normal infinite;
  }
  &__tails-jagged {
    position: absolute;
    width: 0;
    height: 0;
    border-left: 11px solid $DINOSAURS_JAGGED_COLOR;
    border-top: 9px solid transparent;
    border-bottom: 8px solid transparent;
    top: -62px;
    left: 11px;
    transform: rotate(12deg);
    &:before {
      content: "";
      position: absolute;
      width: 0;
      height: 0;
      border-left: 7px solid $DINOSAURS_JAGGED_COLOR;
      border-top: 6px solid transparent;
      border-bottom: 6px solid transparent;
      top: 8px;
      left: -11px;
      transform: rotate(0deg);
    }
    &:after {
      content: "";
      position: absolute;
      width: 0;
      height: 0;
      border-left: 7px solid $DINOSAURS_JAGGED_COLOR;
      border-top: 6px solid transparent;
      border-bottom: 6px solid transparent;
      top: 21px;
      left: -11px;
      transform: rotate(0deg);
    }
  }
  &__hand {
    position: absolute;
    top: 0;
    left: 0;
    width: 36px;
    height: 25px;
    border-radius: 50%;
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
    background-color: $DINOSAURS_HAND_COLOR;
    z-index: 10;
    animation: hand 4s linear normal infinite;
    &--left {
      top: 111px;
      left: 14px;
      transform: rotate(-18deg);
      #{$base}__claw {
        border-top: 5px solid #fff;
        border-left: 7px solid transparent;
        border-right: 1px solid transparent;
        bottom: -5px;
        left: 25px;
        &:before {
          border-top: 5px solid #fff;
          border-left: 7px solid transparent;
          border-right: 3px solid transparent;
          bottom: 0px;
          left: -17px;
        }
        &:after {
          border-top: 5px solid #fff;
          border-left: 8px solid transparent;
          border-right: 3px solid transparent;
          bottom: 0;
          left: -26px;
        }
      }
    }
    &--right {
      top: 110px;
      left: 82px;
      transform: rotate(18deg);
      #{$base}__claw {
        border-top: 5px solid #fff;
        border-left: 1px solid transparent;
        border-right: 7px solid transparent;
        bottom: -5px;
        left: 3px;
        &:before {
          border-top: 5px solid #fff;
          border-left: 3px solid transparent;
          border-right: 7px solid transparent;
          bottom: 0;
          left: 7px;
        }
        &:after {
          border-top: 5px solid #fff;
          border-left: 3px solid transparent;
          border-right: 8px solid transparent;
          bottom: 0;
          left: 17px;
        }
      }
    }
  }
  &__claw {
    position: absolute;
    border-top: 6px solid #fff;
    border-left: 3px solid transparent;
    border-right: 7px solid transparent;
    bottom: -6px;
    left: 3px;
    &:before {
      content: "";
      position: absolute;
      border-top: 6px solid #fff;
      border-left: 3px solid transparent;
      border-right: 7px solid transparent;
      bottom: 0;
      left: 7px;
    }
    &:after {
      content: "";
      position: absolute;
      border-top: 6px solid #fff;
      border-left: 3px solid transparent;
      border-right: 6px solid transparent;
      bottom: 0;
      left: 17px;
    }
  }
}

.egg {
  z-index: 5;
  &__top {
    position: absolute;
    top: $EGG_TOP_CLOSE_TOP;
    left: 21px;
    width: 135px;
    height: 50px;
    transform: rotate(0);
    overflow: hidden;
    animation: egg-top 4s linear normal infinite;
  }
  &__top-body {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 115px;
    background-color: $EGG_COLOR;
    border-radius: 50%;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }
  &__top-jagged {
    position: absolute;
    width: 145px;
    height: 40px;
    top: $EGG_TOP_CLOSE_TOP + 36px;
    left: 18px;
    transform: rotate(12deg);
    transform: rotate(0);
    animation: egg-top-jagged 4s linear normal infinite;
    &:after {
      content: "";
      position: absolute;
      top: -2px;
      left: 14px;
      width: 112px;
      height: 84px;
      background-color: $EGG_COLOR;
      border-radius: 62%;
      border-bottom-left-radius: 0;
      border-bottom-right-radius: 0;
      animation: afternone 4s linear normal infinite;
    }
  }
  &__top-jagged-part {
    position: absolute;
    width: 0;
    height: 0;
    border-top-color: $EGG_COLOR;
    border-top-style: solid;
    border-left-color: transparent;
    border-left-style: solid;
    border-right-color: transparent;
    border-right-style: solid;
    &:nth-of-type(1) {
      top: 9px;
      left: 2px;
      transform: rotate(14deg);
      border-top-width: 28px;
      border-left-width: 0;
      border-right-width: 42px;
    }
    &:nth-of-type(2) {
      position: absolute;
      top: 4px;
      left: 20px;
      transform: rotate(13deg);
      border-top-width: 28px;
      border-left-width: 39px;
      border-right-width: 31px;
    }
    &:nth-of-type(3) {
      position: absolute;
      top: 2px;
      left: 59px;
      transform: rotate(13deg);
      border-top-width: 28px;
      border-left-width: 38px;
      border-right-width: 28px;
    }
    &:nth-of-type(4) {
      position: absolute;
      top: 12px;
      left: 110px;
      transform: rotate(-15deg);
      border-top-width: 20px;
      border-left-width: 29px;
      border-right-width: 0;
    }
  }
  &__bottom {
    position: absolute;
    top: $EGG_BOTTOM_TOP + 24px;
    left: 11px;
    width: 155px;
    height: 67px;
    transform: rotate(0deg);
    overflow: hidden;
  }
  &__bottom-body {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 84px;
    background-color: $EGG_COLOR;
    border-radius: 50%;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
  }
  &__bottom-jagged {
    position: absolute;
    width: 155px;
    height: 40px;
    top: $EGG_BOTTOM_TOP;
    left: 13px;
    &:before {
      content: "";
      position: absolute;
      top: -24px;
      left: 3px;
      width: 20px;
      height: 50px;
      transform: rotate(12deg);
      background-color: $EGG_COLOR;
      animation: afternone 4s linear normal infinite;
    }
    &:after {
      content: "";
      position: absolute;
      top: -22px;
      right: 7px;
      width: 20px;
      height: 49px;
      transform: rotate(-11deg);
      background-color: $EGG_COLOR;
      animation: afternone 4s linear normal infinite;
    }
  }
  &__bottom-jagged-part {
    position: absolute;
    width: 0;
    height: 0;
    border-bottom-color: $EGG_COLOR;
    border-bottom-style: solid;
    border-left-color: transparent;
    border-left-style: solid;
    border-right-color: transparent;
    border-right-style: solid;
    &:nth-of-type(1) {
      top: 10px;
      top: 13px;
      left: -1px;
      transform: rotate(17deg);
      border-bottom-width: 16px;
      border-left-width: 8px;
      border-right-width: 27px;
    }
    &:nth-of-type(2) {
      position: absolute;
      top: 10px;
      left: 10px;
      transform: rotate(-12deg);
      border-bottom-width: 18px;
      border-left-width: 30px;
      border-right-width: 30px;
    }
    &:nth-of-type(3) {
      position: absolute;
      top: 9px;
      left: 61px;
      transform: rotate(8deg);
      border-bottom-width: 20px;
      border-left-width: 34px;
      border-right-width: 32px;
    }
    &:nth-of-type(4) {
      position: absolute;
      top: 7px;
      left: 104px;
      transform: rotate(-8deg);
      border-bottom-width: 20px;
      border-left-width: 34px;
      border-right-width: 13px;
    }
  }
}

.balloon {
  position: absolute;
  top: -4px;
  left: -95px;
  width: 80px;
  height: 80px;
  background-color: #fff;
  border-radius: 50%;
  transform: rotate(-10deg);
  opacity: 0;
  animation: balloon 4s linear normal infinite;
  &:before {
    content: "";
    position: absolute;
    right: 0;
    bottom: 1px;
    width: 0;
    height: 0;
    border-top: 20px solid #fff;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    transform: rotate(-42deg);
  }
}

.heart {
  position: absolute;
  width: 40px;
  height: 40px;
  top: 25px;
  left: 20px;
  &:before {
    content: "";
    position: absolute;
    left: 20px;
    top: 0;
    width: 20px;
    height: 30px;
    background-color: $HEART_COLOR;
    border-radius: 50px 50px 0 0;
    transform: rotate(-45deg);
    transform-origin: 0 100%;
  }
  &:after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 20px;
    height: 30px;
    background-color: $HEART_COLOR;
    border-radius: 50px 50px 0 0;
    transform: rotate(45deg);
    transform-origin: 100% 100%;
  }
}

@keyframes egg-top {
  0% {
    top: $EGG_TOP_CLOSE_TOP;
    transform: rotate(0);
    left: 21px;
    width: 135px;
  }
  25% {
    top: $EGG_TOP_CLOSE_TOP;
    transform: rotate(0);
    left: 21px;
    width: 135px;
  }
  35% {
    top: $EGG_TOP_TOP;
    transform: rotate(12deg);
    left: 35px;
    width: 138px;
  }
  100% {
    top: $EGG_TOP_TOP;
    transform: rotate(12deg);
    left: 35px;
    width: 138px;
  }
}

@keyframes egg-top-jagged {
  0% {
    top: $EGG_TOP_CLOSE_TOP + 36px;
    left: 18px;
    transform: rotate(0);
  }
  25% {
    top: $EGG_TOP_CLOSE_TOP + 36px;
    left: 18px;
    transform: rotate(0);
  }
  35% {
    top: $EGG_TOP_TOP + 31px;
    transform: rotate(12deg);
    left: 28px;
  }
  100% {
    top: $EGG_TOP_TOP + 31px;
    transform: rotate(12deg);
    left: 28px;
  }
}

@keyframes face {
  0% {
    top: $DINOSAURS_TOP_BEFORE;
    opacity: 0;
  }
  25% {
    top: $DINOSAURS_TOP_BEFORE;
    opacity: 0;
  }
  35% {
    top: $DINOSAURS_TOP_AFTER;
    opacity: 1;
  }
  100% {
    top: $DINOSAURS_TOP_AFTER;
    opacity: 1;
  }
}

@keyframes tail {
  0% {
    -webkit-transform: translate(138px, 115px) rotate(-180deg);
    transform: translate(138px, 115px) rotate(-180deg);
  }
  25% {
    -webkit-transform: translate(138px, 115px) rotate(-180deg);
    transform: translate(138px, 115px) rotate(-180deg);
  }
  40% {
    -webkit-transform: translate(138px, 115px) rotate(-60deg);
    transform: translate(138px, 115px) rotate(-60deg);
  }
  100% {
    -webkit-transform: translate(138px, 115px) rotate(-50deg);
    transform: translate(138px, 115px) rotate(-50deg)
  }
}

@keyframes hand {
  0% {
    transform: rotateX(-90deg);
  }
  25% {
    transform: rotateX(-90deg);
  }
  35% {
    transform: rotateX(0);
  }
  100% {
    transform: rotateX(0);
  }
}

@keyframes afternone {
  0% {
    opacity: 1;
  }
  25% {
    opacity: 1;
  }
  26% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

@keyframes beforenone {
  0% {
    opacity: 0;
  }
  5% {
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}

@keyframes balloon {
  0% {
    opacity: 0;
  }
  35% {
    opacity: 0;
  }
  40% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}

              
            
!

JS

              
                // (`・ω・´)
// No images, just CSS.
// Chrome recommended.
// twitter.com/study_dedede
              
            
!
999px

Console