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="container">
    <div class="tail-container">
      <div class="tail"></div>
    </div>
  <div class="face">
    <div class="mouth"></div>
    <div class="left-cheek">
      <span class="whisker1"></span>
        <span class="whisker2"></span>
    </div>
    <div class="eyebrows"></div>
    <div class="right-cheek">
      <span class="whisker1"></span>
        <span class="whisker2"></span>
    </div>
    <div class="left-eye"></div>
     <div class="left-pupil"></div>
    <div class="right-eye"></div>
        <div class="right-pupil"></div>
     <div class="nose"></div>
  </div>
  <div class="body">
    <div class="clock-body">
      <div class="clockface">
        <span class="minute-hand"></span>
        <span class="hour-hand"></span>
      </div>
    </div>
  </div>
  <div class="paws">
    <div class="paw paw1">
      <span class="toe1"></span>
         <span class="toe2"></span>
         <span class="toe3"></span>
         <span class="toe4"></span>
    </div>
      <div class="paw paw2">
      <span class="toe1"></span>
         <span class="toe2"></span>
         <span class="toe3"></span>
         <span class="toe4"></span>
    </div>
      <div class="paw paw3">
      <span class="toe1"></span>
         <span class="toe2"></span>
         <span class="toe3"></span>
         <span class="toe4"></span>
    </div>
      <div class="paw paw4">
      <span class="toe1"></span>
         <span class="toe2"></span>
         <span class="toe3"></span>
         <span class="toe4"></span>
    </div>
  </div>
  

</div>
              
            
!

CSS

              
                $black: #3a3a3a;
$offWhite: #fbf4e5;
body{
 height: 100vh;
 display: flex;
 justify-content: center;
 align-items: center;
 background-color: $black;
}

