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

              
                <div class="r001">
  <div class="lock-button">
    <input type="checkbox" class="lock-button__input" id="lock-button--1" />
    <label class="lock-button__label" for="lock-button--1">Secret Settings</label>
  </div>
  
  <div class="checkbox">
    <input type="checkbox" class="checkbox__input" id="exampleCb">
    <label class="checkbox__label" for="exampleCb">Reference Checkbox</label>
  </div>
</div>
              
            
!

CSS

              
                $shadow-1: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
$shadow-2: 0 8px 17px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
$shadow-3: 0 12px 15px 0 rgba(0, 0, 0, 0.24), 0 17px 50px 0 rgba(0, 0, 0, 0.19);
$shadow-4: 0 16px 28px 0 rgba(0, 0, 0, 0.22), 0 25px 55px 0 rgba(0, 0, 0, 0.21);
$shadow-5: 0 27px 24px 0 rgba(0, 0, 0, 0.2), 0 40px 77px 0 rgba(0, 0, 0, 0.22);

body {
  display: flex;
  height: 100vh;
  background-color: #f8f8f8;
  letter-spacing: 0.025em;
}

.r001 {
  margin: auto;
}

.checkbox {
  display: block;
  margin: 15px 0;
  
  &__input {
    margin-right: 5px;
  }
  
  &__input:disabled + &__label {
    opacity: 0.5;
  }
}

.lock-button {
	display: inline-block;
  position: relative;
  user-select: none;

	&__input {
		opacity: 0;
		position: absolute;
		z-index: -1;
	}

  &__label {
    color: white;
    display: inline-block;
    background-color: #37474F;
    padding: 10px 15px;
    cursor: pointer;
    min-width: 300px;
    text-align: center;
    text-transform: uppercase;
    box-shadow: $shadow-1;
    border-radius: 2px;
    
    &:hover {
      background-color: #263238;
      box-shadow: $shadow-2;
    }
  }

	&__input:checked + &__label {
  	background-color: #00838F;
	}

	&__input:focus + &__label {
		outline: #80DEEA auto 5px;
	}
}

              
            
!

JS

              
                /*
 * DUNCKELFELD Code Riddle #001 
 *
 * 1. Given the settings array below,
 *    construct a checkbox for each item.
 * 2. The unlock button should display
 *    "UNLOCK SECRET SETTINGS" in locked state
 *    and
 *    "LOCK SECRET SETTINGS" in unlocked state.
 * 3. In locked state all generated
 *    checkboxes should be disabled and vice versa.
 *
 * Use whatever technology you think is the
 * most effective.
 * (as long as it runs inside a pen)
 *
 * Try to solve task 2 in HTML and CSS only.
 * Beware that the CSS code should not contain
 * strings that might need to be localized later.
 * 
 * Bonus: Show some love and add some
 * cool animations to the mix.
 */

var settings = [
  {
    name: "cpu-power-mode",
    label: "CPU power mode"
  },
  {
    name: "Overclock-gpu",
    label: "Overclock GPU",
    checked: true
  },
  {
    name: "faster-harddisk",
    label: "Spin harddisk faster"
  }
]
              
            
!
999px

Console