PageSourceSearch

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

js davidsanan.github.io collected 2026-10-03 08:56:00 UTC 2,446 bytes, 108 lines download raw bytes

1
2(function($) {
3
4	skel.breakpoints({
5		xlarge: '(max-width: 1680px)',
6		large: '(max-width: 1280px)',
7		medium: '(max-width: 1024px)',
8		small: '(max-width: 736px)',
9		xsmall: '(max-width: 480px)'
10	});
11
12	$(function() {
13
14		var $body = $('body'),
15			$header = $('#header'),
16			$nav = $('#nav'), $nav_a = $nav.find('a'),
17			$wrapper = $('#wrapper');
18
19		// Fix: Placeholder polyfill.
20			$('form').placeholder();
21
22		// Prioritize "important" elements on medium.
23			skel.on('+medium -medium', function() {
24				$.prioritize(
25					'.important\\28 medium\\29',
26					skel.breakpoint('medium').active
27				);
28			});
29
30		// Header.
31			var ids = [];
32
33			// Set up nav items.
34				$nav_a
35					.scrolly({ offset: 44 })
36					.on('click', function(event) {
37
38						var $this = $(this),
39							href = $this.attr('href');
40
41						// Not an internal link? Bail.
42							if (href.charAt(0) != '#')
43								return;
44
45						// Prevent default behavior.
46							event.preventDefault();
47
48						// Remove active class from all links and mark them as locked (so scrollzer leaves them alone).
49							$nav_a
50								.removeClass('active')
51								.addClass('scrollzer-locked');
52
53						// Set active class on this link.
54							$this.addClass('active');
55
56					})
57					.each(function() {
58
59						var $this = $(this),
60							href = $this.attr('href'),
61							id;
62
63						// Not an internal link? Bail.
64							if (href.charAt(0) != '#')
65								return;
66
67						// Add to scrollzer ID list.
68							id = href.substring(1);
69							$this.attr('id', id + '-link');
70							ids.push(id);
71
72					});
73
74			// Initialize scrollzer.
75				$.scrollzer(ids, { pad: 300, lastHack: true });
76
77		// Off-Canvas Navigation.
78
79			// Title Bar.
80				$(
81					'<div id="titleBar">' +
82						'<a href="#header" class="toggle"></a>' +
83						'<span class="title">' + $('#logo').html() + '</span>' +
84					'</div>'
85				)
86					.appendTo($body);
87
88			// Header.
89				$('#header')
90					.panel({
91						delay: 500,
92						hideOnClick: true,
93						hideOnSwipe: true,
94						resetScroll: true,
95						resetForms: true,
96						side: 'right',
97						target: $body,
98						visibleClass: 'header-visible'
99					});
100
101			// Fix: Remove navPanel transitions on WP<10 (poor/buggy performance).
102				if (skel.vars.os == 'wp' && skel.vars.osVersion < 10)
103					$('#titleBar, #header, #wrapper')
104						.css('transition', 'none');
105
106	});
107
108})(jQuery);

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.