PageSourceSearch

https://rishiprasad.org/assets/js/main.js

js rishiprasad.org collected 2026-10-02 01:07:42 UTC 3,575 bytes, 163 lines download raw bytes

1/*
2	Urban by TEMPLATED
3	templated.co @templatedco
4	Released for free under the Creative Commons Attribution 3.0 license (templated.co/license)
5*/
6
7(function($) {
8
9	skel.breakpoints({
10		xlarge:	'(max-width: 1680px)',
11		large:	'(max-width: 1280px)',
12		medium:	'(max-width: 980px)',
13		small:	'(max-width: 736px)',
14		xsmall:	'(max-width: 480px)'
15	});
16
17	$(function() {
18
19		var	$window = $(window),
20			$body = $('body'),
21			$header = $('#header'),
22			$banner = $('#banner');
23
24		// Disable animations/transitions until the page has loaded.
25			$body.addClass('is-loading');
26
27			$window.on('load', function() {
28				window.setTimeout(function() {
29					$body.removeClass('is-loading');
30				}, 100);
31			});
32
33		// Fix: Placeholder polyfill.
34			$('form').placeholder();
35
36		// Prioritize "important" elements on medium.
37			skel.on('+medium -medium', function() {
38				$.prioritize(
39					'.important\\28 medium\\29',
40					skel.breakpoint('medium').active
41				);
42			});
43
44		// Menu.
45			$('#menu')
46				.append('<a href="#menu" class="close"></a>')
47				.appendTo($body)
48				.panel({
49					delay: 500,
50					hideOnClick: true,
51					hideOnSwipe: true,
52					resetScroll: true,
53					resetForms: true,
54					side: 'right'
55				});
56
57		// Header.
58			if (skel.vars.IEVersion < 9)
59				$header.removeClass('alt');
60
61			if ($banner.length > 0
62			&&	$header.hasClass('alt')) {
63
64				$window.on('resize', function() { $window.trigger('scroll'); });
65
66				$banner.scrollex({
67					bottom:		$header.outerHeight(),
68					terminate:	function() { $header.removeClass('alt'); },
69					enter:		function() { $header.addClass('alt'); },
70					leave:		function() { $header.removeClass('alt'); $header.addClass('reveal'); }
71				});
72
73			}
74
75		// Banner.
76			var $banner = $('#banner');
77
78			if ($banner.length > 0) {
79
80				// IE fix.
81					if (skel.vars.IEVersion < 12) {
82
83						$window.on('resize', function() {
84
85							var wh = $window.height() * 0.60,
86								bh = $banner.height();
87
88							$banner.css('height', 'auto');
89
90							window.setTimeout(function() {
91
92								if (bh < wh)
93									$banner.css('height', wh + 'px');
94
95							}, 0);
96
97						});
98
99						$window.on('load', function() {
100							$window.triggerHandler('resize');
101						});
102
103					}
104
105				// Video check.
106					var video = $banner.data('video');
107
108					if (video)
109						$window.on('load.banner', function() {
110
111							// Disable banner load event (so it doesn't fire again).
112								$window.off('load.banner');
113
114							// Append video if supported.
115								if (!skel.vars.mobile
116								&&	!skel.breakpoint('large').active
117								&&	skel.vars.IEVersion > 9)
118									$banner.append('<video autoplay loop><source src="' + video + '.mp4" type="video/mp4" /><source src="' + video + '.webm" type="video/webm" /></video>');
119
120						});
121
122				// More button.
123					$banner.find('.more')
124						.addClass('scrolly');
125
126			}
127
128		// Tabs.
129			$('.flex-tabs').each( function() {
130
131				var t = jQuery(this),
132					tab = t.find('.tab-list li a'),
133					tabs = t.find('.tab');
134
135				tab.click(function(e) {
136
137					var x = jQuery(this),
138						y = x.data('tab');
139
140					// Set Classes on Tabs
141						tab.removeClass('active');
142						x.addClass('active');
143
144					// Show/Hide Tab Content
145						tabs.removeClass('active');
146						t.find('.' + y).addClass('active');
147
148					e.preventDefault();
149
150				});
151
152			});
153
154		// Scrolly.
155			$('.scrolly').scrolly({
156				offset: function() {
157					return $header.height() - 2;
158				}
159			});
160
161	});
162
163})(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.