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.

            
              h1 Custom multi step form
h2 ⚡️ ⚡️ ⚡️
  


form

  div.block#intro
    h3 Learning is cool.
    p Lorem Khaled Ipsum is a major key to success. Bless up. Mogul talk. Find peace, life is like a water fall, you’ve gotta flow.
    a(href="http://khaledipsum.com/" target="blank") <i class="fa fa-hand-o-right"></i> www.khaledipsum.com 
    
  
  div.block#sexe
    h4 1 &mdash; Surround yourself with angels
    p Positive energy, beautiful people, beautiful souls.
    fieldset
      div.row.choice
        label.row-col-half
          i.fa.fa-male
          input(type="radio", name="gender", value="female")
          span Male
        label.row-col-half
          i.fa.fa-female
          input(type="radio", name="gender", value="female")
          span Female
    p.info <i class="fa fa-info"></i> No discrimination intended for not allowing other genders than male/female. Just keepin' it simple 🙅
    
  
  div.block#user
    h4 2 &mdash; You a genius. Bless up
    p The key to more success is to get a massage once a week, very important, major key.
    fieldset
      i.fa.fa-child
      div.row
        input(type="text", placeholder="First Name", class="row-col-half", required)
        input(type="text", placeholder="Last Name", class="row-col-half", required)
    div.divider
    fieldset
      i.fa.fa-rocket
      input(type="mail", placeholder="Email address", class="row", required)
      
      
  div.block#date
    h4 3 &mdash; The first of the month is coming
    fieldset
      i.fa.fa-calendar-o
      input(type="date", placeholder="Birthdate", class="row")
    p.info <i class="fa fa-info"></i> They will try to close the door on you, just open it. To succeed you must believe. When you believe, you will succeed.
    
    
  div.block#country
    h4 4 &mdash; Cocoa butter is the key
    p.info <i class="fa fa-hand-spock-o"></i> Choose wisely :
    div.divider
    fieldset
      div.row.choice
        label.row-col-one-third
          i.fa.fa-tag
          input(type="radio", name="gender", value="female")
          span Belgium
        label.row-col-one-third
          i.fa.fa-tag
          input(type="radio", name="gender", value="female")
          span France
        label.row-col-one-third
          i.fa.fa-tag
          input(type="radio", name="gender", value="female")
          span Italy
        label.row-col-half
          i.fa.fa-tag
          input(type="radio", name="gender", value="female")
          span Germany
        label.row-col-half
          i.fa.fa-tag
          input(type="radio", name="gender", value="female")
          span Luxemburg
        label.row-col-two-third
          i.fa.fa-tag
          input(type="radio", name="gender", value="female")
          span The Netherlands
    
  
  div.block#address
    h4 5 &mdash; Cocoa butter is the key  
    fieldset
      i.fa.fa-map-signs
      div.row
        input(type="text", placeholder="Adress", class="row-col-two-third", required)
        input(type="number", placeholder="Postcode", class="row-col-one-third", required)
    fieldset
      i.fa.fa-map
      input(type="text", placeholder="State", class="row", required)
    div.divider
    p.info <i class="fa fa-hand-lizard-o"></i> I’m never giving up, I’m just getting started.
    
        
  div.block#else
    h4 6 &mdash; Mogul talk
    p Cloth talk. It’s on you how you want to live your life.
    div.divider
    fieldset
      i.fa.fa-pencil
      textarea(placeholder="You see that bamboo ?", class="row")
  
      
      
  
            
          
