PageSourceSearch

https://tysonpond.github.io/assets/js/main.js

js tysonpond.github.io collected 2026-10-03 10:06:37 UTC 1,087 bytes, 24 lines download raw bytes

1$(document).ready(function(){
2    /* ---------------- NAV-LINK SCROLL BEHAVIOR (CUSTOM SCROLLSPY ) ----------- */
3	var offset = parseInt($("#page-container").css("margin-top"));
4	var sections = $(".nav-link").map(function(){return $(this).attr("href")}).get();
5	var heights = sections.map(x => $(x).offset().top);
6	var prevSection = sections[ heights.map(ht => ht - offset <= window.pageYOffset).lastIndexOf(true) ];
7	$(".nav-link[href='" +  prevSection + "']").toggleClass("active");
8
9	$(window).on("scroll", function(){
10		var currentSectionIndex = heights.map(ht => ht - offset <= window.pageYOffset).lastIndexOf(true);
11		var currentSection = sections[ currentSectionIndex ];
12		if (prevSection!=currentSection) {
13			$(".nav-link.active").toggleClass("active");
14			$(".nav-link[href='" +  currentSection + "']").toggleClass("active");
15			prevSection = currentSection;
16		}
17	});
18
19	/* nav-link click behavior */
20	$('.nav-link, .navbar-brand, #my-projects-btn').click(function(event) {
21		event.preventDefault();
22		$(window).scrollTop($($(this).attr('href')).offset().top - offset);
23	});
24});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.