<commit_before>/**
 * Fade between sections (<h1> and preamble are wrapped in a section) with keyboard up/down.
 */
$('#content h1:first-child, #content #preamble').wrapAll("<span class='sect1' />");
var sections = $('.sect1');
sections.hide();
var current = 0;
$(sections[current]).show();
var sectionsLength = sections.length;
$(document).keydown(function (e) {
  if (e.keyCode === 38) {
    // up
    if (current > 0) {
      e.preventDefault();
      current -= 1;
      $(sections[current+1]).fadeOut(300, function() {
        $(sections[current]).fadeIn(300);
      });
    }
  }
  else if (e.keyCode === 40) {
    // down
    if (current < sectionsLength - 1) {
      e.preventDefault();
      current += 1;
      $(sections[current-1]).fadeOut(300, function() {
        $(sections[current]).fadeIn(300);
      });
    }
  }
});<commit_msg>first, indent only, no changes<commit_after>/**
 * Fade between sections (<h1> and preamble are wrapped in a section) with keyboard up/down.
 */
    $('#content h1:first-child, #content #preamble').wrapAll("<span class='sect1' />");
    var sections = $('.sect1');
    sections.hide();
    var current = 0;
    $(sections[current]).show();
    var sectionsLength = sections.length;
    $(document).keydown(function (e) {
      if (e.keyCode === 38) {
        // up
        if (current > 0) {
          e.preventDefault();
          current -= 1;
          $(sections[current+1]).fadeOut(300, function() {
            $(sections[current]).fadeIn(300);
          });
        }
      }
      else if (e.keyCode === 40) {
        // down
        if (current < sectionsLength - 1) {
          e.preventDefault();
          current += 1;
          $(sections[current-1]).fadeOut(300, function() {
            $(sections[current]).fadeIn(300);
          });
        }
      }
    });
{'fraction_non_alphanumeric': 0.18540866703236422, 'fraction_numerical': 0.029621503017004936, 'mean_word_length': 2.3467889908256883, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '742732', 'n_tokens_mistral': 599, 'n_tokens_neox': 556, 'n_words': 126}