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

Quick-add: + add another resource

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.

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.

            
              .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
            
          
!
            
              @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;
  }
}
            
          
!
            
              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
Loading ..................

Console