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.

            
              <div class="container">
  <div class="hat">
    <div class="-top">
    </div>
  </div>
  <div class="hamburger">
    <div class="teardrop"></div>
    <div class="tearsplat"></div>
    <div class="bun -top">
      <span class="seeds -first"></span>
      <span class="seeds -second"></span>
      <span class="seeds -third"></span>
      <span class="seeds -fourth"></span>
      <div class="face">
        <span class="eye -left"></span>
        <span class="closed-eye -left"><span class="inner"></span></span>
        <span class="eye -right"></span>
        <span class="closed-eye -right"><span class="inner"></span></span>
        <span class="mouth"><span class="inner"></span></span>
      </div>
    </div>
    <div class="middle">
      <div class="meat -top">
        <span class="spots"></span>
      </div>
      <div class="cheese"><div class="drip"><span class="drip-inner"></span></div></div>
      <div class="tomato"></div>
      <div class="onion"></div>
      <div class="lettuce">
        <span class="leaf -big -first"></span>
        <span class="leaf -small -first"></span>
        <span class="leaf -big -second"></span>
        <span class="leaf -small -second"></span>
        <span class="leaf -big -third"></span>
      </div>
      <div class="meat -bottom">
        <span class="spots"></span>
      </div>
    </div>
    <div class="bun -bottom"></div>
  </div>
</div>
            
          
!
            
              // Colors
$gray: #E5E2DF;
$pink: #F38191;
$brown: #9F754B;
$brown-lighter: #AF8259;
$brown-light: #A87B50;
$brown-dark: #3C2415;
$brown-darker: #351E0F;
$green: #6CB266;
$yellow: #FFC907;
$red: #F26522;
$red-dark: #DB5C1E;
$purple: #C7B6D9;
$purple-dark: #C78BBD;
$purple-light: #CCBCDB;
$blue: #68CAD6;

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

body {
  background: $pink;
}

.container {
  width: 392px;
  margin: 200px auto;
}

.hat {
  width: 136px;
  height: 100px;
  margin: 0 auto;
  background: #fff;
  position: relative;
  border-top: 25px solid #fff;
  border-radius: 20px 20px 0 0;
  &::before {
    top: 0;
    left: 0;
    content: '';
    width: 100%;
    height: 35px;
    background: $gray;
    position: absolute;
  }
  .-top {
    left: 50%;
    width: 85px;
    height: 85px;
    bottom: 100%;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    transform: translateX(-50%);
    &::before, &::after {
      top: 0;
      width: 85px;
      content: '';
      height: 85px;
      background: #fff;
      border-radius: 50%;
      position: absolute;
    }
    &::before {
      left: -75%;
    }
    &::after {
      right: -75%;
    }
  }
}

.teardrop {
  opacity: 0;
  z-index: 1;
  width: 22px;
  right: 130px;
  height: 22px;
  bottom: 265px;
  background: $blue;
  border-radius: 50%;
  position: absolute;
  animation: tearfall 2s infinite forwards; 
  &::before {
    left: 3px;
    height: 0;
    top: -10px;
    content: '';
    position: absolute;
    border-style: solid;
    border-left-width: 8px;
    border-right-width: 8px;
    border-bottom-width: 12px;
    border-color: transparent transparent $blue transparent;
  }
}
.tearsplat {
  bottom: 0;
  z-index: 1;
  opacity: 0;
  width: 40px;
  right: 122px;
  height: 20px;
  background: $blue;
  perspective: 120px;
  position: absolute;
  border-radius: 40px 40px 0 0;
    &::before {
    left: 3px;
    top: -30px;
    width: 10px;
    content: '';
    height: 30px;
    background: $blue;
    border-radius: 10px;
    position: absolute;
    transform: rotateX(45deg);
  }
}

.hamburger {
  position: relative;
}

.bun {
  width: 100%;
  position: relative;
  background: $brown;
  &::before {
    top: 0;
    left: 0;
    width: 80%;
    content: '';
    height: 100%;
    position: absolute;
    background: $brown-light;
  }
  &.-top {
    height: 110px;
    border-radius: 120px 120px 12px 12px;
    &::before {
      border-radius: 120px 120px 12px 12px;
    }
  }
  &.-bottom {
    height: 80px;
    border-radius: 12px 12px 80px 80px;
    &::before {
      border-radius: 12px 12px 80px 80px;
    }
  }
  .seeds {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    position: absolute;
    background: $brown-lighter;
    &::before, &::after {
      content: '';
      width: 12px;
      height: 12px;
      border-radius: 50%;
      position: absolute;
      background: $brown-lighter;
    }
    &.-first {
      top: 15px;
      left: 60px;
      &::before {
        right: -6px;
        bottom: -25px;
      }
      &::after {
        right: -30px;
        bottom: -6px;
      }
    }
    &.-second {
      top: 14px;
      left: 120px;
      &::before {
        right: -9px;
        bottom: -20px;
      }
      &::after {
        top: -4px;
        right: -40px;
      }
    }
    &.-third {
      top: 42px;
      left: 178px;
      &::before {
        top: -10px;
        right: -38px;
      }
      &::after {
        top: -30px;
        right: -45px;
      }
    }
    &.-fourth {
      top: 32px;
      left: 257px;
    }
  }
}

