LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

Code
menu
Some Title
search
more_vert
Some Title
Cu mei vide viris gloriatur, at populo eripuit sit

Bacon ipsum dolor amet turducken short ribs strip steak, cupim pastrami kielbasa sirloin doner drumstick pork belly meatloaf swine shank short loin bacon. Pastrami andouille bresaola spare ribs, jerky drumstick jowl kevin ground round bacon. Hamburger filet mignon tongue pancetta ground round strip steak. Biltong boudin swine, pork chop pig tri-tip short loin shank alcatra kielbasa. Picanha fatback jowl, pastrami tri-tip chicken turkey. Spare ribs picanha alcatra kielbasa rump t-bone shankle meatball landjaeger beef doner biltong fatback short ribs salami. Burgdoggen picanha frankfurter, brisket tongue pig beef ribs doner strip steak hamburger.

Capicola tri-tip landjaeger strip steak. Ham boudin pig kielbasa landjaeger prosciutto. Shank short ribs spare ribs ball tip salami alcatra. Prosciutto alcatra jerky flank meatball andouille rump bacon. Short loin shoulder tenderloin bresaola. Bacon pastrami turkey ham drumstick tongue kevin meatloaf spare ribs pork belly. Alcatra meatloaf doner tail bresaola meatball ham hock cow.

Sausage andouille pork chop tri-tip. Ham beef ribs ball tip pork chop picanha biltong. Shoulder rump sirloin meatball ham hock. Flank pancetta ham kielbasa short ribs, leberkas hamburger. Ham hock bresaola ball tip chuck rump pork loin jowl brisket swine tenderloin. Sirloin t-bone jowl ham pork belly leberkas kielbasa.

Tongue biltong tail capicola beef ribs sausage pig, meatloaf ball tip landjaeger t-bone shankle kielbasa chuck jerky. Tongue chicken ham, beef ribs pastrami meatball ham hock cow leberkas pig. Pork belly turducken sausage salami strip steak cupim chicken chuck landjaeger t-bone bresaola capicola ribeye. Cow fatback filet mignon, turducken tri-tip cupim t-bone pastrami.

Tongue cow tenderloin pork filet mignon chicken spare ribs, sirloin strip steak pork chop tail turducken. Boudin tail meatloaf shankle leberkas chicken ball tip. Fatback salami ball tip short ribs, cow beef tenderloin venison tail ground round jowl. Beef prosciutto turducken shank. Flank bacon sausage, porchetta tongue picanha pork chop tenderloin drumstick frankfurter beef fatback. Tenderloin biltong short loin, filet mignon tail brisket venison sausage andouille ham shank landjaeger t-bone meatball.

CSS
* {
  box-sizing: border-box;
}

html {
  font-size: 62.5%;
  line-height: 1.4;
}

html, body {
  height: 100%;
  min-height: 100%;
  font-family: Roboto, sans-serif;
}

main {
  padding-top: 300px;
  font-family: arial;
  background: #eee;
  min-height: 100%;
}

.app-header {
  display: block;
  background: #3f51b5;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  color: #fff;
  height: 300px;
  box-shadow: 0 2px 5px transparent;
}

.header-content {
  position: relative;
  height: 100%;
  width: 100%;
}

.app-toolbar {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: horizontal;
  -webkit-box-direction: normal;
      -ms-flex-direction: row;
          flex-direction: row;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  position: relative;
  height: 64px;
  padding: 0 16px;
  pointer-events: none;
  font-size: 20px;
}

#large-toolbar {
  position: absolute;
  bottom: 0;
  -webkit-transform-origin: left top;
          transform-origin: left top;
  margin-bottom: 24px;
  margin-bottom: 16px;
  width: 100%;
}

.small-title,
.large-title {
  -webkit-transform-origin: left top;
          transform-origin: left top;
  white-space: nowrap;
  -webkit-box-flex: 1;
      -ms-flex: 1;
          flex: 1;
  -ms-flex-preferred-size: 0.000000001px;
      flex-basis: 0.000000001px;
  overflow: hidden;
  font-weight: 400;
  line-height: 1.5;
  position: relative;
}

.small-title {
  margin-left: 14px;
  opacity: 0;
}

