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 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

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 id="container">
  <div class="input_wrapper">
    <input type="text" placeholder="login" />
  </div>
  <div class="input_wrapper">
    <input type="password" id="password_input" placeholder="password" />
  </div>
  <div class="input_wrapper">
    <div id="blt_wrapper">
      <div id="slider_blt"></div>
    </div>
  </div>
  <div id="instruction">
  slide to reveal password
  </div>
</div>
              
            
!

CSS

              
                body {
  background-color:#cad5df;
  font-family:helvetica;
  color:#333;
  font-size:12px
}
#container {
  position:relative;
  width:650px;
  height:230px;
  margin:50px auto;
}
.input_wrapper {
  margin:20px auto;
  width:200px;
  height:66px;
  border-radius:30px;
  position:relative;
  background: #aabfcd;
  background: -moz-linear-gradient(top,  #aabfcd 0%, #eff3f6 100%);
  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#aabfcd), color-stop(100%,#eff3f6));
  background: -webkit-linear-gradient(top,  #aabfcd 0%,#eff3f6 100%);
  background: -o-linear-gradient(top,  #aabfcd 0%,#eff3f6 100%);
  background: -ms-linear-gradient(top,  #aabfcd 0%,#eff3f6 100%);
  background: linear-gradient(to bottom,  #aabfcd 0%,#eff3f6 100%);
}

#blt_wrapper,input {
  width:184px;
  height:50px;
  position:absolute;
  top:8px;
  left:8px;
  background:#5f9424;
  border-radius:30px;
}
input {
  background:rgba(255,255,255,0.5);
  outline:none;
  border:0;
  padding:3px 10px;
  width:164px;
  height:44px;
}
#slider_blt {
  width:50px;
  height:50px;
  border-radius:50%;
  position:absolute;
  left:0;
  top:0;
  box-shadow:3px 3px 10px #333;
  background: #fffafa;
  background: -moz-linear-gradient(top,  #fffafa 0%, #b4c0c9 100%);
  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fffafa), color-stop(100%,#b4c0c9));
  background: -webkit-linear-gradient(top,  #fffafa 0%,#b4c0c9 100%);
  background: -o-linear-gradient(top,  #fffafa 0%,#b4c0c9 100%);
  background: -ms-linear-gradient(top,  #fffafa 0%,#b4c0c9 100%);
  background: linear-gradient(to bottom,  #fffafa 0%,#b4c0c9 100%);
}
#slider_blt:after {
  content:"";
  position:absolute;
  width:40px;
  height:40px;
  background:#e2e8ec;
  left:5px;
  top:5px;
  border-radius:50%;
}

#instruction {
  background:#333;
  width:170px;
  height:29px;
  position:absolute;
  bottom:0;
  left:0;
  text-align:center;
  padding-top:15px;
  font-size:12px;
  color:#cad5df;
}
#instruction:after {
  content:"";
  position:absolute;
  border-top:22px solid transparent;
  border-right:22px solid transparent;
  border-bottom:22px solid transparent;
  border-left:22px solid #333;
  right:-44px;
  top:0;
}
              
            
!

JS

              
                /*

Rebound of Robert van Klinken, Remote switch 
(http://dribbble.com/shots/506968-Remote-switch).



*/


$(function(){
  $("#slider_blt").draggable({axis: "x",containment:"parent"});
});

$("#slider_blt").on("dragstart",function(){
  $('#instruction').fadeOut('slow');
});

$("#slider_blt").on("dragstop", function(){
  $('#slider_blt').animate({left:'0'},150,'linear');
  $('#password_input').prop('type','password');
});

$("#slider_blt").on("drag", function(){
  if (parseInt($('#slider_blt').css('left'))>130) {
    $('#password_input').prop('type','text');
  }
});
              
            
!
999px

Console