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.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

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.

HTML

              
                <div class="container" onclick="this.classList.toggle('active')">
  <div class="fill fill1">
    <div class="circle circle1"></div>
  </div>
  <div class="drop">
    <div class="fill fill2">
      <div class="circle circle2"></div>
    </div>
  </div>
</div>
              
            
!

CSS

              
                body {
  align-items: center;
  background-color: #f5f5f5;
  display: flex;
  height: 100vh;
  justify-content: center;
}
.container {
  -webkit-tap-highlight-color: transparent;
  background-color: #000;
  border-radius: 25px;
  box-shadow: 0 2px 20px 10px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  height: 50px;
  overflow: hidden;
  position: relative;
  transform: scale(0.7);
  transition: transform 50ms;
  width: 100px;
}
.container:active {
  transform: scale(0.73);
}
.fill {
  background-color: #000;
  height: 100%;
  position: absolute;
  width: 100%;
}
.fill1 {
  background-color: #fff;
  clip-path: circle(19px at 73px 25px);
}
.fill2 {
  animation: right2 500ms both;
  background-color: #000;
  clip-path: circle(19px at 25px 25px);
}
.circle {
  background: #fff;
  border-radius: 20px;
  height: 38px;
  position: relative;
  top: 6px;
  width: 38px;
}
.circle1 {
  background-color: #000;
  left: 6px;
}
.circle2 {
  animation: right4 500ms both;
  background-color: #fff;
  left: 54px;
}
.drop {
  animation: right2d 500ms both;
  background-color: #fff;
  height: 100%;
  position: absolute;
  width: 100%;
}
.active .fill1 {
  animation: left1 500ms both;
}
.active .fill2 {
  animation: left2 500ms both;
}
.active .circle1 {
  animation: left3 500ms both;
}
.active .circle2 {
  animation: left4 500ms both;
}
.active .drop {
  animation: leftd 500ms both;
}
@keyframes left1 {
  0% {
    clip-path: circle(19px at 73px 25px);
  }
  99% {
    clip-path: circle(74px at 73px 25px);
  }
  100% {
    clip-path: circle(74px at 73px 25px);
  }
}
@keyframes left2 {
  0% {
    clip-path: circle(74px at 25px 25px);
  }
  99% {
    clip-path: circle(19px at 25px 25px);
  }
  100% {
    clip-path: circle(19px at 25px 25px);
  }
}
@keyframes left3 {
  0% {
    left: 14px;
  }
  99% {
    left: 6px;
  }
  100% {
    left: 6px;
  }
}
@keyframes left4 {
  0% {
    left: 54px;
  }
  99% {
    left: 46px;
  }
  100% {
    left: 46px;
  }
}
@keyframes leftd {
  0% {
    opacity: 0;
  }
  99% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}
@keyframes right2 {
  0% {
    clip-path: circle(19px at 25px 25px);
  }
  99% {
    clip-path: circle(74px at 25px 25px);
  }
  100% {
    clip-path: circle(74px at 25px 25px);
  }
}
@keyframes right2d {
  0% {
    opacity: 1;
  }
  99% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
@keyframes right4 {
  0% {
    left: 46px;
  }
  99% {
    left: 54px;
  }
  100% {
    left: 54px;
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console