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="base">
  <div class="original"></div>
  <div class="eye left"></div>
  <div class="eye right"></div>
  <div class="flab">
    <div class="outer"></div>
    <div class="mouth"></div>
    <div class="middle left"></div>
    <div class="middle right"></div>
    <div class="inner left"></div>
    <div class="inner right"></div>
  </div>
  <div class="nose"></div>
</div>

<input id="switch" type="checkbox" checked><label for="switch">Toggle</label>
            
          
!
            
              @import "compass/css3";

* {
  @include box-sizing(border-box);
}

$base-color: #F9C029;
.base {
  background-color: $base-color;
  width: 500px;
  height: 500px;
  position: relative;
}
.base * {
  position: absolute;
  width: 100%;
  height: 100%;
}

.original {
  background: url(http://user-image.logdown.io/user/449/blog/449/post/165960/hy44NQDbTU2KGdUcVSsK_jake_alpha60.jpg);
  display: none
}

$eye-outer-size: 188px;
.eye {
  width: $eye-outer-size;
  height: $eye-outer-size;
  background: #000;
  @include border-radius(50%);
  
}
$eye-inner-size: 140px;
.eye::after {
  content: "";
  display: block;
  width: $eye-inner-size;
  height: $eye-inner-size;
  background: #fff;
  @include border-radius(50%);
  position: absolute;
  top: 10px;
  right: 18px;
}
.eye.left {
  top: 106px;
  left: 29px;
}
.eye.right {
  top: 106px;
  right: 29px;
}

.flab {
  &>div {
    border: 6px solid #000;
    background: $base-color;
  }
  .outer {
    width: 306px;
    height: 156px;
    border-bottom: 0;
    @include border-radius(140px 140px 0 0);
    top: 191px;
    left: 94px;
  }
  .inner {
    width: 108px;
    height: 50px;
    border-top: 0;
    @include border-radius(0 0 50px 50px);
    top: 344px;
    &.left {
      left: 95px;
      @include rotate(-3deg);
    }
    &.right {
      right: 101px;
      @include rotate(3deg);
    }
  }
  .middle {
    width: 30px;
    height: 105px;
    border-width: 0 6px 0 0;
    @include border-radius(0 0 50% 0);
    top: 270px;
    &.left {
      @include scaleX(1.1);
      left: 172px;
    }
    &.right {
      @include scaleX(-1.1);
      right: 178px;
    }
  }
  .mouth {
    width: 150px;
    height: 100px;
    border-color: $base-color;
    border-bottom: 6px solid #000;
    @include border-radius(50%);
    top: 244px;
    left: 173px;
  }
}

.nose {
  width: 100px;
  height: 72px;
  background: #000;
  @include border-radius(50%);
  top: 234px;
  left: 197px;
}


            
          
!
            
              $('#switch').click(function(){
  $('.base').find('*:not(.original)').toggle(this.checked);
  $('.original').toggle(!this.checked);
});
            
          
!
999px
Loading ..................

Console