title: How to put easing into a scroll bound function?
body: <p>I'm trying to make a vertical scroll. On this HTML: </p>
  
  <pre><code>&lt;div class="flex-container"&gt;
  &lt;div class="flex-caption"&gt;  
      &lt;div&gt;
          &lt;p&gt;.........&lt;/p&gt;
          &lt;h1&gt;..........&lt;/h1&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="flex-caption"&gt;  
      &lt;div&gt;
          &lt;p&gt;.....&lt;/p&gt;
      &lt;h1&gt;...........&lt;/h1&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="flex-caption"&gt;  
      &lt;div&gt;
          &lt;p&gt;.............&lt;/p&gt;
          &lt;h1&gt;........../h1&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>So I've put the CSS like this: </p>
  
  <pre><code>.caption-2 {
  overflow: hidden;
  position: fixed;
  }
  
  
  .flex-caption {
  float: left;
  }
  
  .flex-container {
  display: inline-flex;
  width: 300vw;
  transition-timing-function: cubic-bezier(.84,.01,.25,1.01);
  transform: translateX(0vw);
  }
  </code></pre>
  
  <p>Then I change the <code>transform: translateX(0vw);</code>with his code:</p>
  
  <pre><code>var captionCont, captionItem;
  
  captionCont = document.querySelector(".flex-container");
  
  window.onscroll = function() {scrollPost()};
  
  function scrollPost () {
  
  var y = window.scrollY;
  var x = y / 20;
  var i = x * 2;
  animator(i);
  
  }
  
  function animator (y){
  var captionCont;
  captionCont = document.querySelector(".flex-container");
  captionCont.style.transform = `translateX(${-y}vw)`
  }
  </code></pre>
  
  <p>However, I want to try and put easing in scroll these elements, so that it feels more like an animation than just scroll. However, I don't want a triggered animation, I want the animation from 1 to 100% to be bound by scroll. </p>
  
  <p>How would I do this? The cubic bezier doesn't seem to do much.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
   &lt;meta charset="utf-8"&gt;
   &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
   &lt;script
    src="https://code.jquery.com/jquery-3.3.1.js"
    integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60="
    crossorigin="anonymous"&gt;&lt;/script&gt;
   &lt;link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css" integrity="sha384-5sAR7xN1Nv6T6+dT2mhtzEpVJvfS3NScPQTrOxhwjIuvcA67KV2R5Jz6kr4abQsz" crossorigin="anonymous"&gt;
   &lt;link href="animation-library.css" rel="stylesheet"&gt;
   &lt;title&gt;Wubbe Site&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  
  
  &lt;!-- Page no.2 --&gt;
  
  &lt;div class="full-page" id="page-2"&gt;
   &lt;video autoplay muted loop id="myVideo"&gt;
    &lt;source src="fleuropdemo.mp4" type="video/mp4"&gt;
   &lt;/video&gt;
  
  &lt;div class="caption-2"&gt;
   &lt;div class="flex-container"&gt;
   &lt;div class="flex-caption"&gt; 
    &lt;div&gt;
     &lt;p&gt;FLEUROP / BERZORGT EEN GOED GEVOEL&lt;/p&gt;
     &lt;h1&gt; HET GEVOEL VAN BLOEMEN ANDERS VERTELD&lt;/h1&gt;
    &lt;/div&gt;
   &lt;/div&gt;
   &lt;div class="flex-caption"&gt; 
    &lt;div&gt;
     &lt;p&gt;FLEUROP&lt;/p&gt;
    &lt;h1&gt;TITEL VAN PROJECT VRAAG EN OPLOSSING IN EEN MOOIE ZIN&lt;/h1&gt;
    &lt;/div&gt;
   &lt;/div&gt;
   &lt;div class="flex-caption"&gt; 
    &lt;div&gt;
     &lt;p&gt;FLEUROP / BERZORGT EEN GOED GEVOEL&lt;/p&gt;
     &lt;h1&gt; HET GEVOEL VAN BLOEMEN ANDERS VERTELD&lt;/h1&gt;
    &lt;/div&gt;
   &lt;/div&gt;
   &lt;/div&gt;
  
   &lt;div class="btn-container"&gt;
    &lt;button&gt;BEKIJK DE CASE&lt;/button&gt;
    &lt;button&gt;AL ONZE CASES&lt;/button&gt;
   &lt;/div&gt;
   &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div class="full-page"&gt;
   
  &lt;/div&gt;
  
  &lt;div class="full-page"&gt;
   
  &lt;/div&gt;
   
  
  &lt;style type="text/css"&gt;
  
  .caption-2 {
   overflow: hidden;
   position: fixed;
  }
  
  
  .flex-caption {
   float: left;
  }
  
  .flex-container {
   display: inline-flex;
   width: 300vw;
   transition-timing-function: cubic-bezier(.84,.01,.25,1.01);
   transform: translateX(0vw);
  }
  
  @import url('https://fonts.googleapis.com/css?family=Open+Sans:300,400,600');
  
  body { 
   background-size: 100%, 100%;
     text-align: center;
     max-width: none;
     font-family: 'Open Sans', sans-serif;
     color: black;
     margin: 0;
     background-color: black;
  }
  
  * {
   box-sizing: border-box;
  }
  
  .margin-left {
   margin-left: 6.25vw;
  }
  
  .margin-right {
   margin-right: 6.25vw;
  }
  
  .margin-top {
   top: 5vw;
  }
  
  .full-page {
   width: 100vw;
   height: 100vh;
  }
  
  button {
   width: 15%;
   background-color: white;
   height: 4rem;
   color: black;
   font-size: 18px;
   font-weight: bold;
  }
  
  
  #myVideo {
      position: fixed;
      right: 0;
      bottom: 0;
      min-width: 100%; 
      min-height: 100%;
  }
  
  
  #page-2 {
   background-image: url(page-2.png);
   background-size: 100%, 100%;
   background-repeat: no-repeat;
   background-attachment: fixed;
   background-position: center;
      background-repeat: no-repeat;
      background-size: cover;
      display: flex;
   justify-content: center;
   align-items: center;
  
  }
  
  
  .caption-2 {
   color: white;
   height: 70vh;
   width: 100vw;
  
      top: 10vw;
      z-index: 1;
  
  }
  
  .caption-2 p {
   font-size: 30px;
   font-weight: bolder;
  }
  
  .caption-2 h1 {
   font-size: 80px;
   margin-left: 15%;
   margin-right: 15%;
  }
  
  .caption-2 button {
   top: 16vh;
   position: relative;
  }
  
  
  
  
  &lt;/style&gt;
  
  &lt;script type="text/javascript"&gt;
  
  var captionCont, captionItem;
  
  captionCont = document.querySelector(".flex-container");
  
  window.onscroll = function() {scrollPost()};
   
  function scrollPost () {
   
   var y = window.scrollY;
   var x = y / 20;
   var i = x * 2;
   animator(i);
   
   }
  
  function animator (y){
   var captionCont;
   captionCont = document.querySelector(".flex-container");
   captionCont.style.transform = `translateX(${-y}vw)`
  }
   
  
  
  &lt;/script&gt;
  
  
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>