<commit_before>var $header = $('header').height();
var $navigation = $('nav');
var navSticky = 'nav-sticky';
var cssNames = 'nav-sticky transition';

$(window).scroll(function() {
  var thresholdReached = $(this).scrollTop() > $header;
  
  if (thresholdReached && !$navigation.hasClass(navSticky)) {
    $navigation.addClass(cssNames).fadeIn();
  } else if (!thresholdReached && $navigation.hasClass(navSticky)) {
    $navigation.removeClass(cssNames);
  }
});<commit_msg>Update main.js<commit_after>var headerHeight = $('header').height();
var $navigation = $('nav');
var navSticky = 'nav-sticky';
var cssNames = 'nav-sticky transition';

$(window).scroll(function() {
  var thresholdReached = $(this).scrollTop() > (headerHeight*0.8);
  
  if (thresholdReached && !$navigation.hasClass(navSticky)) {
    $navigation.addClass(cssNames).fadeIn();
  } else if (!thresholdReached && $navigation.hasClass(navSticky)) {
    $navigation.removeClass(cssNames);
  }
});
{'fraction_non_alphanumeric': 0.18587746625129803, 'fraction_numerical': 0.0020768431983385254, 'mean_word_length': 5.694444444444445, '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': '1952428', 'n_tokens_mistral': 309, 'n_tokens_neox': 304, 'n_words': 55}