Pen Settings

HTML

CSS

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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

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.

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

              
                .envelope
  .envelope-corner
  .envelope-top
  .envelope-back 
  .paper
    .paper__input
      p.input-name Name
      p.input-text Artur Sedlukha
    .paper__input
      p.input-name Email
      p.input-text artur@mail.com        
    .paper__input-textarea
      p.input-name Message
      p.input-text I'd like to meet you! Are you free tomorrow?
    button.input-button Send  
button.restart restart
              
            
!

CSS

              
                body, html{
  height: 100%;
}

body{
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: #eee;
  position: relative;
  font-family: 'Roboto';
  overflow: hidden;
  background-color: #79CECB;
}

.envelope{
  background-color: #e5e5e5;
  width: 35vmax;
  height: 21vmax;
  max-width: 500px;
  max-height: 310px;
  min-width: 350px;
  min-height: 217px;
  position: relative;
  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
  display: flex;
  justify-content: center;
  align-items: center;
  filter: drop-shadow(0 0 40px  rgba(0,0,0,0.05)) drop-shadow(0 0 10px  rgba(0,0,0,0.05)) drop-shadow(0 0 1px  rgba(0,0,0,0.16));
}

.envelope-corner{
  background-image: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDIxLjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9ImVudmVsb3BlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCIKCSB2aWV3Qm94PSIwIDAgMzQwIDIzMCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMzQwIDIzMCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CjxwYXRoIGZpbGw9IiNlNWU1ZTUiICBkPSJNMzQwLDIzMHYtNHYtMy44di0yLjhsMCwwdi0wLjFjMC0yLjEtMS00LjEtMi43LTUuNEwxNzgsOThjLTQuNC0zLjEtMTEuNi0zLjEtMTYsMEwyLjcsMjE0CglDMSwyMTUuMiwwLDIxNy4yLDAsMjE5LjR2Mi44djMuOHY0SDM0MHoiLz4KPC9zdmc+Cgo=");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-position: top center;
  width: 100%;
  height: 100%;
  position: absolute;
  left: 0;
  top: -100%;
  transform-origin: bottom;
  z-index: -1;
}
  
.envelope-top{
  background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE3LjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwO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xlZnQtcmlnaHQtc2hhZG93KSIgZmlsbD0iI0Y0RjRGNCIgIHBvaW50cz0iMCwyMzAgMCwxMCAxNzAsMTE1IDM0MCwxMCAzNDAsMjMwICIvPgo8cGF0aCBpZD0iYm90dG9tIiBmaWx0ZXI9InVybCgjbGVmdC1yaWdodC1zaGFkb3cpIiBmaWxsPSIjRjlGOUY5IiBkPSJNMCwyMzBoMzQwdi0xMEwxNzgsMTAyYy00LjQtMy4xLTExLjYtMy4xLTE2LDBMMCwyMjBMMCwyMzAiLz4KCjwvZz4KCjwvc3ZnPgo=');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  width: 100%;
  height: 100%;
  position: absolute;
  left: 0;
  bottom: 0;
  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
  z-index: 2;
}

.envelope-back{
  background-color: #e5e5e5;
  width: 100%;
  height: 100%;
  position: absolute;
  left: 0;
  top: 0;
  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
}

.paper{
  display: flex;
  justify-content: space-between;
  flex-wrap:wrap;
  background-color: #fff;
  width: 93%;
  height: 93%;
  max-width: 460px;
  max-height: 290px;
  z-index: 10;
  margin-bottom: 20px;
  box-shadow: 0 0 3px rgba(0,0,0, 0.2);
  padding: 20px;
  box-sizing: border-box;
  position: relative;
}

.paper__input{
  display: inline-block;
  width: 48%;
  border-bottom: 1px solid lightgrey;
  height: 35px;
}

.paper__input-textarea{
  margin-top: 15px;
  width: 100%;
  height: 65%;
  max-height: 150px;
  background-image: repeating-linear-gradient(to bottom, white 0px, white 19px, lightgrey 19px, lightgrey 20px);
  background-position: 0 15px;
  background-repeat: no-repeat;
}

.input-name{
  font-size: 11px;
  margin-bottom: 5px;
  color: #6ebcb9
}

.input-text{
  opacity: 0;
  color: #555;
  line-height: 20px;
  div{
    opacity: 0;
  }
}

.input-button{
  margin-top: 11px;
  margin-left: auto;
  margin-right: 0;
  background-color: white;
  border: 1px solid #6ebcb9;
  font-size: 12px;
  padding: 3px 15px 4px;
  cursor: pointer;
  color: #6ebcb9;
  position: absolute;
  right: 4%;
  bottom: 5%;
}

.restart{
  position: absolute;
  bottom: 2%;
  left: 0;
  right: 0;
  margin: 0 auto;
  background-color: transparent;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 12px;
}
              
            
!

JS

              
                // envelope animation
window.onload = function(){
  var tl = new TimelineLite({delay: 1}),
    inputText = document.querySelectorAll('.input-text'),
    mySplitText = new SplitText(inputText, {type:"chars"}),
    chars = mySplitText.chars,
    trans = 170;
  
  Array.from(inputText, e => e.style.opacity = '1');
  
  tl
    .staggerTo(chars, 0.01, {opacity: 1}, 0.05, "+=0")
    .to('.input-button', 0.2, {color:"white", backgroundColor: "#6ebcb9"}, '+=0.3')
    .to('.input-button', 0.2, {color:"#6ebcb9", backgroundColor: "white"})
    .to('.envelope', 0.3, {y:trans})
    .to('.paper', 0.3, {y:-2*trans}, "-=0.3")
    .to('.envelope-top', 0.1, {zIndex: 100}, "-=0.1")
    .to('.envelope', 0.3, {y: 0}, "+=0.1")
    .to('.paper', 0.3, {y: 10}, "-=0.3")
    .to('.envelope-corner', 0.25, {rotationX: 180}, "+=0.1")
    .to('.envelope-corner', 0.1, {zIndex: 110}, "-=0.15")
    .to('.envelope', 0.8, {y: -1200, opacity: 0}, "+=0.2");
  
  document.querySelector('.restart').onclick = function() {tl.restart()};
}





              
            
!
999px

Console