<commit_before>$(document).ready(function() {

	// Declaring selectors ahead of time for speed
	var $window = $(window);
	var $header = $('header');
	var $placeholder = $('#header-placeholder');

	var $slideshow = $('.slideshow');

	// For development, exit if the header is hidden
	if( $header.length < 1 ) {
		return false;
	}

	// "Sticky" the navigation when the user scrolls below the header
	var offsetHeader;
	var heightHeader;

	var updateHeaderStats = function() {

		heightHeader = $header.outerHeight();
		$placeholder.height( heightHeader );

		// Adjust slideshow
		var width = $slideshow.width();
		var height = $window.innerHeight();

		$slideshow.css('padding-bottom', (height - heightHeader - 24) / width * 100 + '%');


		if( $placeholder.is(":visible") ) {
			offsetHeader = $placeholder.offset().top;
		} else {
			offsetHeader = $header.offset().top;
		}

	};

	updateHeaderStats();

	$window.resize( updateHeaderStats );

	var stickyNavigation = function() {

		if( $window.scrollTop() > offsetHeader ) {
			$header.addClass('sticky');
			$placeholder.addClass('sticky');
		}else{
			$header.removeClass('sticky');
			$placeholder.removeClass('sticky');
		}

	};

	stickyNavigation();

	$window.on('scroll touchmove', stickyNavigation );
	$window.resize( stickyNavigation );

});<commit_msg>Fix header jitters<commit_after>$(document).ready(function() {

	// Declaring selectors ahead of time for speed
	var $window = $(window);
	var $header = $('header');
	var $placeholder = $('#header-placeholder');

	var $slideshow = $('.slideshow');

	// For development, exit if the header is hidden
	if( $header.length < 1 ) {
		return false;
	}

	// "Sticky" the navigation when the user scrolls below the header
	var offsetHeader;
	var heightHeader;

	var updateHeaderStats = function() {

		heightHeader = $header.outerHeight();
		$placeholder.height( heightHeader );

		// Adjust slideshow
		var width = $slideshow.width();
		var height = $window.innerHeight();

		$slideshow.css('padding-bottom', (height - heightHeader - 24) / width * 100 + '%');

		if( $placeholder.is(":visible") ) {
			offsetHeader = $placeholder.offset().top;
		} else {
			offsetHeader = $header.offset().top;
		}

	};

	updateHeaderStats();

	$window.resize( updateHeaderStats );

	var stickied = false;

	var stickyNavigation = function() {

		if( $window.scrollTop() > offsetHeader ) {
			if( !stickied ) {
				updateHeaderStats();
				$header.addClass('sticky');
				$placeholder.addClass('sticky');
				stickied = true;
			}
		}else{
			if( stickied ) {
				$header.removeClass('sticky');
				$placeholder.removeClass('sticky');
				stickied = false;
			}
		}

	};

	stickyNavigation();

	$window.on('scroll touchmove', stickyNavigation );
	$window.resize( stickyNavigation );

});
{'fraction_non_alphanumeric': 0.159164566078502, 'fraction_numerical': 0.004321209938782859, 'mean_word_length': 3.9342806394316163, 'pattern_counts': {'":': 2, '<': 5, '<?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': '1851664', 'n_tokens_mistral': 973, 'n_tokens_neox': 846, 'n_words': 204}