code: function animate() {
      var diff = this.speed;
  
      //
      // If we're getting close to the endpoint stop at 0.
      //
      if (this.delta < diff) {
        clearInterval(this.animated);
        diff = this.delta;
      }
  
      //
      // Keep track of how much is scrolled.
      //
      this.delta = this.delta - diff;
      this.y = this.y + diff * this.direction;
  
      //
      // Animate the scroll position.
      //
      window.scrollTo(0, this.y);
    }
docs: Calculations for the animation.
  
  @api private