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 CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

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.

            
              <div class="container">
  <button type="submit"><strong>Submit <i class="fa fa-paper-plane" aria-hidden="true"></i></strong><span class="bar"><span class="load"></span><span></button>
</div>
            
          
!
            
              @import url('https://fonts.googleapis.com/css?family=Oswald:400,600');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  width: 100%;
  height: 100vh;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  background-color: #ccffdc;
  overflow: hidden;
}

.container {
  position: relative;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack:center;
      -ms-flex-pack:center;
          justify-content:center;
  width:300px;
  height: 300px;
}

button {
  position: relative;
  width: 200px;
  height: 70px;
  border: none;
  border-radius: 5px;
  font-size: 1.5em;
  background-color:#ff6600;
  color: #fff;
  padding: 0 10px;
  font-family: 'Oswald', sans-serif;
  outline: 0;
}
button:hover {
  cursor: pointer;
  -webkit-animation: moveButton 0.4s ease forwards;
          animation: moveButton 0.4s ease forwards;
}
.bar ,
.load {
  position: absolute;
  bottom: 10%;
  left: 0%;
  width: 95%;
  height: 5px;
  background-color: #b34700;
  border-radius: 20px;
  opacity: 0;
  box-sizing: border-box;
  margin: 0 4.5px;
}

.load {
  background-color: #fff;
  z-index: 1;
  width: 0%;
}

button:active {
  outline: 0;
}

button:hover .bar {
  opacity: 1;
  -webkit-transition: all 0.2s ease;
  transition: all 0.2s ease;
}
button:hover > strong > i {
  -webkit-animation: tremble 0.5s 0.4s ease;
          animation: tremble 0.5s 0.4s ease;
}
button:hover .load {
  opacity: 1;
  -webkit-transition: all 0.5s ease;
  transition: all 0.5s ease;
}

.loading {
  position: absolute;
  top: 0px;
  left: -5px;
  width: 100%;
  opacity: 1;
  -webkit-transition: all 5s 0.1s linear;
  transition: all 5s 0.1s linear;
}

button.complete {
  background-color: #4EBA4E;
  -webkit-transition: all 0.5s ease-in-out;
  transition: all 0.5s ease-in-out;
}
button.complete .bar,
button.complete strong,
button.complete .load {
  opacity: 0;
}
button.complete:before {
  content: '\f00c';
  font-family: 'fontawesome';
  -webkit-transition: all 0.5s ease;
  transition: all 0.5s ease;
  font-weight: 600;
  position: absolute;
  left: 50%;
  -webkit-transform: translateX(-50%) scale(1.2);
          transform: translateX(-50%) scale(1.2);
  color: #fff;
  font-size: 1.5em;
  opacity: 0;
  -webkit-animation: appear 0.5s 0.2s ease-in-out forwards;
          animation: appear 0.5s 0.2s ease-in-out forwards;
}

