cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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

Looking for quick-add? Try the external resource search, it's quicker and gives you access to the most recent version of thousands of libraries. ☝️

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

Looking for quick-add? Try the external resource search, it's quicker and gives you access to the most recent version of thousands of libraries. ☝️

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.

            
              main(class="conveyer")
  section(class="form")

    form(class="form__card is-active")
      label(class="form__label") E-mail address
      input(class="form__input--text", type="email")
      input(type="button", value="next", class="form__button js-next-form")

    form(class="form__card")
      label(class="form__label") Phone number
      input(class="form__input--text", type="tel")
      input(type="button", value="next", class="form__button js-next-form")

    form(class="form__card")
      h3(class="form__heading") Confirm your information
      p(class="form__paragraph") Your phone number is #[strong 555.555.4281].
      p(class="form__paragraph") Your email address is #[strong firstname.lastname@gmail.com].
      input(type="button", value="submit", class="form__button form__button--secondary js-next-form")
      
    form(class="form__card")
      h3(class="form__heading") Success!
      i(class="form__icon fa fa-check-circle-o", aria-hidden="true")
      p(class="form__paragraph") You have successfully shared your personal data with a corporation.
            
          
!
            
              //== Web Fonts ==//
@import 'https://fonts.googleapis.com/css?family=Nunito:400,700|Work+Sans:400,600';

//== Mixins ==//
@import 'bourbon';

//== Vars ==//
$color--lighter:    #FFFFFF;
$color--light:      #AEAEAE;
$color--dark:       #2D3E50;
$color--primary:    #E64C66;
$color--secondary:  #1BBC9B;

$font-stack--primary: 'Work Sans', sans-serif;
$font-stack--secondary: 'Nunito', sans-serif;

$spacing--sm: 1rem;
$spacing--md: 2rem;
$spacing--lg: 4rem;

$anim--dur:     0.6s;
$anim--easing:  ease-in-out;

//== Styles ==//

* {
  box-sizing: border-box;
}

body {
  font-family: $font-stack--primary;
  font-size: 62.5%;
  background: $color--light;
}

.conveyer {
  padding: $spacing--lg;
}

.form {
  @include display(flex);
  @include justify-content(center);
  @include size(100%);
  position: relative;
  top: 0;
  left: 0;
  font-size: 1.1rem;
  text-align: center;
  color: $color--dark;
  
  input,
  .form__button {
    width: 50%;
    margin-left: auto;
    margin-right: auto;
  }
}

.form__card {
  @include display(flex);
  @include flex-direction(column);
  position: absolute;
  top: 0;
  width: 100%;
  max-width: 700px;
  background: $color--lighter;
  box-shadow: 0 $spacing--sm $spacing--md -1.5rem darken($color__light, 50%);
  border-radius: ($spacing--sm / 2) ($spacing--sm / 2) 0 0;
  padding: $spacing--lg;
  margin-bottom: $spacing--md;
  border-bottom: $spacing--sm solid darken($color__lighter, 10%);
  visibility: hidden;
  
  &.is-active {
    visibility: visible;
    animation: fadeInUp $anim--dur $anim--easing forwards;
  }
}

.form__label {
  font-family: $font-stack--secondary;
  font-weight: 700;
  margin-bottom: $spacing--sm;
}

.form__heading {
  font-family: $font-stack--secondary;
  font-weight: 700;
  font-size: 1.3rem;
  margin-bottom: $spacing--sm * 1.5;
}

.form__paragraph {
  margin-bottom: $spacing--sm;
  line-height: 160%;
  
  &:last-of-type {
    margin-bottom: $spacing--md;
  }
  
  strong {
    font-weight: 700;
  }
}

.form__input--text {
  font-size: .9rem;
  color: $color--dark;
  margin-bottom: $spacing--sm;
  padding: $spacing--sm / 2 ;
}

.form__button {
  font-size: .85rem;
  letter-spacing: 0.1rem;
  text-transform: uppercase;
  padding: $spacing--sm / 2;
  color: $color--lighter;
  background: $color--primary;
  text-shadow: 0 1px 1px rgba(0,0,0,0.2);
  border: ($spacing--sm / 8) solid scale-color($color--primary, $lightness: -15%);
  border-radius: $spacing--sm;
  transition: background $anim--dur $anim--easing;
  
  &:hover {
    cursor: pointer;
    background: scale-color($color--primary, $lightness: -15%);
  }
  
  &:focus {
    outline: 2px solid scale-color($color--primary, $lightness: 50%);
  }
}

.form__button--secondary {
  background: $color--secondary;
  border: ($spacing--sm / 8) solid scale-color($color--secondary, $lightness: -15%);
  
  &:hover {
    background: scale-color($color--secondary, $lightness: -15%);
  }
}

.form__icon {
  color: $color--secondary;
  font-size: 3rem;
  margin-bottom: $spacing--sm;
}

//== Keyframes & Animation ==//

@keyframes fadeInUp {
  // transform: translateZ is used to take advantage of the GPU
  0% {
    opacity: 0;
    transform: translateY(3%) translateZ(0);
  }
  60% {
    transform: translateY(-1%) translateZ(0);
  }
  100% {
    opacity: 1;
    transform: translateY(0%) translateZ(0);
  }
}

@keyframes bounceOut {
  0% {
    transform: scale(0.95);
  }
  40% {
    transform: scale(1.03);
  }
  100% {
    transform: scale(1.0);
  }
}

            
          
!
            
              var progressForms = {

  init: function() {
    this.cacheDom();
    this.bindEvents();
  },
  cacheDom: function() {
    this.$form = $('.form');
    this.$formCard = $('.form__card');
    this.$nextFormBtn = this.$formCard.find('.js-next-form');
    this.fadeOutClassname = 'u-anim--fade-out';
  },
  animateForms: function($thisElem) {
    var $thisCard = $thisElem.parent();
    $thisCard.next().addClass('is-active');
    $thisCard.removeClass('is-active');
  },
  bindEvents: function() {
    this.$nextFormBtn.click(function() {
      progressForms.animateForms($(this));
    });
  }

};

progressForms.init();

            
          
!
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.
Loading ..................

Console