.face {
  left: 50%;
  height: 32px;
  width: 140px;
  bottom: 20px;
  position: absolute;
  transform: translateX(-50%);
  .eye {
    bottom: 0;
    z-index: 1;
    width: 30px;
    height: 30px;
    position: absolute;
    border-radius: 50%;
    background: $brown-dark;
    transform-origin: bottom;
    animation: blink 2s ease infinite forwards;
    &.-left {
      left: 0;
    }
    &.-right {
      right: 0;
    }
  }
  .closed-eye {
    bottom: 0;
    z-index: 2;
    transform: rotate(180deg);
    animation: closedBlink 2s ease infinite forwards;
    &.-left {
      left: 0;
    }
    &.-right {
      right: 0;
    }
  }
  .mouth {
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
  }
  .mouth,
  .closed-eye {
    width: 30px;
    height: 15px;
    position: absolute;
    background: $brown-dark;
    border-radius: 30px 30px 0 0;
    &::before, &::after {
      width: 7px;
      height: 7px;
      content: '';
      bottom: -4px;
      border-radius: 50%;
      position: absolute;
      background: $brown-dark;
    }
    &::before {
      left: 0;
    }
    &::after {
      right: 0;
    }
    .inner {
      left: 50%;
      bottom: 0;
      height: 9px;
      width: 16px;
      position: absolute;
      background: $brown-light;
      transform: translateX(-50%);
      border-radius: 30px 30px 0 0;
    }
  }
}

.meat {
  width: 90%;
  height: 60px;
  margin: 0 auto;
  position: relative;
  border-radius: 30px;
  background: $brown-darker;
  &::before {
    top: 0;
    left: 0;
    width: 92%;
    content: '';
    height: 100%;
    position: absolute;
    background: $brown-dark;
    border-radius: 30px 20px 20px 30px;
  }
  .spots {
    position: absolute;
    border-radius: 50%;
    background: $brown-darker;
    &::before, &::after {
      content: '';
      border-radius: 50%;
      position: absolute;
      background: $brown-darker;
    }
  }
  &.-top {
    .spots {
      top: 20px;
      left: 15px;
      width: 18px;
      height: 18px;
      &::before {
        top: -12px;
        right: -8px;
        width: 12px;
        height: 12px;
      }
      &::after {
        width: 10px;
        height: 10px;
        right: -12px;
        bottom: -10px;
      }
    }
  }
  &.-bottom {
    .spots {
      left: 3px;
      top: 25px;
      width: 12px;
      height: 12px;
      &::before {
        width: 12px;
        height: 12px;
        right: -12px;
        bottom: -14px;
      }
      &::after {
        top: 12px;
        left: 210px;
        width: 12px;
        height: 12px;
      }
    }
  }
}

.cheese {
  width: 92%;
  height: 20px;
  margin: 0 auto;
  position: relative;
  border-radius: 8px;
  background: $yellow;
  .drip {
    top: 100%;
    left: 10%;
    width: 76px;
    height: 20px;
    position: absolute;
    &::after {
      left: 50%;
      width: 64px;
      content: '';
      height: 40px;
      bottom: -5px;
      position: absolute;
      background: $yellow;
      transform: translateX(-50%);
      border-radius: 0 0 60px 60px;
    }
    .drip-inner {
      width: 100%;
      height: 12px;
      display: block;
      overflow: hidden;
      &::after {
        top: 0;
        left: 0;
        content: '';
        display: block;
        position: relative;
        border-width: 20px;
        border-style: solid;
        border-color: $yellow transparent transparent transparent;
      }
    } 
  }
}

.tomato {
  width: 88%;
  height: 30px;
  margin: 0 auto;
  background: $red;
  border-right: 36px solid $red-dark;
}

.onion {
  width: 97%;
  height: 22px;
  position: relative;
  background: $purple;
  border-left: 10px solid $purple-light;
  &::before, &::after {
    top: 0;
    content: '';
    height: 100%;
    position: absolute;
    background: $purple-dark;
  }
  &::before {
    left: 38%;
    width: 22px;
  }
  &::after {
    right: 0;
    width: 40px;
  }
}

.lettuce {
  z-index: 1;
  width: 85%;
  height: 0px;
  margin: 0 auto;
  background: $green;
  position: relative;
  .leaf {
    top: 0;
    position: absolute;
    background: $green;
    border-radius: 0 0 75px 75px;
    &.-big {
      height: 40px;
      width: 22%;
      &.-second {
        left: 50%;
        transform: translateX(-50%);
      }
      &.-third {
        right: 0;
      }
    }
    &.-small {
      height: 30px;
      width: 18%;
      &.-first {
        left: 21.5%;
      }
      &.-second {
        right: 21.5%;
      }
    }
  }
}

// Animations
@keyframes tearfall {
  0%, 59% {
    opacity: 0;
    bottom: 265px;
  }
  60% {
    opacity: 1;
  }
  85% {
    bottom: 0;
    opacity: 1;
  }
  86%,100% {
    bottom: 0;
    opacity: 0;
  }
}

@keyframes blink {
  0%,24%,36%,50%,100% {
    bottom: 0;
    opacity: 1;
    height: 30px;
    border-radius: 50%;
  }
  25%, 35% {
    opacity: 1;
    height: 8px;
    bottom: 11px;
    border-radius: 1px;
  }
  60%,90% {
    bottom: 0;
    opacity: 1;
    height: 15px;
    border-radius: 2px 2px 15px 15px;
  }
  61%, 89% {
    opacity: 0;
  }
}

@keyframes closedBlink {
  0%,59%,91%,100% {
    opacity: 0;
  }
  60%,90% {
    opacity: 1;
  }
}
            
          
!
            
              // replicating http://static1.squarespace.com/static/52c60fede4b0f4d7d4c1c03c/t/54a83458e4b01e05d9af9305/1420309606562/?format=1500w
// by richard perez
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console