Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

Auto Save

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="wrapper">
  <div class="login is-active">
    <div class="profile"><i class="fa fa-camera fa-2x"></i></div>
    <div class="form-element">
      <span><i class="fa fa-envelope"></i></span><input type="email" placeholder="Your Email Address"/>
    </div>
    <div class="form-element">
      <span><i class="fa fa-lock"></i></span><input type="password" placeholder=" Password"/>
    </div>
    <button class="btn-login">login</button>
  </div>
  
  <div class="register down">
    <div class="form-element">
      <span><i class="fa fa-user"></i></span><input type="text" placeholder="Full Name"/>
    </div>
    <div class="form-element">
      <span><i class="fa fa-envelope"></i></span><input type="email" placeholder="Your Email Address"/>
    </div>
    <div class="form-element">
      <span><i class="fa fa-lock"></i></span><input type="password" placeholder="Password"/>
    </div>
    <div class="form-element">
      <span><i class="fa fa-lock"></i></span><input type="password" placeholder="Re-Enter Password"/>
    </div>
    <button class="btn-register">register</button>
  </div>
  
  <div class="login-view-toggle">
    <div class="sign-up-toggle is-active">Don't have an account? <a href="#">Sign Up</a></div>
    <div class="login-toggle">Already have an account? <a href="#">Login</a></div>
  </div>
</div>

              
            
!

CSS

              
                $white: rgba(255,255,255,0.8)

@import 'https://fonts.googleapis.com/css?family=Fira+Sans'

*
  box-sizing: border-box

a
  text-decoration: none

html,body
  height: 100%
  width: 100%
    
body
  font-family: 'Fira Sans', sans-serif
  background:
    image: url(http://static.boredpanda.com/blog/wp-content/uploads/2015/04/night-sky-stars-milky-way-photography-22__880.jpg)
    size: cover
    position: left tom
    repeat: no-repeat
    
  &:after
    content: ''
    display: block
    position: absolute
    width: 100%
    height: 100%
    background-color: rgba(0,0,0,0.58)
    top: 0
    left: 0
    z-index: 1
    
.wrapper
  max-width: 300px
  background-color: transparent
  height: 100%
  margin: 0 auto
  position: relative
  z-index: 2
  overflow: hidden
  
  /*****************************************************/
  /********************* LOGIN FORM ********************/
  /*****************************************************/
  
  .login,.register
    padding-top: 50px
    width: 100%
  
    .profile
      height: 100px
      width: 100px
      background: rgba(255,255,255,0.1)
      border-radius: 100%
      margin: 0 auto
      margin-bottom: 60px
      position: relative
      
      i
        color: $white
        position: absolute
        top: 50%
        left: 50%
        transform: translate(-50%,-50%)
     
    .form-element
      width: 100%
      position: relative
      border-bottom: 2px solid $white
      
      span
        display: inline-block
        width: 20%
        color: $white
        
      input
        font-family: 'Fira Sans', sans-serif
        display: inline-block
        width: 80%
        margin: 20px 0 0 0
        padding: 10px 10px 10px 20px
        background: transparent
        outline: none
        border: none
        color: $white
        &::placeholder
          color: $white
          font-size: 1em
          font-weight: 500
      
    button
      position: relative
      margin: 30px 0
      width: 100%
      padding: 10px
      outline: none
      border: none
      border-radius: 25px
      text-transform: uppercase
      background: #D32F2F
      color: $white
      font-weight: 800
      cursor: pointer
      
      
.login-view-toggle
  color: $white
  width: 100%
  text-align: center
  position: absolute
  top: calc(100vh - 30px)
  a
    color: white
    
  .sign-up-toggle,.login-toggle
    display: none 
    &.is-active
      display: block
      animation: fade-in 600ms ease-in-out forwards
    
  &.move-top
    animation: move-top 1000ms ease-in-out forwards
  &.move-bottom
    animation: move-bottom 1000ms ease-in-out forwards

    
.login,.register
  opacity: 0
  pointer-events: none
  &.is-active
    opacity: 1
    pointer-events: auto  


.login
  &.up
    .form-element
      top: -200px
      opacity: 0
    .profile,button
      transform: scale(0)
    button 
      opacity: 0
  &.push-down
    .form-element,button
      top: 0px
      opacity: 1
    .profile,button
      transform: scale(1)
    button
      opacity: 1
    @for $i from 2 through 3
      .form-element:nth-child(#{$i})
        transition: all 600ms ease-in-out ((600ms * (3 - $i)) + 1400ms)
  button
    transition: all 600ms ease-in-out 1000ms
  .profile
    transition: transform 600ms ease-in-out 2500ms
    
    
.register
  position: absolute
  top: 50px
  left: 0
  &.down
    .form-element
      top: 200px
      opacity: 0
    button
      transform: scale(0)
      opacity: 0
  &.pull-up
    .form-element
      top: 0px
      opacity: 1
    button
      transform: scale(1)
      opacity: 1
    @for $i from 1 through 4
      .form-element:nth-child(#{$i})
        transition: all 600ms ease-in-out (300ms * $i + 700ms)
  button
    transition: all 600ms ease-in-out 2200ms
    
@media screen and (max-width: 480px)
  .wrapper
    .login
      .profile
        height: 80px
        width: 80px
        margin-bottom: 40px
        
        
@keyframes fade-in
  0%
    opacity: 0
  100%
    opacity: 1
  
@keyframes move-top
  0%
    top: calc(100vh - 30px)
  100%
    top: 20px
  
@keyframes move-bottom
  0%
    top: 20px
  100%
    top: calc(100vh - 30px)
  
  
        
        
          
      
      
      
        
      
        
              
            
!

JS

              
                $(function(){
  
  function toggleView(){
    $('.login').toggleClass('is-active');
    $('.register').toggleClass('is-active');
    $('.sign-up-toggle').toggleClass('is-active');
    $('.login-toggle').toggleClass('is-active');
  }
  
  function slideElements(prop){
    $(prop.showEle).removeClass(prop.removeShowClass);
    $(prop.showEle).addClass(prop.addShowClass);
    $(prop.hideEle).removeClass(prop.removeHideClass);
    $(prop.hideEle).addClass(prop.addHideClass);
  }
  
  $('.sign-up-toggle a').on('click',function(){
    toggleView();
    $('.login-view-toggle').addClass('move-top');
    $('.login-view-toggle').removeClass('move-bottom');
    slideElements({
      showEle: '.register',
      removeShowClass: 'down',
      addShowClass: 'pull-up',
      hideEle: '.login',
      addHideClass: 'up',
      removeHideClass: 'push-down'
    });
  });
  
  $('.login-toggle a').on('click',function(){
    toggleView();
    $('.login-view-toggle').addClass('move-bottom');
    $('.login-view-toggle').removeClass('move-top');
    slideElements({
      showEle: '.login',
      removeShowClass: 'up',
      addShowClass: 'push-down',
      hideEle: '.register',
      addHideClass: 'down',
      removeHideClass: 'pull-up'
    });
  });
  
});
              
            
!
999px

Console