<commit_before>(function () {
  'use strict';
  var webglEl = document.getElementById('webgl');

  if (!Detector.webgl) {
    Detector.addGetWebGLMessage(webglEl);
    return;
  }

  var width  = window.innerWidth,
    height = window.innerHeight;

  // Earth params
  var radius   = 0.5,
    segments = 32,
    rotation = 80;

  var sphereAndPoints = new THREE.Object3D();
  //var rotationSpeed = 0.0005;
  var rotationSpeed = 0.001;

  var scene = new THREE.Scene();

  var camera = new THREE.PerspectiveCamera(45, width / height, 0.01, 1000);
  camera.position.z = 4;

  var renderer = new THREE.WebGLRenderer();
  renderer.setSize(width, height);

  var ambientLight = new THREE.AmbientLight(0x555555);

  var light = new THREE.DirectionalLight(0xffffff, 1);
  light.position.set(5,3,5);
  scene.add(light);

  var btnPrevElt = document.getElementById('btn-prev');
  var btnNextElt = document.getElementById('btn-next');

  var sphere;
  var mapIndex = maps.length;   // Start at the most recent.
  function step(forwards) {
    if (forwards) {
      mapIndex++;
    } else {
      mapIndex--;
    }

    mapIndex = Math.min(maps.length - 1, mapIndex);
    mapIndex = Math.max(0, mapIndex);

    document.getElementById('jump-to').value = mapIndex + '';

    var timestep = maps[mapIndex];

    // Details setup.
    document.getElementById('mapped-by').innerHTML = timestep.mappedBy;
    document.getElementById('mapped-when').innerHTML =
      (isNaN(parseInt(timestep.date[0])) ? 'on' : 'in') + ' ' + timestep.date;
    document.getElementById('credit').innerHTML = timestep.desc;

    // Sphere setup.
    var oldRotation = rotation;
    if (sphere) {
      oldRotation = sphere.rotation.y;
      sphereAndPoints.remove(sphere);
    }
    sphere = createSphere(timestep.path, radius, segments);
    if (mapIndex == maps.length) {
      mapIndex = 0;
    }
    sphere.rotation.y = oldRotation;
    sphereAndPoints.add(sphere);

    if (mapIndex == maps.length - 1) {
      btnNextElt.classList.add('inactive');
      mapIndex = maps.length - 1;
    } else {
      btnNextElt.classList.remove('inactive');
    }

    if (mapIndex == 0) {
      btnPrevElt.classList.add('inactive');
      mapIndex = 0;
    } else {
      btnPrevElt.classList.remove('inactive');
    }

    clearSelection();   // Sometimes part of the page can be selected on fast click.
  }

  step(false);

  // Event listeners for prev/next
  var t = -1;
  document.addEventListener('keydown', function(e) {
    var now = new Date().getTime();
    if (now - t > 150) {
      // Left and right keys are 37 and 39 respectively, they step through the
      // select.
      var select = document.getElementById('years-ago');
      if (e.keyCode == 37) {
        step(false);
      } else if (e.keyCode == 39) {
        step(true);
      }
      t = now;
    }
  }, false);

  btnPrevElt.onclick = function() {
    step(false);
  };
  btnNextElt.onclick = function() {
    step(true);
  };

  // Play/pause logic
  var btnPlayElt = document.getElementById('btn-play');
  var btnPauseElt = document.getElementById('btn-pause');

  var playInterval;
  btnPlayElt.onclick = function() {
    mapIndex = -1;
    (function play() {
      if (mapIndex == maps.length - 1) {
        return;
      }
      step(true);
      btnPlayElt.style.display = 'none';
      btnPauseElt.style.display = '';

      playInterval = setTimeout(play, 1000);
    })();
  };

  btnPauseElt.onclick = function() {
    clearInterval(playInterval);
    btnPlayElt.style.display = '';
    btnPauseElt.style.display = 'none';
  };
<commit_msg>2s delay in slideshow interval, up from 1s<commit_after>(function () {
  'use strict';
  var webglEl = document.getElementById('webgl');

  if (!Detector.webgl) {
    Detector.addGetWebGLMessage(webglEl);
    return;
  }

  var width  = window.innerWidth,
    height = window.innerHeight;

  // Earth params
  var radius   = 0.5,
    segments = 32,
    rotation = 80;

  var sphereAndPoints = new THREE.Object3D();
  //var rotationSpeed = 0.0005;
  var rotationSpeed = 0.001;

  var scene = new THREE.Scene();

  var camera = new THREE.PerspectiveCamera(45, width / height, 0.01, 1000);
  camera.position.z = 4;

  var renderer = new THREE.WebGLRenderer();
  renderer.setSize(width, height);

  var ambientLight = new THREE.AmbientLight(0x555555);

  var light = new THREE.DirectionalLight(0xffffff, 1);
  light.position.set(5,3,5);
  scene.add(light);

  var btnPrevElt = document.getElementById('btn-prev');
  var btnNextElt = document.getElementById('btn-next');

  var sphere;
  var mapIndex = maps.length;   // Start at the most recent.
  function step(forwards) {
    if (forwards) {
      mapIndex++;
    } else {
      mapIndex--;
    }

    mapIndex = Math.min(maps.length - 1, mapIndex);
    mapIndex = Math.max(0, mapIndex);

    document.getElementById('jump-to').value = mapIndex + '';

    var timestep = maps[mapIndex];

    // Details setup.
    document.getElementById('mapped-by').innerHTML = timestep.mappedBy;
    document.getElementById('mapped-when').innerHTML =
      (isNaN(parseInt(timestep.date[0])) ? 'on' : 'in') + ' ' + timestep.date;
    document.getElementById('credit').innerHTML = timestep.desc;

    // Sphere setup.
    var oldRotation = rotation;
    if (sphere) {
      oldRotation = sphere.rotation.y;
      sphereAndPoints.remove(sphere);
    }
    sphere = createSphere(timestep.path, radius, segments);
    if (mapIndex == maps.length) {
      mapIndex = 0;
    }
    sphere.rotation.y = oldRotation;
    sphereAndPoints.add(sphere);

    if (mapIndex == maps.length - 1) {
      btnNextElt.classList.add('inactive');
      mapIndex = maps.length - 1;
    } else {
      btnNextElt.classList.remove('inactive');
    }

    if (mapIndex == 0) {
      btnPrevElt.classList.add('inactive');
      mapIndex = 0;
    } else {
      btnPrevElt.classList.remove('inactive');
    }

    clearSelection();   // Sometimes part of the page can be selected on fast click.
  }

  step(false);

  // Event listeners for prev/next
  var t = -1;
  document.addEventListener('keydown', function(e) {
    var now = new Date().getTime();
    if (now - t > 150) {
      // Left and right keys are 37 and 39 respectively, they step through the
      // select.
      var select = document.getElementById('years-ago');
      if (e.keyCode == 37) {
        step(false);
      } else if (e.keyCode == 39) {
        step(true);
      }
      t = now;
    }
  }, false);

  btnPrevElt.onclick = function() {
    step(false);
  };
  btnNextElt.onclick = function() {
    step(true);
  };

  // Play/pause logic
  var btnPlayElt = document.getElementById('btn-play');
  var btnPauseElt = document.getElementById('btn-pause');

  var playInterval;
  btnPlayElt.onclick = function() {
    mapIndex = -1;
    (function play() {
      if (mapIndex == maps.length - 1) {
        return;
      }
      step(true);
      btnPlayElt.style.display = 'none';
      btnPauseElt.style.display = '';

      playInterval = setTimeout(play, 2000);
    })();
  };

  btnPauseElt.onclick = function() {
    clearInterval(playInterval);
    btnPlayElt.style.display = '';
    btnPauseElt.style.display = 'none';
  };

{'fraction_non_alphanumeric': 0.1407922168172342, 'fraction_numerical': 0.018068102849200834, 'mean_word_length': 2.7440166493236213, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '282246', 'n_tokens_mistral': 2483, 'n_tokens_neox': 2321, 'n_words': 507}