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

              
                <div class="fake circle"></div>

<a class="outerhover" href="#">
<div class="circle">
  <div class="popsicle">
    <div class="creamborder"></div>
    <div class="drip"></div>
    <div class="cream"></div>
    <div class="eye"></div>
    <div class="eye"></div>
    <div class="mouth"></div>
  </div>
</div>
<div class="stick"></div>
</a>

<div class="embellishments">
  <div class="heart"></div>
  <div class="heart"></div>
  <div class="heart"></div>
  <div class="sparkle"></div>
  <div class="sparkle"></div>
  <div class="sparkle"></div>
</div>

<div class="hint">Click me!</div>
              
            
!

CSS

              
                $bg: #fee6ad;
$circle: #a2c2e0;
$heartmax: #fc4b3c;
$heartmin: #ff7c38;
$border: #5a3b72;
$eyeshadow: #512866;
$cream: #ff811a;
$creamshadow: #f45b34;
$stick: #ffce88;
$stickshadow: #ffa56c;

.popsicle {
  height: 3em;
  margin-top: .1em;
  position: static;
  perspective: 1em;
  transition: .3s all ease-in-out;
  width: 3em;
  .creamborder, .cream {
    border-radius: 4em 4em 2.5em 2.5em;
    height: 2.3em;
    margin: -1.35em 0 0 -1.07em;
    overflow: hidden;
    transform: translateZ(-.2em) rotateX(3deg);
    width: 1.9em;
  }

  .cream {
    background: $creamshadow;
    transform: translate3d(.12em, .12em, -.2em) rotateX(3deg) scale(1.02);
    &::before {
      background: $cream;
      border-radius: 4em 4em 2.5em 2.5em;
      content: "";
      font-size: .8em;
      height: 2.5em;
      left: 0;
      top: 0;
      width: 1.9em;
      z-index: 1;
    }
  }

  .creamborder {
    border: .12em solid $border;
    background: $creamshadow;
  }

  .eye {
    background: $eyeshadow;
    border: .06em solid #fff;
    border-radius: 4em;
    height: .4em;
    overflow: hidden;
    opacity: 0;
    margin: -.55em 0 0 -.65em;
    width: .4em;
    transition: .2s all ease-in-out;
    &::before, &::after {
      content: "";
      background: #fff;
      border-radius: 4em;
      height: .06em;
      width: .06em;
      left: .2em;
      top: .28em;
    }
    &::after {
      font-size: 3em;
      top: .02em;
      left: .05em;
    }

    + .eye {
      margin-left: .15em;
    }
  }
  .mouth {
    background: $border;
    border-radius: .2em .2em 1em 1em;
    font-size: .3em;
    height: 0;
    margin: -.2em 0 0 -.45em;
    opacity: 0;
    transition: .1s all ease-in-out;
    transition-delay: 0s;
    width: 1em;
  }
  .drip {
    background: $creamshadow;
    border: .05em solid $border;
    height: .2em;
    width: .2em;
    border-radius: 0 4em 4em;
    transform: rotate(45deg);
    margin-left: .45em;
    margin-top: .5em;
  }
}
.stick {
  background: $stickshadow;
  border: .09em solid $border;
  border-radius: .2em .2em 1em 1em;
  height: .6em;
  margin: .1em 0 0 -.33em;
  overflow: hidden;
  width: .5em;
  pointer-events: none;
  transform: translate(0, .85em);
  transition: .3s all ease-in-out;
  z-index: 2;
  &::before {
    background: $stick;
    border-radius: .2em .2em 1em 1em;
    content: "";
    font-size: .8em;
    height: .6em;
    left: 0;
    top: .05em;
    width: .5em;
  }
}

body {
  background: $bg;
  font-weight: bold;
  font-family: 'Helvetica', 'Arial', sans;
  font-size: 13vh;
  &::before {
    bottom: 0;
    content: "";
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
  }

  * {
    &, &::before, &::after {
      outline: none;
      position: absolute;
      top: 50%;
      left: 50%;
    }
  }
  &:hover, &:focus {
    .hint {
      opacity: 0;
    }
  }
}

.hint {
  color: $stickshadow;
  font-size: .4em;
  left: 0;
  margin-top: 6em;
  opacity: 1;
  pointer-events: none;
  text-align: center;
  text-transform: uppercase;
  transform: translateZ(-.2em) rotateX(3deg);
  transition: .7s all ease-in-out;
  width: 100%;
}

