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

HTML

              
                .content-ctr
  .header-content-ctr
    .header-content
      .title The Header
      .par You only see the header here. If you click the button,<br>the page will jump into the main content.<br>
  .main-content-ctr
    .main-content
      .title The Content
      .par This is the main content. In this area,<br>the header will be hidden. Click the button to jump on top.
  
%header
  .header-bg
  .title material scroll animation
  .cta-ctr
    .cta
              
            
!

CSS

              
                @import "bourbon";
@import url(https://fonts.googleapis.com/css?family=Roboto:400,300,500);

// hide ugly scrollbar
::-webkit-scrollbar{ 
  display: none; 
}

::-moz-scrollbar{ 
  display: none; 
}

html,
body {
  height: 100%;
}

header {
  position: fixed;
  top: 0;
  height: 250px;
  width: 100%;
  pointer-events: none;
  
  .title {
    @include position(absolute, 50% x x 80px);
    color: white;
    font-size: 40px;
    line-height: 40px;
    margin-top: -20px;
    transition: .3s all ease;
    z-index: 999;
    font-family: Roboto;
    font-weight: 300;
    text-transform: capitalize;
  }
  
  
  .header-bg {
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    background: lighten(#E61875, 10%);
    transition: .3s all ease;
    @include position(absolute, 0 0 0 0);
  }
    
  &.active .title {
    font-size: 20px;
    @include transform(translate(-30px, -85px));
    transition: .3s all ease .15s;
  }
  
  &.active .header-bg {
    @include transform(translateY(-170px));
    background: darken(#E61875, 1%);
    transition: .3s all ease .15s;
  }
    
  &.active .cta-ctr {
    @include transform(rotate(0deg));
    transition: .5s all ease .2s;
  }
  
  &.active .cta:after {
    @include transform(rotate(180deg));
    transition: .5s all ease .2s;
    box-shadow: 0 -8px 12px 1px rgba(0,0,0,0.15);
  }
  
  .cta-ctr {
    @include position(absolute, 50px 50px 0 x);
    @include transform-origin(bottom center);
    @include transform(rotate(-90deg));
    transition: .3s all ease;
  }
  
  .cta {
    width: 60px;
    height: 60px;
    background: #F9B24F;
    border-radius: 50%;
    cursor: pointer;
    transition: .3s all ease;
    pointer-events: auto;
    position: relative;
    
    &:after {
      content: "";
      box-shadow: 0 8px 12px 1px rgba(0,0,0,0.15);
      border-radius: 50%;
      @include position(absolute, 0 0 0 0);
      background: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/111167/arrow-down.svg") no-repeat center 14px transparent;
      @include transform(rotate(90deg));
      transition: .3s all ease;
    }
    
    &:hover {
      background-color: lighten(#F9B24F, 5%);
    }
  }
}

// content ctr

.content-ctr {
  width: 100%;
  height: 100%;
  background: white;
  overflow: scroll;
  position: relative;
  
  &.active .header-content-ctr {
    height: 0%;
    transition: .3s height ease .45s;
  }
  
  &.active .header-content-ctr .title {
    transition: .3s all ease;
    opacity: 0;
    @include transform(translateY(-20px));
  }
  
  &.active .header-content-ctr .par {
    transition: .3s all ease .05s;
    opacity: 0;
    @include transform(translateY(-20px));
  }
  
  &.active .main-content-ctr {
    height: 100%;
    overflow: scroll;
  }
  
  &.active .main-content-ctr .title {
    transition: .3s all ease .65s;
    @include transform(translateY(0px));
    opacity: 1;
  }
  
  &.active .main-content-ctr .par {
    transition: .3s all ease .7s;
    @include transform(translateY(0px));
    opacity: 1;
  }
  
  .title {
    font-family: Roboto;
    margin-bottom: 30px;
    font-size: 34px;
    color: #E61875;
    transition: .3s all ease;
  }

  .par {
    font-family: Roboto;
    font-size: 18px;
    line-height: 1.5;
    font-weight: 300;
    color: #777;
  }
  
  .header-content-ctr {
    position: relative;
    height: 100%;
    overflow: hidden;
    transition: .3s height ease;
    
    .title {
      transition: .3s all ease .15s;
    }
    
    .par {
      transition: .3s all ease .3s;
    }
  }
  
  .header-content {
    @include position(absolute, x 0 110px 80px);
  }
  
  .main-content-ctr {
    position: relative;
    min-height: 0%;
    transition: .3s height ease;
    overflow: hidden;
    
    .title,
    .par {
      opacity: 0;
      @include transform(translateY(20px));
    }
  }
  
  .main-content {
    @include position(50% 0 x 0);
    margin-left: 50px;
    margin-top: -59px;
  }
}
              
            
!

JS

              
                button = document.querySelector ".cta"
contentCtr = document.querySelector ".content-ctr"

button.addEventListener "click", ->
  header = this.parentElement.parentElement
  header.classList.toggle "active"
  contentCtr.classList.toggle "active"
  
balapaCop "Material Scroll Animation", "#999"
              
            
!
999px

Console