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 includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

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

              
                .btn
.overlay
form.contact
  h1 Contact Us
    span#close
  .group
    input(type="text" id="name" required )
    label(for="name") Name

  .group
    input(type="text" id="email" required )
    label(for="email") Email

  .group
    textarea(id='message' required )
    label(for='message') Your Message

  button(value='submit')
  

              
            
!

CSS

              
                $color: #1abc9c;

@mixin centered {
  margin: auto;
  position: absolute;
  top: 0; bottom: 0;
  left: 0; right: 0;
}

html, body {min-height:100%;}

body {
  background: #ccc url('https://images.unsplash.com/photo-1432821579285-1b649e5b1ce3?crop=entropy&fit=crop&fm=jpg&h=650&ixjsv=2.0.0&ixlib=rb-0.3.5&q=80&w=1375') no-repeat top center;
  background-size: cover;
  margin: 0;
  font-family: Roboto;
}

.overlay {
  background: rgba(55, 58, 71, 0.9);
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: auto;
  transition: .3s;
  &.hidden {
    visibility: hidden;
    opacity: 0;
  }
}

.btn {
  @include centered;
  background: $color url('https://cbwconline.com/IMG/Codepen/Compose.svg') center center no-repeat;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.14), 0 4px 8px rgba(0, 0, 0, 0.28);
  cursor: pointer;  
}

form {
  @include centered;
  background: #F9F9F9;
  width: 350px;
  height: 500px;
  border-radius: 3px;
  box-shadow: 0 3px 36px 0 rgba(0, 0, 0, 0.6);
  overflow: hidden;
  transition: .3s;
  &.hidden {
    visibility: hidden;
    opacity: 0;
    transform: translateY(-100px);
  }
}

h1 {
  background: $color;
  margin: 0;
  padding: 8px;
  color: white;
  font: 300 20px Roboto;
  text-align: center;
    
  span {
    display: block;
    background:  url('https://cbwconline.com/IMG/Close.svg') center center no-repeat;
    width: 26px; 
    height: 26px;
    border-radius: 50%;
    position: absolute;
    top: 7px;
    right: 7px;
    cursor: pointer;
    transition: .2s;    
    &:hover {
      background-color: rgba(white, .2);     }
  }
}

.group {
  width: 250px;
  margin: auto;
  position: relative;
}

label {
  position: absolute;
  top: 7px;
  font: 400 15px Roboto;
  color: #A9A9A9;
  cursor: text;
  transition: .2s;
}

input {
  background: linear-gradient(to bottom, transparent 92%, $color 8%) no-repeat;
  background-position: -300px 0;
  background-size: 300px 100%;
  display: block;
  width: 250px;
  padding: 5px 0;
  margin-top: 30px;
  border: none;
  border-bottom: solid 1px $color;
  font-size: 15px;
  transition: all 0.3s;
  
  // Stop that awful pale yellow background on webkit auto-fill
  &:-webkit-autofill {
    -webkit-box-shadow: 0 0 0px 1000px #F9F9F9 inset;
  }
  &:focus, &:valid {
    background-position: 0 0;
    outline: none;
    
    ~label {
      top: -12px;
      color: $color;
      font: 700 12px Roboto;
    }
  }
}

textarea, textarea:focus {
  background: #F9F9F9;
  width: 230px;
  height: 230px;
  padding: 9px;
  margin-top: 30px;
  border: 1px solid $color;
  outline: none;
  font: 300 15px Roboto;
  resize: none;
  &:focus, &:valid {
    padding: 7px;
    border: 3px solid $color;
     
    ~label {
      top: 12px;
      left: 0;
      color: $color;
      font: 700 12px Roboto;
    }
  }
    
  ~label {
    top: 35px;
    left: 7px;   
  }
}

button {
  display: block;
  background: $color url('https://cbwconline.com/IMG/Send.svg') no-repeat center center;
  width: 200px;
  height: 30px;
  margin: 15px auto;
  border: none;
  border-radius: 3px;
  box-shadow: 0 3px 6px 0 rgba(0,0,0,0.2);
  color: white;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  &:hover { 
    nox-shadow: 0 6px 6px 0 rgba(0,0,0,0.2);
    transform: translateY(-3px);
  }
}

::selection {
  background: $color;
  color: white;
}
              
            
!

JS

              
                $("#close ,.overlay").on('click', function(){
	$(".contact ,.overlay").addClass("hidden");
})

$(".btn").on('click', function(){
	$(".contact ,.overlay").removeClass("hidden");
})
              
            
!
999px

Console