123

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.

            
              <div class="form">
  <div class="mail"></div>
  <h1>Mail form</h1>
  <form action="">
    <input type="text" placeholder="Your name"/>
    
    <input type="text" placeholder="E-mail"/>
    
    <textarea name="" id="" cols="30" rows="10" placeholder="Message"></textarea>
    
    <div class="submit">Send</div>
    
  </form>
</div>

<div class="ok_message">
<span>We'll answer you soon!</span></div>
            
          
!
            
              /* Common */
@keyframes openForm {
  0% {
    width 64px
    height 64px
  }
  50% {
    width 320px
    height 64px
  }
  100% {
    width 320px
    height 380px
  }
}

@import url(https://fonts.googleapis.com/css?family=Lato);

html,body
  margin 0
  padding 0
  height 100%
  width 100%

*
  position relative
  -webkit-box-sizing border-box
  box-sizing border-box
  font-family 'Lato', sans-serif
  outline none
  
body
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  align-content: center;
  background #D1DB82
  font-family 'Lato', sans-serif
  
  
  
  
  
/* Form opened styles */
.form.active
  padding 24px
  background #6C4A27
  border 6px solid #CB9A4B
  box-shadow 0px 30px 20px -20px rgba(0,0,0,.3)
  overflow hidden
  width 320px
  height 380px
  -webkit-animation openForm 1.4s
  -webkit-animation-timing-function cubic-bezier(.9,.1,.1,.9)
  animation openForm 1.4s
  animation-timing-function cubic-bezier(.9,.1,.1,.9)
  
  *
    top 0
    opacity 1
  
  &::after,
  &::before
    opacity 0
  
.submit
  top 0
  opacity 1
  width 160px
  padding 8px
  text-align center
  margin 24px auto 0 auto
  background #D1DB82
  cursor pointer
  text-transform uppercase
  color #3E451B
  box-shadow 0px 6px 10px -4px rgba(0,0,0,.3), 0px 1px 0px rgba(255,255,255,.5) inset, 0px 0px 0px rgba(0,0,0,.5) inset
  transition all 1.1s 1s ease

input,textarea
  top 0
  display block
  width 100%
  border none
  padding 10px
  background #fefefe
  margin 12px 0 0 0
  font-style italic
  border 2px solid #bbb
  
input
  top 0
  &:nth-child(1)
    transition all .5s 1s ease
  &:nth-child(2)
    transition all .7s 1s ease

textarea
  top 0
  opacity 1
  max-height 100px
  transition all .9s 1s ease

h1
  top 0
  opacity 1
  text-align center
  font-size: 24px
  text-transform uppercase
  color #CB9A4B
  margin-bottom 32px
  transition all .3s 1s ease
  
  
  
  
  
  
  
  
  
/* Form closed styles */
.form
  width 64px
  height 64px
  background #6C4A27
  border 6px solid #CB9A4B
  box-shadow 0px 10px 20px -5px rgba(0,0,0,.3)
  cursor pointer
  overflow hidden
  
  *
    top -12px
    opacity 0
    
  &::before,
  &::after
    content ''
    display inline-block
    position absolute
    width 0px
    height 0px
    opacity 1
    left 10px
    z-index 100
    transition all .1s linear
    -webkit-transform scale(.9999,.9999)
    transform scale(.9999,.9999)
    
  &::before
    top 15px
    transform perspective(1000) rotateX(0deg)
    transform-origin 50% 0
    border-top 11px solid #fff
    border-right 16px solid transparent
    border-bottom 11px solid transparent
    border-left 16px solid transparent
  
  &::after
    top 17px
    border-top 11px solid transparent
    border-right 16px solid #fff
    border-bottom 11px solid #fff
    border-left 16px solid #fff
  
.form:hover
  &::before
    transform perspective(1000) rotateX(180deg)
    transform-origin 50% 0
    
  /*&::after
    top 21px*/

    
    
/* ok mes */

.ok_message
  position absolute
  left 50%
  top 50%
  margin-left -32px
  margin-top -32px
  width 64px
  height 64px
  background #6C4A27
  z-index 100
  -webkit-transform scale(0,0) rotate(-90deg)
  transform scale(0,0) rotate(-90deg)
  transition all .5s .3s cubic-bezier(.9,.1,.1,.9)
  line-height 64px
  text-align center
  cursor pointer
  
  span
    text-transform uppercase
    font-size 16px
    color #CB9A4B
    opacity 0
    -webkit-transform scale(.2,.2)
    transform scale(.2,.2)
    transition all .6s .4s ease
    
  
  &.active
    width 320px
    margin-left -160px
    -webkit-transform scale(1,1) rotate(0deg)
    transform scale(1,1) rotate(0deg)
    
    span
      opacity 1
      -webkit-transform scale(1,1)
      transform scale(1,1)
      left 0px
            
          
!
            
              $(".form").on('click', function(){
  $(this).addClass('active');
});

$(".submit").on('click', function() {
  $(this).parent().parent().hide(300);
  $(".ok_message").addClass("active");
});

$(".ok_message").on('click', function() {
  $(this).removeClass("active");
  $(".form").removeClass("active").show();
});
            
          
!
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