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 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.

Quick-add: + add another resource

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.

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.

            
              <h1>Pure CSS3 Teapot animated icon</h1>
<div class="link">
  <a href="https://www.youtube.com/watch?v=VvjHr87wfc4&t=221s" title="Check Youtube video" target="_blanc">>> Check youtube video</a>
  <a href="http://100dayscode.co.uk/" title="Check Codepen Challenge" target="_blanc">>> Check Codepen Challenge</a>
</div>

<div class="teapot-icon">
  
  <div class="teapot-body-wrap">
  
    <!--teapot body-->
    <div class="teapot-body"> 
      <div class="teapot-body-inner-1">
        <!--light bleaks -->
        <div class="bleak bleak-1"></div>
        <div class="bleak bleak-2"></div>
      </div>
      <div class="teapot-body-inner-2"></div>
      <div class="teapot-body-inner-3"></div>
    </div>

    <!--teapot top -->
    <div class="teapot-top"></div>
  </div>
  
  <!-- teapot nose -->
  <div class="teapot-nose"></div>
  
  <!--teapot-handle-->
  <div class="teapot-handle"></div>
  
  <!--teapot bubble -->
  <div class="teapot-bubble"></div>
  
</div>
            
          
!
            
              //variables
$teapot-body: #BF0010;
$teapot-body-bright: #D7000F;
$bleak: #f54b4f;
$teapot-top: #634B5B;
$teapot-nose: #858084;
$teapot-handle: #411917;

//position absolute mixin
@mixin position-absolute($top: null, $left: null, $right: null, $bottom: null) {
  position: absolute;
  top: $top;
  left: $left;
  right: $right;
  bottom: $bottom;
}

