cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatpop-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.elephant-container
  div.hearts
    div.heart
  div.elephant
    div.elephant-body
      div.top-body
      div.bottom-body
      div.elephant-legs
        div.elephant-leg.elephant-leg-left
        div.elephant-leg.elephant-leg-right
      div.elephant-tail
    div.elephant-head
      div.elephant-ear
      div.elephant-eye
      div.elephant-nose
            
          
!
            
              //vars
$bg-color: #fff5f0;
$main-color: #83868f;
$ear-color: #91949b;
$eye-color: #36393e;
$legs-color: #e7dad1;
$heart-color: #c42319;

//common styles
body {
  background-color: $bg-color;
}

//container styles
.elephant-container {
  width: 466px;
  margin: 130px auto 0px auto;
  height: 283px;
  position: relative;
}

//elephant styles
.elephant {
  position: relative;
  left: 35px;
  height: 100%;
  
  .elephant-body {
    position: absolute;
    left: 0;
    top: 12px;
    width: 280px;
    height: 268px;
    
    .top-body {
      position: absolute;
      left: 0;
      top: 0;
      width: 220px;
      height: 220px;
      background-color: $main-color;
      border-radius: 50%;
    }
    
    .bottom-body {
      position: absolute;
      left: 57px;
      top: 135px;
      width: 240px;
      height: 100px;
      background-color: $main-color;
      border-radius: 50%;
    }
    
    .elephant-legs {
      position: absolute;
      bottom: 0;
      left: 1px;
      width: 280px;
      height: 143px;
      
      .elephant-leg {
        width: 82px;
        height: 100%;
        background: radial-gradient(circle at 50% 100%, rgba($legs-color,1) 9px, #fff 10px, rgba($legs-color,0) 11px ) 0 100%, $main-color;
        background-size: 20px 20px;
        background-repeat: repeat-x;
        position: absolute;
        top: 0;
        border-radius: 0px 0px 20px 20px;
        overflow: hidden;
        
        &-left {
          left: 0;
        }
        
        &-right {
          right: 0;
        }
      }
    }
    
    .elephant-tail {
        position: absolute;
        top: 118px;
        left: -31px;
        width: 44px;
        height: 47px;
        
        &:before,
        &:after {
          content: " ";
          display: block;
          position: absolute;
        }
        
        &:before {
          width: 44px;
          height: 8px;
          background-color: $main-color;
          top: 0;
          right: 0;
          transform: rotate(-45deg);
        }
      
        &:after {
          width: 27px;
          height: 27px;
          background-color: $main-color;
          bottom: 20px;
          left: -1px;
          border-radius: 50%;
        }
      }
  }
  
  .elephant-head {
    position: absolute;
    left: 140px;
    top: 0;
    width: 220px;
    height: 220px;
    background-color: $main-color;
    border-radius: 50%;
    
    .elephant-ear {
      position: absolute;
      left: -14px;
      top: 27px;
      height: 188px;
      width: 140px;
      background-color: #91949b;
      border-radius: 50%;
      transform: rotate(-15deg);
      
      &:after {
        content: "";
        display: block;
        width: 40px;
        height: 113px;
        position: absolute;
        top: 61px;
        right: -29px;
        background-color: $main-color;
        transform: rotate(15deg);
      }
    }
    
    .elephant-eye {
      background-color: $eye-color;
      position: absolute;
      right: 39px;
      bottom: 55px;
      height: 28px;
      width: 28px;
      border-radius: 50%;
      z-index: 2;
      
      &:after {
        content: "";
        display: block;
        width: 14px;
        height: 14px;
        background-color: #fff;
        border-radius: 50%;
        position: absolute;
        top: 1px;
        left: 4px;
      }
    }
    
    .elephant-nose {
      position: absolute;
      top: 103px;
      right: -87px;
      width: 103px;
      height: 61px;
      border: 10px solid transparent;
      border-left: 72px solid $main-color;
      border-bottom: 29px solid $main-color;
      border-radius: 50%;
      transform: rotate(-45deg);
      
      &:after {
        content: "";
        display: block;
        position: absolute;
        top: 47px;
        right: -3px;
        transform: rotate(107deg);
        background-color: #83868f;
        width: 17px;
        height: 17px;
        border-radius: 50% 50% 0% 50%;
      }
    }
  }
}

//hearts styles

@keyframes heart-animation {
  0% {
    top: 0;
    transform: scale(1);
    opacity: 1;
  }
  
  33% {
    top: -40px;
    transform: scale(0.75);
    opacity: 1;
  }
  
  66% {
    top: -80px;
    transform: scale(0.35);
    opacity: 0.5;
  }
  
  93% {
    top: -120px;
    transform: scale(0);
    opacity: 0;
  }
  
  100% {
    top: -120px;
    transform: scale(0);
    opacity: 0;
  }
}

.hearts {
  position: absolute;
  right: 41px;
  top: 25px;
  
  .heart {
    position: absolute;
    width: 63px;
    height: 70px;
    top: 0;
    left: 0;
    animation: heart-animation 1.5s linear 0s infinite;
    
    &:before,
    &:after {
      content: "";
      display: block;
      background-color: $heart-color;
      width: 40px;
      height: 70px;
      border-radius: 20px;
      top: 0;
      position: absolute;
    }
    
    &:before {
      left: 0;
      transform: rotate(-45deg);
    }
    
    &:after {
      right: 0;
      transform: rotate(45deg);
    }
  }
}
            
          
!
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