@-webkit-keyframes appear {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes appear {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@-webkit-keyframes tremble {
  0% {
    -webkit-transform: rotate(0deg);
            transform: rotate(0deg);
  }
  25% {
    -webkit-transform: rotate(-10deg);
            transform: rotate(-10deg);
  }
  50% {
    -webkit-transform: rotate(0deg);
            transform: rotate(0deg);
  }
  75% {
    -webkit-transform: rotate(10deg);
            transform: rotate(10deg);
  }
  100% {
    -webkit-transform: rotate(0deg);
            transform: rotate(0deg);
  }
}

@-webkit-keyframes tremble-end {
  0% {
    -webkit-transform: rotate(0deg) translateX(-50%);
            transform: rotate(0deg) translateX(-50%);
  }
  25% {
    -webkit-transform: rotate(-10deg) translateX(-50%);
            transform: rotate(-10deg) translateX(-50%);
  }
  50% {
    -webkit-transform: rotate(0deg) translateX(-50%);
            transform: rotate(0deg) translateX(-50%);
  }
  75% {
    -webkit-transform: rotate(10deg) translateX(-50%);
            transform: rotate(10deg) translateX(-50%);
  }
  100% {
    -webkit-transform: rotate(0deg) translateX(-50%);
            transform: rotate(0deg) translateX(-50%);
  }
}

@keyframes tremble {
  0% {
    -webkit-transform: rotate(0deg);
            transform: rotate(0deg);
  }
  25% {
    -webkit-transform: rotate(-10deg);
            transform: rotate(-10deg);
  }
  50% {
    -webkit-transform: rotate(0deg);
            transform: rotate(0deg);
  }
  75% {
    -webkit-transform: rotate(10deg);
            transform: rotate(10deg);
  }
  100% {
    -webkit-transform: rotate(0deg);
            transform: rotate(0deg);
  }
}

@-webkit-keyframes moveButton {
  0% {
    width: 200px;
    -webkit-transform: skew(0deg);
            transform: skew(0deg);
    border-radius: 5px;
  }
  10% {
    -webkit-transform: translateY(-12px) skew(-10deg);
            transform: translateY(-12px) skew(-10deg);
    border-top-left-radius: 10px;
    border-bottom-right-radius: 10px;
  }
  15% {
    -webkit-transform: translateY(-7px) skew(10deg);
            transform: translateY(-7px) skew(10deg);
    border-top-left-radius: 10px;
    border-bottom-right-radius: 10px;
  }
  20% {
    -webkit-transform: translateY(-2px) skew(-15deg);
            transform: translateY(-2px) skew(-15deg);
    border-top-left-radius: 15px;
    border-bottom-right-radius: 15px;
  }
  30% {
    -webkit-transform: translateY(0px) skew(15deg);
            transform: translateY(0px) skew(15deg);
    border-top-left-radius: 15px;
    border-bottom-right-radius: 15px;
  }
  40% {
    -webkit-transform: skew(-20deg);
            transform: skew(-20deg);
    width: 210px;
    border-top-left-radius: 20px;
    border-bottom-right-radius: 20px;
  }
  50% {
    -webkit-transform: skew(20deg);
            transform: skew(20deg);
    width: 210px;
    border-top-left-radius: 20px;
    border-bottom-right-radius: 20px;
  }
  60% {
    -webkit-transform: skew(-15deg);
            transform: skew(-15deg);
    width: 200px;
    border-top-right-radius: 20px;
    border-bottom-left-radius: 20px;
  }
  70% {
    -webkit-transform: skew(15deg);
            transform: skew(15deg);
    width: 200px;
    border-top-right-radius: 20px;
    border-bottom-left-radius: 20px;
  }
  80% {
    -webkit-transform: skew(-10deg);
            transform: skew(-10deg);
    width: 200px;
    border-top-right-radius: 15px;
    border-bottom-left-radius: 15px;
  }
  90% {
    -webkit-transform: skew(5deg);
            transform: skew(5deg);
    width: 200px;
    border-top-right-radius: 10px;
    border-bottom-left-radius: 10px;
  }
  100% {
    -webkit-transform: skew(0deg);
            transform: skew(0deg);
    width: 200px;
    border-radius: 5px;
  }
}

@keyframes moveButton {
  0% {
    width: 200px;
    -webkit-transform: skew(0deg);
            transform: skew(0deg);
    border-radius: 5px;
  }
  10% {
    -webkit-transform: translateY(-12px) skew(-10deg);
            transform: translateY(-12px) skew(-10deg);
    border-top-left-radius: 10px;
    border-bottom-right-radius: 10px;
  }
  15% {
    -webkit-transform: translateY(-7px) skew(10deg);
            transform: translateY(-7px) skew(10deg);
    border-top-left-radius: 10px;
    border-bottom-right-radius: 10px;
  }
  20% {
    -webkit-transform: translateY(-2px) skew(-15deg);
            transform: translateY(-2px) skew(-15deg);
    border-top-left-radius: 15px;
    border-bottom-right-radius: 15px;
  }
  30% {
    -webkit-transform: translateY(0px) skew(15deg);
            transform: translateY(0px) skew(15deg);
    border-top-left-radius: 15px;
    border-bottom-right-radius: 15px;
  }
  40% {
    -webkit-transform: skew(-20deg);
            transform: skew(-20deg);
    width: 210px;
    border-top-left-radius: 20px;
    border-bottom-right-radius: 20px;
  }
  50% {
    -webkit-transform: skew(20deg);
            transform: skew(20deg);
    width: 210px;
    border-top-left-radius: 20px;
    border-bottom-right-radius: 20px;
  }
  60% {
    -webkit-transform: skew(-15deg);
            transform: skew(-15deg);
    width: 200px;
    border-top-right-radius: 20px;
    border-bottom-left-radius: 20px;
  }
  70% {
    -webkit-transform: skew(15deg);
            transform: skew(15deg);
    width: 200px;
    border-top-right-radius: 20px;
    border-bottom-left-radius: 20px;
  }
  80% {
    -webkit-transform: skew(-10deg);
            transform: skew(-10deg);
    width: 200px;
    border-top-right-radius: 15px;
    border-bottom-left-radius: 15px;
  }
  90% {
    -webkit-transform: skew(5deg);
            transform: skew(5deg);
    width: 200px;
    border-top-right-radius: 10px;
    border-bottom-left-radius: 10px;
  }
  100% {
    -webkit-transform: skew(0deg);
            transform: skew(0deg);
    width: 200px;
    border-radius: 5px;
  }
}
            
          
!
            
              var lBar = $(".load");
var bar = $("button span");
var button = $("button");

button.on("click", function(){
     lBar.addClass("loading");
     setTimeout(function(){
        lBar.removeClass("loading");
        button.addClass("complete");
     },500);
});


            
          
!
999px
Loading ..................

Console