.large-title {
  will-change: transform, opacity;
  font-size: 56px;
  font-size: 2em;
  margin-left: 64px;
}

.icon-button {
  display: inline-block;
  position: relative;
  padding: 6px;
  outline: none;
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
  font-size: 0;
  line-height: 1;
  width: 40px;
  height: 40px;
  box-sizing: border-box !important;
}
.icon-button .icon {
  display: -webkit-inline-box;
  display: -ms-inline-flexbox;
  display: inline-flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  position: relative;
  vertical-align: middle;
  fill: currentcolor;
  stroke: none;
  width: 100%;
  height: 100%;
}

.background-container {
  position: absolute;
  overflow: hidden;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
}

.background {
  pointer-events: none;
  position: absolute;
  background-size: cover;
  height: 100%;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  will-change: transform, opacity;
}

#background-back {
  background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/106114/mountain-02.jpg);
  background-position: left center;
  opacity: 0;
}

#background-front {
  background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/106114/mountain-01.jpg);
  background-position: left center;
}

.card {
  padding: 16px;
  margin: 24px;
  border-radius: 2px;
  background-color: #fff;
  color: rgba(0, 0, 0, 0.87);
  box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
}
.card .card-title {
  padding: 24px 16px 8px;
  font-size: 24px;
  font-weight: 400;
  line-height: 32px;
}
.card p {
  font-size: 1.6rem;
  font-weight: 400;
  letter-spacing: 0.010em;
  line-height: 1.6em;
  padding: 0 16px;
}
JS
TweenLite.defaultEase = Linear.easeNone;

var header     = document.querySelector("#app-header");
var bgBack     = document.querySelector("#background-back");
var bgFront    = document.querySelector("#background-front");
var toolbar    = document.querySelector("#small-toolbar");
var largeTitle = document.querySelector("#large-title");
var smallTitle = document.querySelector("#small-title");

var deltaHeight = header.offsetHeight - toolbar.offsetHeight;

var rect1 = smallTitle.getBoundingClientRect();
var rect2 = largeTitle.getBoundingClientRect();

var scale = rect1.height / rect2.height;
var x = rect1.left - rect2.left;
var y = rect1.top  - rect2.top;

var headerAnimation = new TimelineLite({ paused: true })
  .to(largeTitle, 1, { scale: scale, x: x, y: deltaHeight + y }, 0)
  .to(header,  1, { y: -deltaHeight }, 0)
  .to(toolbar, 1, { y: deltaHeight }, 0)
  .to(bgBack,  1, { y: deltaHeight / 2 }, 0)
  .to(bgFront, 1, { y: deltaHeight / 2 }, 0)
  .to(bgBack,  1, { alpha: 1 }, 0)
  .to(bgFront, 1, { alpha: 0 }, 0)
  .set(smallTitle, { alpha: 1 }, 1)
  .set(largeTitle, { alpha: 0 }, 1);

var shadowAnimation = TweenLite.to(header, 0.4, { 
  boxShadow: "0 2px 5px rgba(0,0,0,0.6)",
  ease: Power1.easeOut
}).reverse();

var progress  = 0;
var requestId = null;
var reversed  = true;

cloneCards(25);
update();
window.addEventListener("scroll", requestUpdate);

function requestUpdate() {
  if (!requestId) {
    requestId = requestAnimationFrame(update);
  }
}

function update() {
  
  var scroll = window.pageYOffset;
  
  if (scroll < deltaHeight) {   
    progress = scroll < 0 ? 0 : scroll / deltaHeight;
    reversed = true;
  } else {
    progress = 1;
    reversed = false;
  }
  
  headerAnimation.progress(progress);
  shadowAnimation.reversed(reversed);
  
  requestId = null;
}

function cloneCards(count) {
  
  var main = document.querySelector("main");
  var card = document.querySelector(".card");
  
  for (var i = 0; i < count; i++) {
    main.appendChild(card.cloneNode(true));
  }  
}

Description

Really smooth on mobile / touch enabled devices.
Term
Mon, 11/27/2017 - 21:31

Related Codes

Pen ID
Pen ID
Pen ID
Square Adv