JSFiddle - React, Tailwind, and code Playground

by Simplybj

JavaScript

if ($('.scroll-begin').length > 0) {
  var scrollHeight = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
  console.log(scrollHeight);
  console.log(88);
  console.log(1237);
  var endofPage_0 = false;
  if ((window.innerHeight + window.scrollY + 309.25) >= document.body.offsetHeight) {
    endofPage_0 = true;
  }
  if (scrollHeight > $('.scroll_0').offset().top - ($('.scroll_0').offset().top - 1237) + 200 || endofPage_0) {
    setTimeout(function() {
      $('.scroll_0').addClass('scroll-end');
      setTimeout(function() {
        $('.scroll_0').removeClass('scroll-begin');
      }, '450');
    }, 0);
  }
  console.log(scrollHeight);
  console.log(973.828125);
  console.log(1237);
  var endofPage_1 = false;
  if ((window.innerHeight + window.scrollY + 309.25) >= document.body.offsetHeight) {
    endofPage_1 = true;
  }
  if (scrollHeight > $('.scroll_1').offset().top - ($('.scroll_1').offset().top - 1237) + 200 || endofPage_1) {
    setTimeout(function() {
      $('.scroll_1').addClass('scroll-end');
      setTimeout(function() {
        $('.scroll_1').removeClass('scroll-begin');
      }, '450');
    }, 0);
  }
  console.log(scrollHeight);
  console.log(973.828125);
  console.log(1237);
  var endofPage_2 = false;
  if ((window.innerHeight + window.scrollY + 309.25) >= document.body.offsetHeight) {
    endofPage_2 = true;
  }
  if (scrollHeight > $('.scroll_2').offset().top - ($('.scroll_2').offset().top - 1237) + 200 || endofPage_2) {
    setTimeout(function() {
      $('.scroll_2').addClass('scroll-end');
      setTimeout(function() {
        $('.scroll_2').removeClass('scroll-begin');
      }, '450');
    }, 0);
  }
  console.log(scrollHeight);
  console.log(1326.734375);
  console.log(1237);
  var endofPage_3 = false;
  if ((window.innerHeight + window.scrollY + 309.25) >= document.body.offsetHeight) {
    endofPage_3 = true;
  }
  if (scrollHeight > $('.scroll_3').offset().top - ($('.scroll_3').offset().top - 1237) +...