!
            
              @import url(https://fonts.googleapis.com/css?family=Archivo+Narrow:400,700)
$bg: hsl(25, 70, 55)

body
  overflow-x: hidden
  background: $bg
  font-family: sans-serif
h1, h2
  position: absolute
  left: 50%
  transform: translateX(-50%)
  color: hsl(0, 0, 100)
  font-weight: bold
  text-transform: uppercase
  letter-spacing: 2px
h1
  top: 24px
  font-size: 12px
h2
  top: 44px
  font-size: 10px
  text-align: center
  line-height: 16px
  opacity: 0.7
  a
    color: hsl(0, 0, 100)
    text-decoration: none
    text-align: center
    border-bottom: 1px dotted hsl(0, 0, 100)
    
   
//
// Form
//
form
  position: absolute
  width: 340px
  height: 260px
  top: 50%
  left: 50%
  transform: translate(-50%, -50%)
  font-family: 'Archivo Narrow', sans-serif

  
// Buttons (next/prev)
.btn
  position: absolute
  box-sizing: border-box
  bottom: 0
  padding: 6px 18px
  border-radius: 20px
  cursor: pointer
  border: none
  outline: none
  font-size: 12px
  letter-spacing: 2px
  transform: translateY(50%)
  transition: all 0.1s ease-in-out
  -webkit-user-select: none
  -moz-user-select: none
.btn#next
  right: 15px
  background: darken($bg, 20%)
  color: hsl(0, 0, 100)
.btn#prev
  right: 105px
  background: hsl(0, 0, 96)
  color: darken($bg, 20%)

  
// Form section
.block
  position: absolute
  box-sizing: border-box
  width: 100%
  height: 100%
  padding: 15px
  background: hsl(0, 0, 100)
  border-radius: 2px
  box-shadow: 0 5px 10px darken($bg, 5%)
  transition: all 0.3s ease-in-out
.block.empty
  z-index: 99
  opacity: 0
  transform: scale(0.6) translateX(130%)
.block.filled
  z-index: 98
  opacity: 0
  transform: scale(0) translateX(0)
.block.current
  z-index: 100
  opacity: 1
  transform: scale(1) translateX(0)
  transition-delay: 0.1s
.mandatory::after
  content: 'Mandatory fields'
  position: absolute
  bottom: 5px
  left: 0
  transform-origin: 0 100%
  transform: translateX(2px) rotate(-90deg)
  color: lighten($bg, 10%)
  font-size: 26px
  text-align: center
  text-shadow: 2px -2px 4px darken($bg, 5%)
  letter-spacing: 1px
  
// Fieldsets (each row of form item)
fieldset
  float: left
  width: 100%
  min-height: 50px
  margin: 5px 0 10px
  i
    display: block
    box-sizing: border-box
    float: left
    width: 15%
    height: 40px
    padding-top: 13px
    color: lighten($bg, 10%)
    text-align: center
    
  // Rows with 2/3 fields
  .row
    display: flex
    flex-wrap: wrap
    &-col-half
      width: 50%
    &-col-one-third
      width: 33.3%
    &-col-two-third
      width: 66.6%
  
  // Selection of items (radio buttons)
  .choice label
    position: relative
    cursor: pointer
    i
      display: inline-block
      width: 50px
      height: 50px
      padding-top: 15px
    input[type="radio"]
      position: absolute
      top: 0
      left: 0
      width: 50px
      margin: 0
      padding: 0
      opacity: 0
      cursor: pointer
    input[type="radio"]:checked + span
      color: hsl(0, 0, 45)
    span
      display: inline-block
      padding-top: 14px
  
  // Basic style UI
  input, textarea
    box-sizing: border-box
    width: 85%
    background: none
    border: none
    outline: none
    color: hsl(0, 0, 45)
    font-family: 'Archivo Narrow', sans-serif
    font-size: 16px
  label
    color: hsl(0, 0, 65)
    font-size: 16px
  input
    height: 50px
    &:required:invalid
      border-bottom: 2px solid $bg
    &:required:valid
      border-bottom: 2px solid hsl(0, 0, 85)
  textarea
    height: 150px
    resize: none
    padding-top: 8px
    line-height: 24px
    
// Send button
#send
  position: absolute
  bottom: 0
  right: 25px
  width: 60px
  height: 60px
  transform: translateY(50%)
  background: darken($bg, 20%)
  border-radius: 50%
  input[type="submit"], i
    position: absolute
    box-sizing: border-box
    width: 100%
    height: 100%
    top: 0
    left: 0
    cursor: pointer
  input[type="submit"]
    background: none
    border-radius: 50%
    opacity: 0
  i
    padding-top: 18px
    color: hsl(0, 0, 100)
    font-size: 24px
    text-align: center
fieldset:nth-of-type(odd)
  background: hsl(0, 0, 96)
  
  
// General styles
h3, h4
  margin-bottom: 12px
  color: darken($bg, 2%)
h3
  font-size: 36px
h4
  font-size: 18px
p
  color: hsl(0, 0, 45)
  line-height: 24px
p.info
  color: hsl(0, 0, 65)
  font-size: 14px
  text-align: justify
  i
    margin-right: 8px
a
  display: inline-block
  margin-top: 12px
  color: hsl(0, 0, 65)
  text-decoration: none
  i
    margin-right: 8px
.divider
  float: left
  width: 100%
  height: 1px
  margin: 5px 0
  border-bottom: 2px dotted hsl(0, 0, 85)

  

            
          
!
            
              
// Create next/prev buttons & Add setup classes
$('.block:first')
  .addClass('current first')
  .append('<span class="btn" id="next">Lets go !</span>');
$('.block:last')
  .addClass('empty last')
  .append('<span class="btn" id="prev">prev</span>')
  .append('<div id="send"><i class="fa fa-rocket"></i><input type="submit" value="send"></div>');
$('.block').not(':first, :last')
  .addClass('empty')
  .append('<span class="btn" id="next">next <i class="fa fa-hand-o-right"></i></span>')
  .append('<span class="btn" id="prev">prev</span>');

// Next/prev function
$('.btn').click( function() {
  var dir = event.target.id;
  var current = $('.current'),
      next = $('.current').next('div'),
      prev = $('.current').prev('div');
    
  if (dir == 'next') {
    current.removeClass('current').addClass('filled');
    next.removeClass('empty').addClass('current');
  }
  if (dir == 'prev') {
    current.removeClass('current').addClass('empty');
    prev.removeClass('filled').addClass('current');
  }
});

// Add mandatory class
$(':input[required]').closest('.block').addClass('mandatory');

            
          
!
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