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.

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

              
                <!--Dribbble Inspiration https://dribbble.com/shots/4337805-Animated-Radio-Kitt-Ornikar-Design-System-->
<div class="checkbox orange">
  <input type="checkbox" id="1" />
  <label for="1">
    <!--<span>Checkbox</span>-->
  </label>
</div>
<div class="checkbox blue">
  <input type="checkbox" id="2" />
  <label for="2">
    <!--<span>Checkbox</span>-->
  </label>
</div>
<div class="checkbox red">
  <input type="checkbox" id="3" />
  <label for="3">
    <!--<span>Checkbox</span>-->
  </label>
</div>
              
            
!

CSS

              
                body {
  margin: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 25px;
  font-family: sans-serif;
  color: rgba(210, 210, 210, 1);
}
.checkbox {
  margin-right: 30px;
}
.checkbox:last-of-type {
  margin-right: 0;
}
.checkbox input {
  display: none;
  vertical-align: center;
}
.checkbox label {
  cursor: pointer;
  vertical-align: middle;
  display: inline-block;
  position: relative;
}
.checkbox label span {
  margin-left: 5px;
}
.checkbox label:before {
  content: "";
  display: inline-block;
  width: 45px;
  height: 45px;
  box-shadow: inset 0px 0px 0px 4px rgba(226, 226, 226, 1);
  border-radius: 50%;
  vertical-align: middle;
  transition: box-shadow cubic-bezier(0.27, 0.92, 0.89, 1.12) 0.2s;
}
.checkbox label:after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  width: 45px;
  height: 30px;
  top: 30px;
  left: 0;
  opacity: 0;
  transition: opacity cubic-bezier(0.27, 0.92, 0.89, 1.12) 0.2s;
}
.checkbox.orange label:after {
  background: radial-gradient(
    rgba(255, 153, 51, 0.9),
    rgba(255, 153, 51, 0.6),
    rgba(255, 153, 51, 0.3),
    rgba(255, 153, 51, 0.05),
    rgba(255, 153, 51, 0)
  );
}
.checkbox.blue label:after {
  background: radial-gradient(
    rgba(41, 162, 232, 0.9),
    rgba(41, 162, 232, 0.6),
    rgba(41, 162, 232, 0.3),
    rgba(41, 162, 232, 0.05),
    rgba(41, 162, 232, 0)
  );
}
.checkbox.red label:after {
  background: radial-gradient(
    rgba(226, 31, 87, 0.9),
    rgba(226, 31, 87, 0.6),
    rgba(226, 31, 87, 0.3),
    rgba(226, 31, 87, 0.05),
    rgba(226, 31, 87, 0)
  );
}
.checkbox input:checked + label:after {
  opacity: 0.7;
}
.checkbox label:active,
.checkbox label:focus {
  transform: scale(0.95);
}
.checkbox input:checked + label {
  animation: checkBounce linear 0.3s;
}
.checkbox input:not(:checked) + label {
  animation: uncheckBounce linear 0.3s;
}
.checkbox input:checked + label:before {
  transition: box-shadow cubic-bezier(0.27, 0.92, 0.89, 1.12) 0.2s;
}
.checkbox.orange input:checked + label:before {
  box-shadow: inset 0px 0px 0px 18px rgba(255, 153, 51, 1);
}
.checkbox.blue input:checked + label:before {
  box-shadow: inset 0px 0px 0px 18px rgba(41, 162, 232, 1);
}
.checkbox.red input:checked + label:before {
  box-shadow: inset 0px 0px 0px 18px rgba(226, 31, 87, 1);
}
.checkbox label:active:before,
.checkbox label:focus:before {
  box-shadow: inset 0px 0px 0px 7px rgba(226, 226, 226, 1);
  transition: box-shadow cubic-bezier(0.27, 0.92, 0.89, 1.12) 0.1s;
}
.checkbox input:before + label:active:before,
.checkbox input:checked + label:focus:before {
  box-shadow: inset 0px 0px 0px 21px rgba(255, 153, 51, 1);
  transition: box-shadow cubic-bezier(0.27, 0.92, 0.89, 1.12) 0.1s;
}
@keyframes checkBounce {
  0% {
    transform: scale(0.95);
  }
  50% {
    transform: scale(1.1);
  }
  75% {
    transform: scale(0.95);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes uncheckBounce {
  0% {
    transform: scale(0.95);
  }
  50% {
    transform: scale(1.1);
  }
  75% {
    transform: scale(0.95);
  }
  100% {
    transform: scale(1);
  }
}

              
            
!

JS

              
                //Just for initial animation
$( ".checkbox input" ).each(function(i){
  var self = this
  setTimeout(function(){
    $(self).prop( "checked", true );
  },i*500);
})
              
            
!
999px

Console