<commit_before>export default function() {
  /*FADE LINES ON SCROLL COMPONENT*/
  var fadedTextBlock = document.querySelectorAll('.js-c-fade-lines-target');
  var wordMatch = /(\S+\s*)/g;
  // console.log(fadedTextBlock);

  // for (var i = 0; i < fadedTextBlock.length; i++) {
  //   console.log(fadedTextBlock[i]);
  // }

  // console.log(fadedTextBlock.innerHTML.split(wordMatch).length);
  // console.log(fadedTextBlock.innerHTML.split(wordMatch));
  // console.log(fadedTextBlock.length);
  for (var i = 0; i < fadedTextBlock.length; i++) {
    // var wordMatch = /(\S+\s*)/g;
    var wrappedWordsInSpanTags;
    // console.log(fadedTextBlock);
    var wordCount = fadedTextBlock[i].innerHTML.split(wordMatch).length;

    // console.log(fadedTextBlock[i].innerHTML.replace(wordMatch, '<span>$1</span>'));
    wrappedWordsInSpanTags = fadedTextBlock[i].innerHTML.replace(wordMatch, '<span>$1</span>');
    fadedTextBlock[i].innerHTML = wrappedWordsInSpanTags;
    // console.log(fadedTextBlock[i].childNodes[3]);
    for (var j = 0; j < fadedTextBlock[i].childNodes.length; j++) {
      var temporaryScatterClass = 'class="evo_h-fade-lines-' + j + '"';
      var randomTopDistValue = Math.floor(Math.random() * 200) + 80;
      console.log(randomTopDistValue + "px");
      if (fadedTextBlock[i].childNodes[j].tagName === "SPAN") {
        fadedTextBlock[i].childNodes[j].classList.add(temporaryScatterClass);
        fadedTextBlock[i].childNodes[j].style.position = "relative";
        fadedTextBlock[i].childNodes[j].style.top = randomTopDistValue + "px";
        fadedTextBlock[i].childNodes[j].style.opacity = 0;
      }
    }
    // console.log(fadedTextBlock);
    // FIXME: This component is not yet ready, in the middle of trying to make
    // it work
    // for (var j = 0; j <= fadedTextBlock[i].innerHTML.split(wordMatch).length; j++) {
      // var temporaryScatterClass = 'class="evo_h-fade-lines-' + j + '"';
      // var wrappedWordsInSpanTags = fadedTextBlock[i].innerHTML.replace(wordMatch, '<span>$1</span>');
      // console.log(fadedTextBlock[i].innerHTML.split(wordMatch).length);
      // console.log(temporaryScatterClass);


      // if ( j === fadedTextBlock[i].innerHTML.split(wordMatch).length) {
      //   console.log("finished loop!!!!!!!!!");
      //   console.log(wrappedWordsInSpanTags);
      // }
      // fadedTextBlock[i].innerHTML = wrappedWordsInSpanTags;
    // }

    // for (var k = 0; )




    // for (var j = 0; j < )
    // console.log(fadedTextBlock[i].innerText.replace(/(\S+\s*)/g, "<span>$1</span>"));
  }

  // for (var j = 0; fadedTextBlock.length; i++) {
  //   fadedTextBlock[j].addEventListener('scroll', function(event) {
  //     console.log('Ok, This is scrolling');
  //   });
  // }




  /*CODE REFERENCE*/
//   (function () {
//     $(".stripe").each(function () {
//         var obj = $(this);
//         var html = obj.html().replace(/(\S+\s*)/g, "<span>$1</span>");
//         obj.html(html);
//     });

//     var offset = 0;
//     var colorIndex = 0;
//     var colors = ["#ccc", "#000"];
//     var spans = $(".stripe span");

//     function highlight() {
//         for (var i = 0; i < spans.length; i++) {

//             var newOffset = spans[i].offsetTop;
//             if (newOffset !== offset) {
//                 colorIndex = colorIndex === 0 ? 1 : 0;
//                 offset = newOffset;
//             }

//             spans[i].style.color = colors[colorIndex];
//         }
//     }

//     highlight(); // initial highlighting

//     var timeout;
//     function throttle(){
//         window.clearTimeout(timeout);
//         timeout = window.setTimeout(highlight, 100);
//     }

//     $(window).on("resize", throttle);
// })();

}<commit_msg>Nearly finished Fade Lines component.<commit_after>export default function() {
  /*FADE LINES ON SCROLL COMPONENT*/
  var fadedTextBlocks = document.querySelectorAll('.js-c-fade-lines-target');
  var wordMatch = /(\S+\s*)/g;

  for (var i = 0; i < fadedTextBlocks.length; i++) {
    var wrappedWordsInSpanTags = fadedTextBlocks[i].innerHTML.replace(wordMatch, '<span>$1</span>');
    fadedTextBlocks[i].innerHTML = wrappedWordsInSpanTags;

    for (var j = 0; j < fadedTextBlocks[i].childNodes.length; j++) {
      var temporaryScatterClass = 'class="evo_h-fade-lines-' + j + '"';
      var randomTopDistValue = Math.floor(Math.random() * 200) + 80;
      if (fadedTextBlocks[i].childNodes[j].tagName === "SPAN") {
        fadedTextBlocks[i].childNodes[j].classList.add(temporaryScatterClass);
        fadedTextBlocks[i].childNodes[j].style.position = "relative";
        fadedTextBlocks[i].childNodes[j].style.top = randomTopDistValue + "px";
        // fadedTextBlocks[i].childNodes[j].style.transform = "translateY(" + randomTopDistValue + "px)";
        fadedTextBlocks[i].childNodes[j].style.opacity = 0;
        fadedTextBlocks[i].childNodes[j].style.transition = 'all 3s';
        fadedTextBlocks[i].childNodes[j].style.transition = 'top 3s, opacity 3s';
      }
    }
  }

  window.onscroll = function() {
    for (var k = 0; k < fadedTextBlocks.length; k++) {
      var paragraphElementBoundingRect = fadedTextBlocks[k].getBoundingClientRect();

      if ((window.pageYOffset || document.documentElement.scrollTop) + 300 >= paragraphElementBoundingRect.top + (window.pageYOffset || document.documentElement.scrollTop)) {
        var allViewableSpans = document.querySelectorAll('[class*="evo_h-fade-lines-"]');

        for (var l = 0; l < allViewableSpans.length; l++) {
            allViewableSpans[l].style.top =  0;
            // allViewableSpans[l].style.transform = "translateY(0)";
            allViewableSpans[l].style.opacity =  1;
        }
      }
    }
  };
}
{'fraction_non_alphanumeric': 0.17819706498951782, 'fraction_numerical': 0.00890985324947589, 'mean_word_length': 2.84744623655914, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1078216', 'n_tokens_mistral': 1926, 'n_tokens_neox': 1841, 'n_words': 312}