.container{
  width: 400px;
  height: 300px;
  position: relative;
  

  .face{
    height: 80px;
    width: 80px;
    position: absolute;
    top:30px;
    left: 50%;
    transform: translate(-50%);
    border-radius: 100%;
    background-image:
      linear-gradient(to top,
      $offWhite,
      $offWhite 40%,
      transparent 40%);
    .mouth{
    height: 40px;
    width: 45px;
    position: absolute;
    bottom: 1px;
    left: 50%;
    transform: translate(-50%);
     border-radius: 45%;
    background-color: $black;
      
    }
    .left-cheek{
      height: 16px;
    width: 25px;
      position: absolute;
    top: 60%;
    left: 16px;
     background-color: $offWhite;
      border-radius: 0 50% 50% 0;
      .whisker1{
        content:"";
        position: absolute;
        top: 5px;
        left: -10px;
        height: 1px;
        width: 22px;
        border: .5px solid $black;
        background-color: $black;
        border-radius: 1.5px;
        transform: rotate(-4deg);
      }
      .whisker2{
        content:"";
        position: absolute;
        top: 9px;
        left: -4px;
        height: 1px;
        width: 17px;
        border: .5px solid $black;
        background-color: $black;
        border-radius: 1.5px;
        transform: rotate(-16deg);
      }
    }
    .right-cheek{
        height: 16px;
    width: 25px;
      position: absolute;
    top: 60%;
    right: 16px;
     background-color: $offWhite;
      border-radius: 50% 0 0 50% ;
      .whisker1{
        content:"";
        position: absolute;
        top: 5px;
        right: -10px;
        height: 1px;
        width: 22px;
        border: .5px solid $black;
        background-color: $black;
        border-radius: 1.5px;
        transform: rotate(4deg);
      }
      .whisker2{
        content:"";
        position: absolute;
        top: 9px;
        right: -4px;
        height: 1px;
        width: 17px;
        border: .5px solid $black;
        background-color: $black;
        border-radius: 1.5px;
        transform: rotate(16deg);
      }
    }
    .eyebrows{
      position: absolute;
      height: 40px;
      width: 40px;
      left: -2px;
      background-color: $offWhite;
      border-radius: 50%;
      box-shadow: 43px 0 0 $offWhite;
      &::after{
      content: "";
      position: absolute;
        top: 2px;
      height: 40px;
      width: 40px;
      background-color: $black;
      border-radius: 50%;
      box-shadow: -2px 0 0 $black,
        2px 0 0 $black,
        43px 0 0 $black,
        41px 0 0 $black,
        45px 0 0 $black;
      }
    }
    .left-eye{
      position: absolute;
      height: 40px;
      width: 40px;
      top: 8px;
      left: -3px;
      background-color: $offWhite;
      border-radius: 50%;
      border: 2px solid $black;
      &::after{
      content: "";
      position: absolute;
      right: 16px;
      top: 1px;
      height: 40px;
      width: 8px;
      background-color: $black;
      border-radius: 50%;
           transform-origin: center;
           animation: 2s lookAround linear infinite;
      }
    }
    .right-eye{
      position: absolute;
      height: 38px;
      width: 40px;
      top: 8px;
      right: -3px;
      background-color: $offWhite;
      border-radius: 50%;
      border: 2px solid $black;
         &::after{
      content: "";
      position: absolute;
      right: 16px;
      top: 0px;
      height: 40px;
      width: 8px;
      background-color: $black;
      border-radius: 50%;
           transform-origin: center;
           animation: 2s lookAround linear infinite;
    }
    }

    .nose{
      height: 11px;
      width: 20px;
      border-radius: 28% 28% 50% 50%;
      background-color: $black;
      position: absolute;
      left: 50%;
      transform: translate(-50%);
      top: 52%;
    }
  }
  .body{
    position: absolute;
    left: 50%;
    transform: translate(-50%);
    top: 120px;
    .clock-body{
    height: 80px;
    width: 80px;
    background-color: $offWhite;
    border-radius: 50%;
    position: relative;
      &::after{
         content: "";
         width: 5px;
         height: 5px;
         border-radius: 50%;
         position: absolute;
         background-color: $black;
         left: 2px;
         top: 38px;
         box-shadow: 
           36px -36px 0 $black,
           53px -29px 0 $black,
           66px -16px 0 $black,
           72px 0 0 $black,
           66px 16px 0 $black,
           53px 29px 0 $black,
           36px 36px 0 $black,
           17px 29px 0 $black,
           4px 16px 0 $black,
           17px -29px 0 $black,
           4px -16px 0 $black,
           
           ;
       }
     .clockface{
      position: absolute;
      height: 12px;
      width: 12px;
      border-radius: 50%;
      background-color: $black;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
       // &::after{
       //   content: "";
       //   width: 5px;
       //   height: 5px;
       //   border-radius: 50%;
       //   position: absolute;
       //   background-color: $black;
       //   left: 5px;
       //   top: 10px;
       // }
       .minute-hand{
         position: absolute;
         top: -22px;
         left: 4.5px;
         height: 22px;
         width: 3px;
         background-color: $black;
         
         &::after{
           content: "";
           height: 8px;
           width: 3px;
           background-color: $black;
           top: -8px;
           position: absolute;
           border-radius: 40% 40% 0 0;
           clip-path: polygon(35% 0, 65% 0, 100% 100%, 0% 100%);
         }
       }
        .hour-hand{
         position: absolute;
         top:-3.35px;
         left: -10px;
         height: 18px;
         width: 3px;
         background-color: $black;
         transform: rotate(-90deg);
         &::after{
           content: "";
           height: 8px;
           width: 3px;
           background-color: $black;
           top: -8px;
           position: absolute;
           border-radius: 40% 40% 0 0;
           clip-path: polygon(35% 0, 65% 0, 100% 100%, 0% 100%);
         }
       }
    }
    }
  }
  .paws{
    height: 100px;
    width: 100px;
     position: absolute;
    left: 50%;
    transform: translate(-50%);
    top: 110px;
    
    .paw{
      position: absolute;
      height: 14px;
      width: 14px;
      border-radius: 50%;
      background-color: $offWhite;
         .toe1{
        left: -7px;
        top: -4px;
        height: 10px;
        width: 7px;
         background-color: $offWhite;
      position: absolute;
         border-radius: 50%;
        
        transform: rotate(-25deg);
      }
       .toe2{
        left: -1px;
        top: -12px;
        height: 10px;
        width: 7px;
         background-color: $offWhite;
      position: absolute;
         border-radius: 50%;
        
        transform: rotate(-18deg);
      }
                 .toe3{
        left: 8px;
        top: -12px;
        height: 10px;
        width: 7px;
         background-color: $offWhite;
      position: absolute;
         border-radius: 50%;
        
        transform: rotate(5deg);
      }
           .toe4{
        left: 14px;
        top: -4px;
        height: 10px;
        width: 7px;
         background-color: $offWhite;
      position: absolute;
         border-radius: 50%;
        
        transform: rotate(25deg);
      }
      
    }
    .paw1{
      top: 15px;
    }
    .paw2{
      bottom:-5px;
    }
     .paw3{
      top: 15px;
      right: 0;
    }
    .paw4{
      bottom:-5px;
      right: 0;
    }
  }
  .tail-container{
    position: absolute;

    bottom:0;
    left: 50%;
    transform: translate(-50%);
  .tail{
    height: 160px;
    width: 160px;
    position: relative;
    border-radius: 100%;
    animation: 2s wagTail linear infinite;
    &::before{
    content: "";
    position: absolute;
    bottom: 20px;
    right: -5px;
    width: 25px;
    height: 20px;
    background-color: $offWhite;
    border-radius: 0 50% 50% 0;
    transform: rotate(30deg);
  }
    &::after{
    content: "";
    height: 160px;
    width: 160px;
    position: absolute;
    background-color: $black;
    border-radius: 100%;
    }
  }
  }
}
@keyframes lookAround{
  0%{
    transform: translateX(16px) scaleY(.7);
    animation-timing-function: ease-in;
  }
  12.5% {
    animation-timing-function: linear;
  }
  25%{
    transform: translateX(0) scaleY(1);
    animation-timing-function: linear;
  }
  37.5% {
    animation-timing-function: ease-out;
  }
  50%{
    transform: translateX(-16px) scaleY(.7);
    animation-timing-function: ease-in;
  }
  62.5% {
    animation-timing-function: linear;
  }
  75%{
     transform: translateX(0) scaleY(1);
     animation-timing-function: linear;
  }
  87.5% {
    animation-timing-function: ease-out;
  }
  100%{
    transform: translateX(16px) scaleY(.7);
    animation-timing-function: ease-in;
  }
}
// @keyframes lookAround{
//   0%{
//     transform: translateX(16px) scaleY(.7);
//   }
//   25%{
//      transform: translate(0, -1px) scaleY(1);
//   }
//   50%{
//     transform: translate(-16px, 0px) scaleY(.7);
//   }
//    75%{
//      transform: translate(0, -1px) scaleY(1);
//   }
//   100%{
//        transform: translate(16px, 0px) scaleY(.7);
//   }
// }
@keyframes wagTail{
  0%{
    transform: rotate(0);
  }
  50%{
    transform: rotate(100deg);
  }
  100%{
    transform: rotate(0);
  }
}
              
            
!

JS

              
                // Inspired by Yimbo Escárrega's work on Dribbble

// Check out his shot 'kit-cat clock' here:
// https://dribbble.com/shots/1616260-Kit-Cat-Clock
              
            
!
999px

Console