css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              .cake
 - for(var x=1;x<=6;x++)
    .cherry
 .topping
   .top
   .inner
   .drops
   .drop
 .outline
 .cheese
 .floor
 .shadow
h1 My little cherry cheesecake
            
          
!
            
              html {
  box-sizing: border-box;
}

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

html, body {
  min-height: 100%;
  margin: 0;
  padding: 0;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #6f90c3;
  background-image: linear-gradient(#b9d1f5 55%, #6f90c3);
  background-repeat: no-repeat;
  font-family: 'Dancing Script', cursive;
}

.cake {
  width: 20%;
  position: absolute;  
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%);
  &:after {
    content: "";
    display: block;
    margin-top: 100%;
  }
 
}

.cherry {
  background-color: #bd2e2d;
  border-radius: 50%;
  width: 25%;
  position: absolute;
  left: 50%;
  top: 0;
  z-index: 6;
  border: 3px solid #3b0504;
  border-width: 3px 2px 0 2px;
  box-shadow: 
    inset 2px -5px 2px 1px rgba(210,70,80,.8), 
    inset 5px -10px 10px 5px #771616,
    inset 10px -14px 10px 10px #b70909,  
    inset -2px 1px 2px 0 #b70909,
    -5px 3px 1px 0 rgba(0,0,0,.2);
      
  &:after {
    content: "";
    display: block;
    margin-top: 100%;
  }
  
  &:before {
    content: "";
    display: block;
    position: absolute;
    right: 15%;
    top: 5%;
    width: 40%;
    height: 40%;
    background: radial-gradient(circle at center, #fff 0%, transparent 60%);
  }
  
  &:nth-of-type(1) {
    transform: translateX(-50%);
  }
  &:nth-of-type(2) {
    transform: translate(20%,30%);
  }
  &:nth-of-type(3) {
    transform: translate(-110%,30%);
  }
  &:nth-of-type(4) {
    transform: translate(-50%,40%);
  }
  &:nth-of-type(5) {
    transform: translate(5%,80%);
  }
  &:nth-of-type(6) {
    transform: translate(-90%,80%);
  }
}

.topping {
  z-index: 5;
  position: absolute;
  border-radius: 50%;
  background: #ce2625;
  width: 100%;
  height: 50%;
  top: 10%;
  box-shadow: 0 25px 0 0 #a90e0d;
  
  .inner {
    
    &:before {
      content: "";
      z-index: 1;
      position: absolute;
      width: 100%;
      height: 105%;
      background: #bd2e2d;
      background-image: linear-gradient(90deg, transparent 2%, #5f0608 15%, #5f0608 30%, #8e0e0d 50%, transparent 70%);
      top: 25%;
      border-radius: 50%;  
      box-shadow: 0 5px 0 0 #3b0504;
    }
    
    &:after {
      content: "";
      width: 100%;
      height: 32%;
      border: 3px solid #3b0504;
      border-width: 0 3px;
      top: 55%;
      position: absolute;
      z-index: 1;
    }
 
  }
  
  .top {
    z-index: 2;
    position: absolute;
    width: 100%;
    height: 100%;
    background: #ce2625;
    top: 0%;
    border-radius: 50%;
    box-shadow:     
    inset 0 2px 0 2px #3b0504,
    inset -10px -1px 5px 0 rgba(255,255,255,.4),
    inset -5px -2px 0 0 rgba(255,255,255,.8),
    inset 100px -20px 0 0 rgba(0,0,0,.2),
    inset 20px 20px 0 0 rgba(0,0,0,.2),
  }
}

.drops {
  &:before, &:after {
    content: "";
    position: absolute;
    z-index: 10;
    left: -2%;
    top: 85%;
    width: 10%;
    height: 40%;
    background: #bd2e2d;
    transform: rotate(4deg);
    border-radius: 60% 65% 60% 70%;
    box-shadow: inset -1px -5px 0 0 #3b0504,
      inset 2px -5px 0 0 #3b0504,
      inset -10px -25px 5px 0 rgba(0,0,0,.3);  
  }
  
  &:after {
    left: 2%;
    top: 100%;
    width: 8%;
    
  }
}

.drop {
  position: absolute;
  z-index: 10;
  right: 7%;
  top: 100%;
  width: 20%;
  height: 60%;
  background: #bd2e2d;
  border-radius: 40% 45% 60% 70%;
  box-shadow: inset 1px -5px 0 0 #3b0504,
    inset 5px -15px 5px 0 rgba(0,0,0,.3);
  &:before {
    content: "";
    display: block;
    position: absolute;
    right: 15%;
    top: 0%;
    width: 10%;
    height: 80%;
    background: radial-gradient(circle at center, #fff 0%, transparent 60%);
    transform: rotate(-10deg);
  }

}

.cheese {
  z-index: 2;
  position: absolute;
  width: 96%;
  transform: translateX(-50%);
  left: 50%;
  height: 88%;
  background: #fffae7;
  background-image: linear-gradient(90deg, transparent 8%, #c9be95 10%, #c9be95 20%, #a79d78 20%, #a79d78 28%, #c9be95 30%, #c9be95 48%, #e8e3cf 50%, #e8e3cf 70%, transparent 72%, transparent 95%, #c9be95 97%);
  top: 30%;
  border-radius: 100% / 70%; 
  
  &:after {
    content: "";
    position: absolute;
    width: 100%;
    height: 50%;
    background: rgba(0,0,0,.2);
    border-radius: 50%;
    top: 5%;
  }

}
.outline {
  z-index: 3;
  position: absolute;
  width: 96%;
  transform: translateX(-50%);
  left: 50%;
  border: 3px solid #44331a;
  border-width: 0 3px;
  height: 70%;
  top: 38%; 
}

.outline + .outline {
  z-index: 8;
  width: 100%;
  height: 28px;
  border-radius: 1%;
}

.floor {
  z-index: 1;
  background: #ac8f66;
  background-image: linear-gradient(90deg, transparent 8%, #6e593b 10%, #6e593b 30%, #6e593b 48%, #907753 50%, #907753 70%, transparent 72%, transparent 95%, #6e593b 97%);
  border-radius: 50%; 
  width: 96%;
  transform: translateX(-50%);
  left: 50%;
  height: 50%;
  position: absolute;
  top: 78%;
  box-shadow:       
    0 -20px 0 0 #ac8f66,
    0 1px 0 0 #44331a,
    0 2px 0 0 #44331a,
    0 3px 0 0 #44331a,          
    0 4px 0 0 #44331a,
    0 5px 0 0 #44331a,
    0 6px 0 0 #44331a;
  
  &:after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(#44331a 15%, transparent 16%) 0 0,
radial-gradient(#44331a 15%, transparent 16%) 3px 3px,
radial-gradient(rgba(255,255,255,.1) 15%, transparent 20%) 0 1px,
radial-gradient(rgba(255,255,255,.1) 15%, transparent 20%) 4px 5px;
background-size: 15px 10px;
      border-radius: 50%; 

  }
}

.shadow {
  position: absolute;
  width: 96%;
  transform: translateX(-50%);
  height: 50%;
  background: rgba(0,0,0,.5);
  border-radius: 50%;
  top: 80%;
  left: 50%;
  z-index: -1;
  box-shadow: -10px 5px 15px 0 rgba(0,0,0,.4);
}

h1 {
  position: absolute;
  top: 0;
}
            
          
!
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