.circle {
  border-radius: 4em;
  cursor: pointer;
  height: 3em;
  overflow: hidden;
  transform: translate(-50%, -50%);
  width: 3em;
  z-index: 1;

  &.fake {
    background: $circle;
    z-index: 0;
  }
}

.outerhover {
  &:hover, &:focus {
    z-index: 1;

    & ~ .embellishments {
      .sparkle {
        transition-delay: .2s;
        margin-left: 1.23em;
        transform: rotate(180deg);
      }
      .sparkle + .sparkle {
        transition-delay: .1s;
        margin-left: -2.8em;
        margin-top: -.9em;
      }
      .sparkle + .sparkle + .sparkle {
        transition-delay: .4s;
        margin-left: .2em;
        margin-top: -2.4em;
      }

      .heart {
        margin-left: 1.4em;
        margin-top: -2em;
        transform: rotate(65deg);
      }
      .heart + .heart {
        transition-delay: .15s;
        margin-left: -2.3em;
        margin-top: -4.6em;
        transform: rotate(25deg);
      }
      .heart + .heart + .heart {
        transition-delay: .3s;
        margin-left: .8em;
        margin-top: -8em;
        transform: rotate(55deg);
      }
    }
    
    .eye {
      margin-top: -.55em;
      height: .4em;
      opacity: 1;
      animation: blink 4s infinite;
    }
    .mouth {
      height: .6em;
      opacity: 1;
      transition-delay: .2s;
      transition: .4s all ease-in-out;
    }
    .drip {
      animation: drip 6s infinite;
      animation-timing-function: cubic-bezier(0.49, 0.68, 1, -0.19);
    }
    .stick, .popsicle {
      margin-top: 0;
    }
  }
}

.embellishments {
  z-index: 0;
}

.sparkle {
  border-radius: 4em;
  height: .5em;
  width: .5em;
  left: .2em;
  position: absolute;
  font-size: .8em;
  transition: .3s all ease-in-out;
  z-index: 0;

  &::before, &::after {
    top: 50%;
    left: -10%;
    height: .15em;
    width: 120%;
    margin-top: -.05em;
    background: #fff;
    content: "";
    border-radius: 4em;
  }
  &::after {
    transform: rotate(90deg);
  }
  + .sparkle {
    font-size: .5em;
  }
  + .sparkle + .sparkle {
    font-size: .6em;
  }
}

.heart {
  font-size: .6em;
  height: 1em;
  width: 1em;
  background: $heartmax;
  transform: rotate(45deg);
  border-radius: 0 0 .2em;
  transition: .3s all ease-in-out;
  margin-left: -.5em;

  + .heart {
    font-size: .4em;
    background: mix($heartmax, $heartmin);
  }
  + .heart + .heart {
    font-size: .3em;
    background: $heartmin;
  }

  &::before, &::after {
    content: "";
    background: inherit;
  }

  &::before {
    height: .6em;
    width: 1em;
    border-radius: 4em 4em 0 0;
    left: 0;
    top: -.5em;
  }
  &::after {
    height: 1em;
    width: .6em;
    border-radius: 4em 0 0 4em;
    left: -.5em;
    top: 0;
  }
}

@-webkit-keyframes drip {
  0% {
    margin-top: .45em;
  }
  10% {
    margin-top: .45em;
  }
  30% {
    margin-top: 1.8em;
  }
  100% {
    margin-top: 1.8em;
  }
}
@-moz-keyframes drip {
  0% {
    margin-top: .45em;
  }
  10% {
    margin-top: .45em;
  }
  30% {
    margin-top: 1.8em;
  }
  100% {
    margin-top: 1.8em;
  }
}
@-o-keyframes drip {
  0% {
    margin-top: .45em;
  }
  10% {
    margin-top: .45em;
  }
  30% {
    margin-top: 1.8em;
  }
  100% {
    margin-top: 1.8em;
  }
}
@keyframes drip {
  0% {
    margin-top: .45em;
  }
  10% {
    margin-top: .45em;
  }
  30% {
    margin-top: 1.8em;
  }
  100% {
    margin-top: 1.8em;
  }
}
@keyframes blink {
  0% {
    margin-top: -.55em;
    height: .4em;
  }
  48% {
    margin-top: -.55em;
    height: .4em;
  }
  50% {
    margin-top: -.35em;
    height: 0;
  }
  53% {
    margin-top: -.55em;
    height: .4em;
  }
  100% {
    margin-top: -.55em;
    height: .4em;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console