<commit_before><commit_msg>Factors out navigation into its own module.<commit_after>'use strict';

/**
 * NAVIGATION module
 *
 * @author <NAME> <<EMAIL>>
 */
$.extend( true, C1V0, {
  navigation: {

    init: function() {
      this._fadableHeader();
      this._scrollingNav();
    },

    /**
     * Fadable header
     *
     * On large screens: hides the header initially
     * and then fades it after scrolling.
     */
    _fadableHeader: function() {
      $('#primary-nav').removeClass('sticky');

      $(document).on('scroll', function(){
        if ($(document).width() > 640) {
          if ($(document).scrollTop() > 420){
            $('#primary-nav').addClass('sticky');
          } else {
            $('#primary-nav').removeClass('sticky fixed');
            $('body').removeClass('f-topbar-fixed');
          }
        }
      });
    },

    /**
     * Scrolling navigation
     *
     * Smooth scroll for the on-page navigation.
     */
    _scrollingNav: function() {
      $('.top-bar .left a').click(function(){
        event.preventDefault();
        var toGo = $(this).attr('href');

        $('html, body').animate({
            scrollTop: $(toGo).offset().top
        }, 800);
      });
    },
  }
});

C1V0.navigation.init();

{'fraction_non_alphanumeric': 0.18312101910828024, 'fraction_numerical': 0.010350318471337579, 'mean_word_length': 2.0733496332518335, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 8, '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': '4088216', 'n_tokens_mistral': 389, 'n_tokens_neox': 375, 'n_words': 75}