Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

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="lamp">
  <div class="top"></div>
  <div class="center">
    <div class="lava-container">
      <div class="drop"></div>
      <div class="drop"></div>
      <div class="drop"></div>
      <div class="drop"></div>
      <div class="drop"></div>
      <div class="drop"></div>
      <div class="drop"></div>
      <div class="drop"></div>
      <div class="drop"></div>
      <div class="drop"></div>
      <div class="drop"></div>
      <svg xmlns="http://www.w3.org/2000/svg" version="1.1">
        <defs>
          <filter id="goo">
            <feGaussianBlur in="SourceGraphic" 
                            stdDeviation="10" 
                            result="blur" />
            <feColorMatrix in="blur" 
                           mode="matrix" 
                           values="1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 18 -7" 
                           result="goo" />
            <feBlend in="SourceGraphic" in2="goo" />
          </filter>
        </defs>
      </svg>
    </div>
  </div>
  <div class="bottom"></div>
</div>
              
            
!

CSS

              
                :root {
  --height: 400px;
  --drop-color: #3ee02e;
  --lamp-color: #34a4d296;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(50vh 100vh ellipse, #037b03dd, #000 60%);
  overflow: hidden;
}

.lamp {
  height: var(--height);
  width: calc(var(--height) * 0.45);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;

  & .top {
    height: 15%;
    width: 50%;
    background: linear-gradient(
      90deg,
      #bebebe 15%,
      #fdfdfd 30%,
      #bebebe 40%,
      #878787 48% 52%,
      #bebebe 58%,
      #fdfdfd 65% 70%,
      #bebebe 80%
    );
    border-radius: 50% 50% 10% 10% / 15% 15% 3% 3%;
    clip-path: polygon(7% 0%, 93% 0%, 100% 100%, 0% 100%);
  }
  & .center {
    height: 53%;
    width: 70%;
    background: linear-gradient(#0003 10%, #0000 30% 95%, #fff3 100%),
      linear-gradient(90deg, #0000 20%, #fff5 50%, #0000 80%),
      radial-gradient(
          calc(var(--height) * 0.21) calc(var(--height) * 0.48) at center 35%,
          #0000 60%,
          #fff4 90%
        )
        var(--lamp-color);
    position: relative;
    top: -1.5%;
    border-top: calc(var(--height) * 0.006) solid #666;
    border-bottom: calc(var(--height) * 0.006) solid #666;
    border-radius: 50% 50% 50% 50% / 8% 8% 8% 8%;
    clip-path: polygon(16% 0%, 84% 0%, 100% 70%, 86% 100%, 14% 100%, 0 70%);
    overflow: hidden;
    z-index: 1;

    & .lava-container {
      width: 70%;
      height: 120%;
      margin: 0 15%;
      position: relative;
      top: -10%;
      overflow: hidden;
      box-shadow: inset 0 calc(var(--height) * 0.053) 0 var(--drop-color),
        inset 0 calc(var(--height) * -0.053) 0 var(--drop-color);
      filter: url("#goo") drop-shadow(0 0 3px #fff6)
        drop-shadow(0 1px 2px #fff6);
      box-sizing: border-box;
      border-radius: 50% 50% 50% 50% / 3% 3% 1% 1%;

      & .drop {
        height: calc(var(--height) * 0.07);
        width: calc(var(--height) * 0.07);
        border-radius: 50%;
        background: linear-gradient(#0001 10%, #0000 70%, #fff1)
          var(--drop-color);
        position: absolute;
        top: -100%;
        animation: lava-drip 12s linear infinite alternate;
      }

      & .drop:nth-child(2) {
        height: calc(var(--height) * 0.08);
        width: calc(var(--height) * 0.09);
        left: 7%;
        animation-delay: 1s;
      }

      & .drop:nth-child(3) {
        height: calc(var(--height) * 0.08);
        width: calc(var(--height) * 0.06);
        left: 60%;
        animation-delay: 2.2s;
      }

      & .drop:nth-child(4) {
        height: calc(var(--height) * 0.1);
        width: calc(var(--height) * 0.06);
        left: 50%;
        animation-delay: 3s;
      }

      & .drop:nth-child(5) {
        height: calc(var(--height) * 0.07);
        width: calc(var(--height) * 0.05);
        left: 10%;
        animation-delay: 4.2s;
      }

      & .drop:nth-child(6) {
        height: calc(var(--height) * 0.07);
        width: calc(var(--height) * 0.05);
        left: 70%;
        animation-delay: 4.8s;
      }

      & .drop:nth-child(7) {
        height: calc(var(--height) * 0.06);
        width: calc(var(--height) * 0.04);
        left: 40%;
        animation-delay: 5.6s;
      }
      & .drop:nth-child(8) {
        height: calc(var(--height) * 0.09);
        width: calc(var(--height) * 0.07);
        left: 20%;
        animation-delay: 6.2s;
      }

      & .drop:nth-child(9) {
        height: calc(var(--height) * 0.1);
        width: calc(var(--height) * 0.07);
        left: 70%;
        animation-delay: 6.9s;
      }

      & .drop:nth-child(10) {
        height: calc(var(--height) * 0.15);
        width: calc(var(--height) * 0.07);
        left: 60%;
        animation-delay: 9.5s;
      }
    }
  }
  & .bottom {
    height: 33%;
    width: 70%;
    background: linear-gradient(#0000 35%, #ccc7 39%, #666 41% 42%, #0000 45%),
      conic-gradient(
        from 270deg at 50% 120%,
        #666 10deg,
        #bebebe 45deg,
        #fdfdfd 62deg 65deg,
        #bebebe 70deg,
        #555 87deg 93deg,
        #bebebe 105deg,
        #fdfdfd 112deg 120deg,
        #bebebe 145deg,
        #666 175deg 180deg,
        #0000 180deg
      ),
      conic-gradient(
        from 90deg at 50% 20%,
        #666 10deg,
        #bebebe 45deg,
        #fdfdfd 60deg 65deg,
        #bebebe 70deg,
        #555 87deg 93deg,
        #bebebe 105deg,
        #fdfdfd 120deg 125deg,
        #bebebe 145deg,
        #666 175deg 180deg,
        #0000 180deg
      );
    background-size: 100% 100%, 100% 40%, 100% 100%;
    background-repeat: no-repeat;
    position: relative;
    top: -3%;
    border-radius: 18% 18% 50% 50% / 8% 8% 11% 11%;
    clip-path: polygon(
      11% 0,
      89% 0,
      70% 40%,
      95% 90%,
      95% 100%,
      10% 100%,
      5% 90%,
      30% 40%
    );
    box-shadow: inset 0 calc(var(--height) * -0.012) #666;
  }

  &::before {
    content: "";
    height: 100vh;
    width: 100vw;
    position: absolute;
    background: radial-gradient(50vh 30% at 50% 6%, #037b0384, #111 60%) #ddd;
    top: 80%;
  }
}

@keyframes lava-drip {
  0% {
    top: -10%;
  }
  20% {
    top: 10%;
  }
  80% {
    top: 80%;
  }
  100% {
    top: 100%;
  }
}

@media screen and (max-width: 500px) {
  :root {
    --height: 300px;
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console