<commit_before>$(window).on('scroll load', function() {
	var $sections = $('section').children('div');
	var distScrolled = $(window).scrollTop()
	var winHeight = $(window).height()
	var bottomPos = $('aside').position().top + $('nav').height() + $('header').height()
	if ( distScrolled + winHeight >= bottomPos) {
      	$('.highlighted').removeClass('highlighted')
      	$('#contact').closest('li').addClass('highlighted')
	} else {
	  $sections.each(function() {
	  	var distFromTop = $(this).position().top - 40
	    if(distScrolled >= distFromTop) {
	      var section = "#" + this.className.replace('onepage-', '')
	      var $navTab = $('nav').find(section).closest('li')
	      if (!$navTab.hasClass('highlighted')) {
	      	$('.highlighted').removeClass('highlighted')
	      	$navTab.addClass('highlighted')
	      }
      }
    })
  };
});

$(document).ready(function() {
	loadPics($('.new-box'))

	$('nav').on('click', 'a', function(e){
		e.preventDefault()
		var clicked = ".onepage-" + this.id
		var topHeight = $('header').height() + $('nav').height();
		var offsetNum = $(clicked).offset().top - topHeight
		$('.highlighted').removeClass('highlighted');
		$(this).closest('li').addClass('highlighted');
		$("body").animate({
			scrollTop: offsetNum},
		 600)
	})

	$('.new-box').on('click', '.small-pic', function(){
		$(this).addClass('current-big')
		var picLink = $(this).find('img').attr('src')
		var label = $(this).find('p').text()
		$('#picture-box #big-pic').attr('src', picLink)
		$('#picture-box p').text(label)
		toggleThings()
	})
	$('#screen-hide').on('click',function() {
		toggleThings()
	})

	$('body').on('keyup', function(e){
		var $nextPic
		var $currentPic = $('.current-big')
		var picOpen = $('#picture-box').is(':visible')
		if ( e.keyCode == 27 ) {
			toggleThings()
			return
		} else if ( picOpen && e.keyCode == 37 && $currentPic.prev().hasClass('small-pic') ) {
			$nextPic = $currentPic.prev() 
		} else if ( picOpen && e.keyCode == 39 && $currentPic.next().hasClass('small-pic') ) {
			$nextPic = $currentPic.next()
		} else {
			return
		}
		switchPic($currentPic, $nextPic)
	});

	$('#picture-box').swipe({
		swipe: function(event, direction) {
			var $nextPic
			var $currentPic = $('.current-big')
			var picOpen = $('#picture-box').is(':visible')
			if ( picOpen && direction == 'right' && $currentPic.prev().hasClass('small-pic') ) {
				$nextPic = $currentPic.prev()
			} else if ( picOpen && direction == 'left' && $currentPic.next().hasClass('small-pic') ) {
				$nextPic = $currentPic.next()
			} else {
				return
			}
			switchPic($currentPic, $nextPic)
		}
	})
	
	
// 	$('#picture-box').on('swipeLeft swipeRight', function(e) {
// 		var $nextPic
// 		var $currentPic = $('.current-big')
// 		var picOpen = $('#picture-box').is(':visible')
// 		if ( picOpen && e.type == 'swiperight' && $currentPic.prev().hasClass('small-pic') ) {
// 			$nextPic = $currentPic.prev()
// 		} else if ( picOpen && e.type == 'swipeleft' && $currentPic.next().hasClass('small-pic')) {
// 			$nextPic = $currentPic.next()
// 		} else {
// 			return
// 		}
// 		switchPic($currentPic, $nextPic)
//	 })

	$('#picture-box').on('click', '.arrow', function(){
		var $arrow = $(this)
		var $currentPic = $('.current-big')
		var $nextPic
		if ( $arrow.hasClass('arrow-left') && $currentPic.prev().hasClass('small-pic') ){
			$nextPic = $currentPic.prev()<commit_msg>deleted commented out js<commit_after>$(window).on('scroll load', function() {
	var $sections = $('section').children('div');
	var distScrolled = $(window).scrollTop()
	var winHeight = $(window).height()
	var bottomPos = $('aside').position().top + $('nav').height() + $('header').height()
	if ( distScrolled + winHeight >= bottomPos) {
      	$('.highlighted').removeClass('highlighted')
      	$('#contact').closest('li').addClass('highlighted')
	} else {
	  $sections.each(function() {
	  	var distFromTop = $(this).position().top - 40
	    if(distScrolled >= distFromTop) {
	      var section = "#" + this.className.replace('onepage-', '')
	      var $navTab = $('nav').find(section).closest('li')
	      if (!$navTab.hasClass('highlighted')) {
	      	$('.highlighted').removeClass('highlighted')
	      	$navTab.addClass('highlighted')
	      }
      }
    })
  };
});

$(document).ready(function() {
	loadPics($('.new-box'))

	$('nav').on('click', 'a', function(e){
		e.preventDefault()
		var clicked = ".onepage-" + this.id
		var topHeight = $('header').height() + $('nav').height();
		var offsetNum = $(clicked).offset().top - topHeight
		$('.highlighted').removeClass('highlighted');
		$(this).closest('li').addClass('highlighted');
		$("body").animate({
			scrollTop: offsetNum},
		 600)
	})

	$('.new-box').on('click', '.small-pic', function(){
		$(this).addClass('current-big')
		var picLink = $(this).find('img').attr('src')
		var label = $(this).find('p').text()
		$('#picture-box #big-pic').attr('src', picLink)
		$('#picture-box p').text(label)
		toggleThings()
	})
	$('#screen-hide').on('click',function() {
		toggleThings()
	})

	$('body').on('keyup', function(e){
		var $nextPic
		var $currentPic = $('.current-big')
		var picOpen = $('#picture-box').is(':visible')
		if ( e.keyCode == 27 ) {
			toggleThings()
			return
		} else if ( picOpen && e.keyCode == 37 && $currentPic.prev().hasClass('small-pic') ) {
			$nextPic = $currentPic.prev() 
		} else if ( picOpen && e.keyCode == 39 && $currentPic.next().hasClass('small-pic') ) {
			$nextPic = $currentPic.next()
		} else {
			return
		}
		switchPic($currentPic, $nextPic)
	});

	$('#picture-box').swipe({
		swipe: function(event, direction) {
			var $nextPic
			var $currentPic = $('.current-big')
			var picOpen = $('#picture-box').is(':visible')
			if ( picOpen && direction == 'right' && $currentPic.prev().hasClass('small-pic') ) {
				$nextPic = $currentPic.prev()
			} else if ( picOpen && direction == 'left' && $currentPic.next().hasClass('small-pic') ) {
				$nextPic = $currentPic.next()
			} else {
				return
			}
			switchPic($currentPic, $nextPic)
		}
	})

	$('#picture-box').on('click', '.arrow', function(){
		var $arrow = $(this)
		var $currentPic = $('.current-big')
		var $nextPic
		if ( $arrow.hasClass('arrow-left') && $currentPic.prev().hasClass('small-pic') ){
			$nextPic = $currentPic.prev()
{'fraction_non_alphanumeric': 0.2376332113885796, 'fraction_numerical': 0.0034992842373150947, 'mean_word_length': 3.774487471526196, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '3665071', 'n_tokens_mistral': 2429, 'n_tokens_neox': 2129, 'n_words': 362}