//common styles
body {
  background-color: lighten(#EAE8FF, 3%);
}

h1 {
  margin-top: 50px;
  text-align: center;
  font: {
    family: 'Fresca', sans-serif;
    size: 50px;
  }
  color: #C03221;
}

.link {
  margin-top: 20px;
  text-align: center;
  
  a {
    text-decoration: none;
    color: $teapot-body-bright;
    font: {
      size: 20px;
      family: 'Fresca', sans-serif;
    }
    border-bottom: 2px dashed transparent;
    padding-bottom: 2px;
    transition: all 0.2s linear 0s;
    margin-right: 40px;
    
    &:last-child {
      margin-right: 0px;
    }
    
    &:hover {
      border-color: currentColor;
    }
  }
}

//teapot icon styles
.teapot-icon {
  margin: 70px auto 0px;
  width: 190px;
  height: 160px;
  position: relative;
}

//teapot body styles
.teapot-body-wrap {
  width: 164px;
  height: 123px;
  @include position-absolute($bottom: 0, $left: 0);
}

.teapot-body {
  width: 100%;
  height: 100%;
  @include position-absolute($bottom: 0, $left: 0);
  background-color: $teapot-body;
  border-top-left-radius: 50% 105px;
  border-top-right-radius: 50% 105px;
  overflow: hidden;
  
  &:before {
    content: "";
    display: block;
    background-color: darken($teapot-body, 5%);
    width: 82px;
    height: 100%;
    @include position-absolute($top: 0, $right: 0);
    border-top-right-radius: 50% 105px;
  }
  
  .teapot-body-inner {
    
    //inners styles
    &-1 {
      background-color: $teapot-body-bright;
      @include position-absolute($left: 0, $right: 0, $bottom: 0);
      width: 130px;
      height: 100%;
      margin: auto;
      border-top-left-radius: 50% 105px;
      border-top-right-radius: 50% 105px;
      z-index: 5;
      
      &:before {
        content: "";
        display: block;
        background-color: darken($teapot-body-bright, 3%);
        width: 65px;
        height: 100%;
        @include position-absolute($top: 0, $right: 0);
        border-top-right-radius: 50% 105px;
      }
      
        //bleak styles
      .bleak {
        background-color: $bleak;
        border-radius: 50%;

        &-1 {
          width: 7px;
          height: 12px;
          @include position-absolute($top: calc(50% - 20px), $left: 13px);
          transform: rotate(16deg);
        }
        
        &-2 {
          width: 4px;
          height: 4px;
          @include position-absolute($top: calc(50% - 30px), $left: 20px);
        }
      }
    }
    
    &-2 {
      background-color: $teapot-body;
      @include position-absolute($left: 0, $right: 0, $bottom: 0);
      width: 92px;
      height: 100%;
      margin: auto;
      border-top-left-radius: 50% 105px;
      border-top-right-radius: 50% 105px;
      z-index: 8;
      
      &:before {
        content: "";
        display: block;
        background-color: darken($teapot-body, 5%);
        width: 43px;
        height: 100%;
        @include position-absolute($top: 0, $right: 0);
        border-top-right-radius: 50% 105px;
      }
    }
  }
}

//teapot top styles
.teapot-top {
  width: 74px;
  height: 12px;
  background-color: $teapot-top;
  @include position-absolute($top: -2px, $left: 0, $right: 0);
  margin: auto;
  z-index: 15;
  border-radius: 20px 20px 3px 3px;
  
  &:before {
    content: "";
    display: block;
    width: 35px;
    height: 100%;
    @include position-absolute($top: 0px, $right: -1px);
    background-color: darken($teapot-top, 5%);
    border-radius: 0px 20px 3px 3px;
  }
  
  &:after {
    content: "";
    display: block;
    width: 16px;
    height: 12px;
    background-color: darken($teapot-top, 5%);
    @include position-absolute($top: -11px, $left: 0, $right: 0);
    margin: auto;
    border-radius: 50% 50% 0 0;
  }
}

//teapot nose styles
.teapot-nose {
  @include position-absolute($top: 52px, $right: 8px);
  background-color: $teapot-nose;
  width: 60px;
  height: 27px;
  transform: rotate(-40deg);
  z-index: -1;
  border-top-right-radius: 50% 50px;
  border-bottom-right-radius: 50% 50px;
  overflow: hidden;
  
  &:before {
    content: "";
    width: 100%;
    height: 45%;
    display: block;
    background-color: darken($teapot-nose, 10%);
    @include position-absolute($bottom: 0, $left: 0);
  }
  
  &:after {
    content: "";
    display: block;
    width: 12px;
    height: 100%;
    background-color: $teapot-top;
    @include position-absolute($top: 0, $right: 0);
  }
}

//teapot handle styles {
.teapot-handle {
  width: 106px;
  height: 80px;
  @include position-absolute($top: 0, $right: 29px);
  
  &:before {
    content: "";
    display: block;
    background-color: $teapot-handle;
    height: 100%;
    width: 15px;
    @include position-absolute($top: 0, $right: 0px);
    transform-origin: center top;
    transform: rotate(26deg);
    border-radius: 7px
  }
  
  &:after {
    content: "";
    display: block;
    background-color: $teapot-handle;
    height: 15px;
    width: 100%;
    @include position-absolute($top: -3px, $left: -3px);
    border-radius: 7px
  }
}

//teapot bubble styles
@keyframes bubble {
  0% {
    transform: scale(0.3);
    @include position-absolute($top: 16px, $right: -28px);
  }
  
  25% {
    transform: scale(0.5);
    @include position-absolute($top: 6px, $right: -45px);
  }
  
  50% {
    transform: scale(0.8);
    @include position-absolute($top: 0px, $right: -65px);
  }
  
  100% {
    transform: scale(0.8);
    @include position-absolute($top: 0px, $right: -65px);
  }
}

.teapot-bubble {
  background-color: darken(#EAE8FF, 5%);
  width: 40px;
  height: 40px;
  border: 2px solid #1f1f1f;
  border-radius: 50%;
  @include position-absolute($top: 16px, $right: -28px);
  transform: scale(0.3);
  animation: bubble 2s linear 0s infinite;
  
  &:before {
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    background-color: inherit;
    @include position-absolute($top: 13px, $left: -11px);
    border-radius: 50%;
    border: 2px solid #1f1f1f;
    border-right: none;
    border-top: none;
  }
  
  &:after {
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    background-color: inherit;
    @include position-absolute($top: -9px, $left: -20px);
    border-radius: 50%;
    border: 2px solid #1f1f1f;
    border-bottom: none;
    border-right: none;
  }
}
            
          
!
999px
Loading ..................

Console