<commit_before>window.onload = function (){
  console.log('nice to see you, old friend :)');
}

document.addEventListener('click', function(e) {
  var bodyClasses = document.querySelector('body').classList,
      mouseX = e.clientX,
      mouseY = e.clientY;
  if (mouseY < 15) {
    bodyClasses.add('new');
  }
});<commit_msg>change favicon on click<commit_after>window.onload = function (){
  console.log('nice to see you, old friend :)');
}

function favicon(url) {
  var f = document.createElement('link');
  f.rel = 'icon';
  f.type = 'icon/x-image';
  f.href = url;

  return f;
}

document.addEventListener('click', function(e) {
  var newFaviconUrl = 'img/purple.ico',
      head = document.querySelector('head'),
      bodyClasses = document.querySelector('body').classList,
      mouseX = e.clientX, mouseY = e.clientY;
  if (mouseY < 15) { /* if inside body::before */
    var oldFavicon = document.querySelector('link[rel=icon]');
    bodyClasses.add('new');
    head.removeChild(oldFavicon);
    /* using a timer so that the favicon and css declared color
      change at the same time-ish */
    setTimeout(function() {
      head.appendChild(favicon(newFaviconUrl)); 
    }, 500);
  }
});
{'fraction_non_alphanumeric': 0.15544472152950956, 'fraction_numerical': 0.005818786367414797, 'mean_word_length': 3.6307692307692307, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '3259334', 'n_tokens_mistral': 394, 'n_tokens_neox': 390, 'n_words': 88}