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

              
                <div class="container" id="better-scrollbar">
  <div class="bar">
    <h3 class="bar-name">Calin Mack</h3>
    <h4 class="bar-username">@calinmack</h4>
  </div>
    
  <div class="icons">
    <div class="icons--back">
      <i class="fa fa-arrow-left"></i>
    </div>
    <div class="icons--menu">
      <i class="fa fa-bars"></i>
    </div>
  </div>
    
   
  <div class="cover"></div>
  <div class="profile-pic"></div>
  <div class="edit-profile">Edit profile</div>
  <div class="name">
    <div class="name--fullname">Calin Mack</div>
    <div class="name--username">@calinmack</div>
    <div class="name--description">I am usually not very inspired...<br>P.S I don't have twitter don't search</div>
  </div>
  <div class="stats">
      <b>9</b> Likes &nbsp;&nbsp; <b>99</b> Comments
  </div>
  <div class="separating-line"></div>
  <div class="post">
    <div class="name-block"></div>
    <div class="post-block"></div>
    <div class="likes-block"></div>
    <div class="separating-line"></div>
  </div>
  <div class="post">
    <div class="name-block"></div>
    <div class="post-block"></div>
    <div class="likes-block"></div>
    <div class="separating-line"></div>
  </div>
  <div class="post">
    <div class="name-block"></div>
    <div class="post-block"></div>
    <div class="likes-block"></div>
    <div class="separating-line"></div>
  </div>
  <div class="post">
    <div class="name-block"></div>
    <div class="post-block"></div>
    <div class="likes-block"></div>
    <div class="separating-line"></div>
  </div>
  <div class="post">
    <div class="name-block"></div>
    <div class="post-block"></div>
    <div class="likes-block"></div>
    <div class="separating-line"></div>
  </div>
  <div class="post">
    <div class="name-block"></div>
    <div class="post-block"></div>
    <div class="likes-block"></div>
    <div class="separating-line"></div>
  </div>
</div>
              
            
!

CSS

              
                * {
  font-family: sans-serif;
}
body{
  background-image: linear-gradient(to right, #33ddff, #55aaff);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.container{
  height: 100vh;
  background-color: #fff;
  width: 400px;
  top: 5px;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,.3);
  overflow-y: scroll;
  transition: all .3s;
}
.container:hover {
  box-shadow: 0 0 0 transparent;
  transition: all .5s;
}
.bar {
  position: fixed;
  background-color: #44bbff;
  top: 8px;
  height: 50px;
  width: 400px;
  opacity: 0;
  z-index: 200;
  transition: opacity .3s;
}
.bar.changed {
  opacity: 1;
  transition: all .2s linear .1s;
}
.bar-name {
  color: white;
  margin-left: 40px;
  margin-top: 30px;
  opacity: 0;
  transition: all .3s;
}
.bar-name.changed {
  margin-top: 5px;
  opacity: 1;
  margin-left: 45px;
  transition: all .3s;
}
.bar-username {
  color: #ddf;
  margin-top: -7px;
  margin-left: 45px;
  opacity: 0;
  transition: all .1s;
}
.bar-username.changed {
  margin-top: -17px;
  opacity: 1;
  transition: all .3s linear .3s;
}
.icons {
  padding: 15px;
  z-index: 300;
  color: #fff;
  position: relative;
  &--back {
    float:left;
    position: fixed;
    z-index: 300;
    transition: all .4s;
    &:hover {
      transform: scale(1.2);
      transition: transform .4s;
    }
  }
  &--menu {
    left: 50%;
    transform: translateX(1200%);
    position: fixed;
    z-index: 300;
    &:hover {
      transform: translateX(1200%) scale(1.2);
      transition: transform .4s;
    }
  }
}
.cover {
  background-image: url("http://www.suetodd.com/uploads/1/9/8/4/19840203/mjm-love.jpg");
  height: 150px;
  margin-top: -30px;
}
.profile-pic {
  height: 90px;
  width: 90px;
  border-radius: 50%;
  border: 5px solid white;
  background-image: url("https://openclipart.org/image/90px/svg_to_png/217044/Mini_S_ring.png");
  margin: -45px 0 0 10px;
  transform: scale(1);
  transition: transform .2s;
}
.profile-pic.changed {
  transform: scale(.6);
  transition: transform .2s;
}
.edit-profile {
  width: 120px;
  height: 25px;
  background: #fff;
  float: right;
  margin: -45px 10px 0 0;
  border-radius: 100px;
  border: 2px solid #bbb;
  text-align: center;
  padding-top: 7px;
  color: #888;
  font-weight: 600;
  transition: all .2s ease;
}
.edit-profile:hover {
  background: #bbb;
  color: #fff;
  transition: all .4s ease;
  cursor: pointer;
}
.name {
  margin:-2px 0 0px 10px;
  color: #555;
  z-index: 500;
  &--fullname {
    font-size: 23px;
    font-weight: 700;
    z-index: 500;
  }
  &--username {
    font-size: 20px;
    padding-top: 5px;
    font-weight: 500;
  }
  &--description {
    padding-top: 15px;
    font-size: 17px;
  }
}
.stats {
  margin: 50px 0 30px 10px;
}
.separating-line {
  width: 100%;
  height: 10px;
  background: #eee;
}


#better-scrollbar::-webkit-scrollbar
{
	width: 7px;
	background-color: #F5F5F5;
}

#better-scrollbar::-webkit-scrollbar-thumb
{
	background-color: #77ddff;
	border-radius: 10px;
}

.name-block {
  width: 150px;
  height: 15px;
  background: #cdcdcd;
  margin: 30px;
}
.post-block {
  margin: 20px;
  width: 250px;
  height: 50px;
  background: linear-gradient(to top, #ddd 20%, #fff 20%, #fff 40%, #ddd 40%, #ddd 60%, #fff 60%, #fff 80%, #ddd 80%);
}
.likes-block {
  margin: 40px 20px 20px 20px;
  background: linear-gradient(to right, #bbb 8%, #fff 8%, #fff 13%, #bbb 13%, #bbb 45%, #fff 45%, #fff 55%, #bbb 55%, #bbb 63%, #fff 63%, #fff 68%, #bbb 68%);
  height: 13px;
  width: 150px;
}
              
            
!

JS

              
                //a scroll is 100px and we want it triggered at the second one
$(".container").scroll(function() {
  if($(this).scrollTop()>=80) {
      $(".bar").delay(200).addClass("changed");
      $(".profile-pic").addClass("changed");
     if($(this).scrollTop()>=180) {
          $(".bar-name").addClass("changed");
          $(".bar-username").addClass("changed");
        }
    else {
          $(".bar-name").removeClass("changed");
          $(".bar-username").removeClass("changed");
    }
  }
  else {
     $(".bar").removeClass("changed");
     $(".profile-pic").removeClass("changed");
  }
});
              
            
!
999px

Console