123

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.

            
              <div class="sliders">
  <div class="row">
    <label for="sl1">Intelligent</label>
    <input class="slider" id="sl1" type="range" min="0" max="100" step="100" value="0" list="numbers">
  </div>
  <div class="row">
    <label for="sl2">Anständig</label>
    <input class="slider" id="sl2" type="range" min="0" max="100" step="100" value="0" list="numbers">
  </div>
  <div class="row">
    <label for="sl3" class="active">Nazi</label>
    <input class="slider" id="sl3" type="range" min="0" max="100" step="100" value="100" list="numbers">
  </div>
  <blockquote class="quote" cite="https://de.wikiquote.org/wiki/Gerhard_Bronner">
    <p>Es gibt drei Dinge, die sich nicht vereinen lassen: <b>Intelligenz</b>, <b>Anständigkeit</b> und <b>Nationalsozialismus</b>.</p>
    <p>Man kann intelligent und Nazi sein. Dann ist man nicht anständig. Man kann anständig und Nazi sein. Dann ist man nicht intelligent. Und man kann anständig und intelligent sein. Dann ist man kein Nazi.</p><footer><cite><a href="https://de.wikiquote.org/wiki/Gerhard_Bronner" target="_blank">Gerhard Bronner</a>, auf der Gedenkfeier zum 60. Jahrestag der Befreiung des KZ Gunskirchen, 7. Mai 2005</cite></footer>
  </blockquote>
</div>
            
          
!
            
              $basefont    : 'Roboto',Arial,sans-serif;
$altfont     : 'Roboto Slab',Georgia, Times, serif;
$base-color  : #456;
$bg-color    : mix($base-color,#000,25);
$action-color: saturate(adjust-hue($base-color,140deg),90);
body {
  background-color: $bg-color;
  color: lighten($base-color,40);
  font-family: $basefont;
  font-size: 1em;
  line-height: 1.5em;
}
a {
  color: $action-color;
  text-decoration: none;
}
.sliders {
  width: 40%;
  min-width: 20em;
  max-width: 30em;
  margin: 3rem auto;
  .row:not(:last-of-type) {
    margin-bottom: 1.5rem;
  }
  label {
    width: 20%;
    display: inline-block;
    font-size: 0.7em;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: $base-color;
    &:hover,
    &:focus,
    &:active,
    &.active {
      color: lighten($base-color,40);
    }
  }
  input[type="range"] {
    width: 75%;
    display: inline-block;
    vertical-align: middle;
    opacity: 0.2;
    &:focus {
      opacity: 1;
    }
  }
  .active + input[type="range"]{
    opacity: 0.5;
  }
}

// flexboxrox
.flexbox {
  .row {
    display: flex;
    flex-flow: row wrap;    
  }
  label {
    flex: 1 1 15%;
  }
  input[type="range"] {
    flex: 2 1 50%;
  }
}

.quote {
  margin: 1rem 0;
  padding: 0;
  font-family: $basefont;
  font-weight: 300;
  b {
    text-transform: uppercase;
    font-weight: normal;
    letter-spacing: 0.07em;
    color: lighten($base-color,10);
  }
  p {
    margin: 0;
  }
  footer {
    font-family: $altfont;
    display: block;
    margin-top: 1rem;
    font-size: 0.75em;
    line-height: 1.5em;
    padding-top: 0.5rem;
    border-top: 1px solid lighten($base-color,10);
  }
  cite {
    font-style: normal;
    a {
      letter-spacing: 0.09em;
    }
  }
  &:before {
    font-family: $altfont;
    content:'„';
    color: $action-color;
    font-size: 6em;
    margin-left: -0.4em;
  }
}
            
          
!
            
              (function() {
  var sl1 = $('#sl1'),
    sl2 = $('#sl2'),
    sl3 = $('#sl3');

  function setSliders(one, two, three) {
    if (one.val() == 0) {
      // 1st is 0
      if (two.val() == 0) {
        // 2nd is 0
        // ok
        if (three.val() == 0) {
          // 3rd is 0
          // nook
          three.val(100);
        }
      }
    } else {
      // 1st slider is 100
      if (two.val() == 0) {
        // 2nd slider is 0
        // ok
      } else {
        // 2nd is 100
        // ok
        if (three.val() == 100) {
          // 3rd is 100
          // nook
          three.val(0);
        }
      }
    }
  }
  $('.slider').change(function() {
    var me = $(this);
    switch (me.attr('id')) {
      case 'sl1':
        setSliders(me, sl2, sl3);
        break;
      case 'sl2':
        setSliders(me, sl1, sl3);
        break;
      case 'sl3':
        setSliders(me, sl1, sl2);
        break;
    }
    /* ------------------------------------
     */
    $('.slider').each(function() {
      var me = $(this),
        label = me.siblings('label');
      if (me.val() == 100) {
        label.addClass('active');
      } else {
        label.removeClass('active');
      }
    });
  });
})();
            
          
!
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.

Console