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.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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>The bear cu<span>b</span>p</h1>
<h2>Or how a misreading can lead to something different</h2>
<p>What? A bear cup? What is a bear cup anyway? <br>You mean a cup with a bear on it? Or in it?<br>No, what - you meant a bear cub? 
A cute baby bear?<br>
 Man, I'm done already.<br><br>
  #dailycssimages day 01.  Made with &#10084; by webandapp.fr</p>
  </p>


<div class="cup">
  <div class="cup-saucer"></div>  
  <div class="cup-cup">
    <div class="cream"></div>
    <div class="coffee">
      <div class="bear">
        <div class="ear left"></div>
        <div class="ear right"></div>
        <div class="face">
          <div class="eye left"></div>
          <div class="eye right"></div>
          <div class="snout">
            <div class="nose"></div>
            <div class="mouth"></div>
          </div>
        </div>
      </div>
    </div>
  </div>      
  <div class="cup-handler"></div>
</div>
            
          
!
            
              /* basic reset and outline */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

html {
  box-sizing: border-box;
}

*, *:before, *:after {
  box-sizing: inherit;
}

body {
  font-family: 'Shadows Into Light', cursive;
}


.cup {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%);
  min-width: 300px;
  width: 30%;
  z-index: 2;
  
  &:after {
    content: "";
    display: block;
    margin-top: 100%;
  }
  
  &-handler {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    transform: rotate(20deg);
    
    &:after {
      content: "";
      position: absolute;
      z-index: 1;
      top: 50%;
      left: 63%;
      width: 30%;
      height: 11%;
      background: red;
      border-radius: 0% 30% 30% 100%;
      transform: rotate(10deg);
      background-color: #eaddd4;
    background-image: radial-gradient(ellipse at center, #eaddd4 30%, #cdc1b3 80%);
      box-shadow: -10px 20px 60px rgba(0,0,0,.6),
        inset 0 0 4px 1px rgba(0,0,0,.2),
        inset 0 0 10px 5px #9d8169;
      
    }
  }
  
  &-saucer {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #eaddd4;
    background-image: radial-gradient(ellipse at center, #eaddd4 0%, #cdc1b3 28%, #b0a798, #fff 30%, #c3b7a9 30%, #cdc1b3 80%);
    box-shadow: 
      inset 0 0 10px 5px #b9a896,
      inset 0 0 3px 8px #fff,
      10px 20px 60px rgba(0,0,0,.5);
    
    &:after {
      content: "";
      position: absolute;
      border-radius: 50%;
      left: 50%;
      top: 50%;
      width: 60%;
      height: 60%;
      transform: translate(-50%,-50%);
      box-shadow: 10px 20px 60px rgba(0,0,0,.7);
    }
  }
  
  &-cup {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 60%;
    height: 60%;
    transform: translate(-50%,-50%);
    border-radius: 50%;
    background-color: #b23807;
    background-image: radial-gradient(ellipse at center, #c44b16 0%, #9d3706 80%);
    z-index: 4;
    box-shadow: 
      0 0 1px 1px rgba(0,0,0,.1),
      inset 0 0 10px 6px #9d8169,
      inset 0 0 5px 12px #d7cec9,
      inset 0 0 5px 20px #9d8169,
      inset 0 0 0px 25px #731803,
      inset 0 0 30px 45px #942a02,
      inset 0 0 5px 50px #c3663a,
      10px 10px 20px -5px rgba(0,0,0,.3);
  }
  
  .cream {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 86%;
    height: 86%;
    transform: translate(-50%,-50%) rotate(30deg);
    border-radius: 50%;
    z-index: 2;
    border: 3px solid rgba(0,0,0,.5);
    box-shadow: 
      0 0 0 3px rgba(0,0,0,.4),
      inset 0 0 0 3px rgba(0,0,0,.1);
    overflow: hidden;

    
    &:after {
      content: "";
      position: absolute;
      left: 0;
      top: 0;  
      width: 100%;
      height: 100%;
      border-radius: 50%;
      box-shadow: inset 40px 40px 20px 0 rgba(0,0,0,.4);
    }
    
  }
  
  .coffee {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 60%;
    height: 60%;
    transform: translate(-50%,-50%);
    border-radius: 50%;
    
    &:after {
      content: "";
      border-radius: 50%;
      position: absolute;  
      left: 0;
      top: 0;
      width: 110%;
      height: 110%;
      box-shadow: 2px 2px 0 0 rgba(50,40,32,.5);
      transform: rotate(50deg) translate(-5%);
    }
    
    &:before {
      content: "";
      border-radius: 50%;
      position: absolute;  
      left: 0;
      top: 0;
      width: 120%;
      height: 120%;
      box-shadow: -2px -2px 0 0 rgba(255,255,255,.2),
        inset -4px -4px 0 0 rgba(255,255,255,.1);
      transform: rotate(50deg) translate(-10%);
    }
    
  }
}


.bear {
  div {
    position: absolute;  
  }

  &:after {
    content: "";
    border-radius: 50%;
    position: absolute;  
    left: 0;
    top: 0;
    width: 100%;
    height: 105%;
    box-shadow: 5px 5px 0 0 #d3865c,
    inset -1px 2px 0 2px #d3865c,
    inset -1px 5px 0 2px #8c3200;
    
    transform: rotate(-30deg);
  }
  
  &:before {
    content: "";
    border-radius: 50%;
    position: absolute;  
    left: -5px;
    top: -5px;
    width: 100%;
    height: 100%;
    box-shadow: -5px -5px 0 0 rgba(255,255,255,.2);
    transform: rotate(-30deg);
  }
  
  position: absolute;
  left: 50%;
  top: 50%;
  width: 90%;
  height: 90%;
  transform: translate(-50%,-50%);
  
  .face {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #d3865c;  
    box-shadow: inset -15px -10px 2px -5px rgba(255,255,255,.2);
    
    &:after {
      content: "";
      position: abslute;
      width: 100%;
      height: 100%;
      border-radius: 50%;
      
    }
  }
  
  .eye {
    top: 25%;
    width: 25%;
    height: 35%;
    background-color: rgba(255,255,255,.1);
    border-radius: 50%;
    
    &:after {
      content: "";
      position: absolute;
      left: 50%;
      bottom: 40%;
      width: 40%;
      height: 30%;
      border-radius: 50%;
      background: #480000;
      transform: translateX(-50%);
    }
    
    &:before {
      content: "";
      position: absolute;
      left: 50%;
      top: 30%;
      width: 4px;
      height: 4px;
      border-radius: 50%;
      background: #fff;
      transform: translateX(-50%);
      z-index: 2;
    }
    
    &.left {
      transform: rotate(30deg);
      left: 15%;
    }
    
     &.right {
      transform: rotate(-30deg);
      right: 15%;
    }
  }
  
  .ear {
    top: 7%;
    width: 25%;
    height: 30%;
    background-color: #e3aa8c;
    border-radius: 50%;
    box-shadow: inset 0 0 0 8px #d3865c;
    z-index: -1;
    
    &.left {
      left: -2%;  
    }
    
    &.right {
      right: -2%;  
    }
  
  }
  
  .snout {
    top: 55%;
    left: 50%;
    width: 50%;
    height: 40%;
    border-radius: 45%;
    background-color: #a13707;
    transform: translateX(-50%) perspective(300px) rotateX(-30deg);
    box-shadow: inset -10px -10px 0 0 rgba(0,0,0,.1);

    .nose {
        top: 10%;
        left: 50%;
        width: 50%;  
        height: 40%;
        background: #480000;
        box-shadow: inset 5px 5px 0 0 rgba(0,0,0,.1);
        border-radius: 45% 45% 50% 50%;
        transform: translateX(-50%);
      
      &:after {
        content: "";
        position: absolute;
        left: 0;
        top: 100%;
        width: 1px;
        left: 50%;
        height: 40%;
        background: #470800;
      }
    }
    
    .mouth {
        width: 60%;
        height: 50%;
        background-color: transparent;
        border-bottom: 1px solid #470800;
        border-radius: 50%;
        position: absolute;
        left: 50%;
        bottom: 30%;
        transform: translateX(-50%);
    }
  }
}


h1 {
  margin: 2rem 2rem 0 1.5rem;
  font-size: 80px;
  font-weight: normal;
  line-height: 1;
  
  span {
    display: inline-block;
    position: relative;
    &:after {
      content: "";
      width: 2px;
      background: red;
      height: 80%;
      position: absolute;
      left: 50%;
      bottom: 0;
      transform: translateX(-50%) rotate(-45deg);
    }
   
  }
  
}

h2 {
  margin: .5rem 2rem 1rem 2rem;
  font-size: 18px;
}

p {
  font-family: Helvetica;
  line-height: 1.4;
  font-size: 14px;
  font-weight: 100;
  margin: 0 2rem;
  width: 30%;
}
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console