<!-- Forked from: http://codepen.io/dcorb/pen/pgOKKw/ -->
<div class="r"></div>
<div class="l"></div>
body {
  font-family: monospace;
  margin: 0;
  min-height: 500vh;
}
div {
  position: fixed;
  top: 10vh;
  left: 10vh;
  width: 0;
  height: 0;
  padding: 17.5vh;
}
div::before {
  position: absolute;
  top: 10vh;
  left: 10vh;
  width: 15vh;
  text-align: center;
  font-size: 15vh;
  line-height: 1;
  color: #fff;
}
div + div {
  top: 55vh;
}
.r {
  background-color: #cc342d;
}
.l {
  background-color: #44709e;
}
.r::before {
  content: 'R';
}
.l::before {
  content: 'L';
}
let ticking = false;
const rBox = document.querySelector('.r');
const lBox = document.querySelector('.l');

function onScroll() {
  ticking = ticking || requestAnimationFrame(() => {
    ticking = false;
  rBox.style.width = `${window.scrollY}px`;
  });
}

function throttledScroll() {
  lBox.style.width = `${window.scrollY}px`;
}

window.addEventListener('scroll', onScroll, false);

window.addEventListener('scroll', _.throttle(throttledScroll, 16), false);

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. //cdnjs.cloudflare.com/ajax/libs/lodash.js/3.5.0/lodash.min.js