<commit_before>$( setup );

function setup(){
	headerScroll()
}

function headerScroll(){
	var header = 	$('header#primary').parent(), // .header-container
		postBody =	$('.article-text').offset().top - 80, // 80 above start of article body
		top = 		$(window).scrollTop(), // Top of window (duh)
		topClass = 	'scrolled-up' // Class to add/remove

	$(window).load(function(){
		if (top <= postBody){ header.addClass(topClass) } 
	})	

	$(window).scroll(function() {
		var top = $(window).scrollTop()
		if (top <= postBody){ header.addClass(topClass) } 
		else { header.removeClass(topClass) }
	})
}<commit_msg>first p in text, not top of element<commit_after>$( setup );

function setup(){
	headerScroll()
}

function headerScroll(){
	var header = 	$('header#primary').parent(), // .header-container
		postBody =	$('.article-text p').first().offset().top - 80, // 80 above start of article body
		top = 		$(window).scrollTop(), // Top of window (duh)
		topClass = 	'scrolled-up' // Class to add/remove

	$(window).load(function(){
		if (top <= postBody){ header.addClass(topClass) } 
	})	

	$(window).scroll(function() {
		var top = $(window).scrollTop()
		if (top <= postBody){ header.addClass(topClass) } 
		else { header.removeClass(topClass) }
	})
}
{'fraction_non_alphanumeric': 0.189792663476874, 'fraction_numerical': 0.006379585326953748, 'mean_word_length': 3.90234375, 'pattern_counts': {'":': 0, '<': 7, '<?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': '4019600', 'n_tokens_mistral': 440, 'n_tokens_neox': 408, 'n_words': 100}