PageSourceSearch

https://holocenedrilling.com/wp-content/themes/bullseyecreative/dist/js/navigation.js?ver=1.0.0

js holocenedrilling.com collected 2026-10-09 22:39:31 UTC 4,917 bytes, 169 lines download raw bytes

1/*!
2 * custom-wp-by-bullseye-creative v1.0.0
3 * A custom WordPress theme by Bullseye Creative
4 * (c) 2021
5 * ISC License
6 * http://link-to-your-git-repo.com
7 */
8
9var mnav = document.getElementById('mobile-navigation');
10
11document.addEventListener('click', (function (event) {
12
13	// If the clicked element doesn't have the right selector, bail
14	if (event.target.matches('#mobileNav-link')) {
15
16    // Don't follow the link
17  	event.preventDefault();
18
19    if (!mnav.classList.contains('visible')) {
20      mnav.classList.add('visible');
21      document.body.style.overflow = "hidden";
22    } else {
23      mnav.classList.remove('visible');
24      document.body.style.overflow = "auto";
25    }
26
27  } else if (event.target.matches('#mobile-navigation-close')) {
28
29    // Don't follow the link
30    event.preventDefault();
31
32    if (mnav.classList.contains('visible')) {
33      mnav.classList.remove('visible');
34      document.body.style.overflow = "auto";
35    }
36
37  }
38
39  return;
40
41}), false);
42
43// nav lock
44var nav = document.querySelector('header#masthead');
45var topVal = nav.getBoundingClientRect().top;
46var wrap = document.querySelector('.header-full-wrap');
47// Initial state
48var scrollPos = 0;
49var scrollDir = null;
50window.addEventListener('scroll', (function() {
51  toggleNavClass();
52
53  // detects new state and compares it with the old one
54  if ((document.body.getBoundingClientRect()).top > scrollPos) {
55    if (scrollDir != 'up') {
56      scrollDir = 'up';
57      nav.style.top = topVal + 'px';
58			wrap.style.top = topVal + 'px';
59    }
60  } else {
61    if (scrollDir != 'down' && window.pageYOffset > 75) {
62      scrollDir = 'down';
63      nav.style.top = topVal - 100 + 'px';
64			wrap.style.top = topVal - 100 + 'px';
65    }
66  }
67  // saves the new position for iteration.
68  scrollPos = (document.body.getBoundingClientRect()).top;
69}));
70
71function toggleNavClass() {
72  if (window.pageYOffset > 300) {
73    if (!nav.classList.contains('light')) {
74      nav.classList.add('light');
75			wrap.classList.add('reveal-wrap');
76    }
77  } else {
78    if (nav.classList.contains('light')) {
79      nav.classList.remove('light');
80			wrap.classList.remove('reveal-wrap');
81    }
82  }
83}
84
85setTimeout(bcNinjaFormsProgress, 1000);
86
87function bcNinjaFormsProgress(){
88	// Ninja Forms Progress Override
89	var startCard = document.getElementById("nf-form-5_3-cont");
90	var scSteps = document.querySelectorAll('.nf-breadcrumbs li');
91	var stepAdjustment;
92	if(startCard !== null){
93		if(scSteps.length == 3){
94			document.querySelector("div.nf-progress").style.width = "33%";
95			stepAdjustment = 33;
96		}else{
97			document.querySelector("div.nf-progress").style.width = "50%";
98			stepAdjustment = 50;
99		}
100	}
101}
102//
103// document.addEventListener("click", function(event){
104//
105// 	if(event.target.matches('#mobileNav-link')){
106// 		var crumbs = document.querySelectorAll('.nf-breadcrumbs li a');
107// 		for (var i = 0; i < crumbs.length; i++) {
108// 			crumbs[i].addEventListener("click", function(){
109// 				var position 				= this.dataset.index; // increment to match the step
110// 				position++;
111// 				var progress 				= stepAdjustment * position;
112// 				setTimeout(updateProgress, 1000, progress);
113//
114// 				function updateProgress(amt){
115// 					console.log(amt);
116// 					document.querySelector("div.nf-progress").style.width = amt+"%";
117// 				}
118// 			});
119// 		}
120// 	}
121// });
122
123document.addEventListener("click", (function(event){
124	if(event.target.matches('.nf-breadcrumb')){
125			var position 				= event.target.dataset.index;
126
127			setTimeout(updateProgress, 100, position);
128			function updateProgress(position){
129				var steps = document.querySelectorAll('.nf-breadcrumbs li');
130				position++;
131				if(steps.length == 3){
132					if (position == 3){ // last step
133						for (var i = 0; i < steps.length; i++) {
134							steps[i].classList.add('step-complete');
135						}
136						document.querySelector("div.nf-progress").style.width = "100%";
137					}
138					if (position == 2){
139						for (var i = 0; i < steps.length; i++) {
140							steps[i].classList.add('step-complete');
141						}
142						steps[2].classList.remove('step-complete');
143						document.querySelector("div.nf-progress").style.width = "66%";
144					}
145					if (position == 1){
146						steps[0].classList.add('step-complete');
147						steps[1].classList.remove('step-complete');
148						steps[2].classList.remove('step-complete');
149						document.querySelector("div.nf-progress").style.width = "33%";
150					}
151				}else{
152					if (position == 2){
153						for (var i = 0; i < steps.length; i++) {
154							steps[i].classList.add('step-complete');
155						}
156						steps[2].classList.remove('step-complete');
157						document.querySelector("div.nf-progress").style.width = "100%";
158					}
159					if (position == 1){
160						steps[0].classList.remove('step-complete');
161						steps[1].classList.add('step-complete');
162						steps[2].classList.add('step-complete');
163						document.querySelector("div.nf-progress").style.width = "50%";
164					}
165				}
166			}
167	}
168	return;
169}), false);

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.