PageSourceSearch

https://timothyfinancial.com/wp-content/themes/timothy/js/home.js?ver=v1654883863

js timothyfinancial.com collected 2026-10-04 02:59:24 UTC 7,869 bytes, 310 lines download raw bytes

1jQuery(function () {
2	window.scrollTo(0,0);
3
4	jQuery('.logo-full').addClass('animate');
5
6	setTimeout(function () {
7		jQuery('#slide-1 .fade-in-children').addClass('animate');
8	}, 500);
9
10	setTimeout(function () {
11		enableBodyScroll();
12		slide_listener();
13	}, 2000);
14
15	if (window.innerWidth <= 980) return;
16	disableBodyScroll();
17});
18jQuery(function () {
19	window.slide_listener = function () {
20		init();
21	};
22	window.get_current_slide = function() {
23		return current_slide;
24	};
25	window.get_move_to_hire_us = function() {
26		return move_to_hire_us;
27	};
28
29	function pop_up_circle(jq) {
30		var title = jq.find('h3');
31		var p = jq.find('p');
32		jq.addClass('transition-125 delay-0');
33		title.addClass('transition-25 delay-0');
34		setTimeout(function () {
35			jq.addClass('large');
36		}, 10);
37		setTimeout(function () {
38			jq.removeClass('large');
39			title.addClass('highlight');
40			p.addClass('highlight');
41		}, 125);
42		setTimeout(function () {
43			jq.removeClass('delay-0 transition-125');
44		}, 500);
45	}
46	function pop_up_circle_reverse(jq) {
47		jq.find('h3,p').removeClass('transition-25 delay-0 highlight');
48	}
49
50	var current_slide = 1;
51	var busy = false;
52	var jq_slides = jQuery('#home-slides');
53	var jq_body = jQuery('body');
54	var jq_circle_label = jQuery('#home-circles-label');
55
56	var last_used_position = 0;
57	function move_to_slide(next_slide) {
58		if (!busy) {
59			busy = true;
60
61			var ideal_position = 0;
62			if (next_slide >= 2) {
63				ideal_position = window.innerHeight * (next_slide - 1);
64				jQuery('#scroll-help').hide();
65			} else {
66				jQuery('#scroll-help').show();
67			}
68			window.scrollTo(0, ideal_position);
69			last_used_position = ideal_position;
70			disableBodyScroll();
71
72			if (next_slide == 1) {
73				jQuery('#home-slides > div').removeClass('interior-slides');
74			} else {
75				setTimeout(function() {
76					jQuery('#home-slides > div').addClass('interior-slides'); 
77				}, 500);
78			}
79
80			function do_pop_up() {
81				if (next_slide == 2) {
82					pop_up_circle(jQuery('#home-circle-1'));
83				} else if (next_slide == 3) {
84					pop_up_circle(jQuery('#home-circle-3'));
85				} else if (next_slide == 4) {
86					pop_up_circle(jQuery('#home-circle-2'));
87				}
88			}
89			function do_pop_up_reverse() {
90				if (current_slide == 2) {
91					pop_up_circle_reverse(jQuery('#home-circle-1'));
92				} else if (current_slide == 3) {
93					pop_up_circle_reverse(jQuery('#home-circle-3'));
94				} else if (current_slide == 4) {
95					pop_up_circle_reverse(jQuery('#home-circle-2'));
96				}
97			}
98
99			jq_slides.removeClass('current-slide-' + current_slide);
100			jq_body.removeClass('current-slide-' + current_slide);
101			jq_slides.addClass('current-slide-' + next_slide);
102			jq_body.addClass('current-slide-' + next_slide);
103
104			if (current_slide != 1) {
105				do_pop_up_reverse();
106			}
107
108			jQuery('#slide-' + current_slide).fadeOut(250, function () {
109				setTimeout(function () {
110					jQuery('#slide-' + next_slide)
111						.fadeIn(250)
112						.find('.fade-in-children')
113						.addClass('animate');
114				}, 1000);
115			});
116
117			if (next_slide > 1) {
118				if (current_slide == 1) {
119					setTimeout(function () {
120						jq_circle_label.addClass('visible');
121					}, 1500);
122				} else {
123					jq_circle_label.addClass('visible');
124				}
125			} else {
126				jq_circle_label.removeClass('visible');
127				jq_slides.removeClass('visible-text');
128			}
129
130			if (next_slide != 1) {
131				setTimeout(function () {
132					jq_slides.addClass('visible-text');
133				}, 1200);
134			}
135			if (current_slide == 1) {
136				setTimeout(function () {
137					do_pop_up();
138				}, 1200);
139			} else {
140				setTimeout(function () {
141					do_pop_up();
142				}, 1200);
143			}
144
145			setTimeout(function () {
146				busy = false;
147				current_slide = next_slide;
148				enableBodyScroll();
149				last_used_position = getPageScroll();
150			}, 1300);
151			return true;
152		}
153		return false;
154	}
155
156	var move_to_hire_us = true;
157	function init() {
158		setInterval(function () {
159			if (window.innerWidth <= 980) return;
160			var t = getPageScroll();
161			if (t <= 0)
162			return;
163
164			if (t > last_used_position) {
165				//move up to next slide
166				next_slide = current_slide + 1;
167				if (next_slide > 4) {
168					next_slide = 4;
169					if (move_to_hire_us) {
170						jQuery('body,html').animate({
171							scrollTop: jQuery('#home-hire-us').offset().top + 60
172						}, 1000);
173						move_to_hire_us = false;
174					}
175				}
176				if (current_slide != next_slide) {
177					move_to_slide(next_slide);
178				}
179			} else if (t < last_used_position) {
180					//move down to previous slide
181					next_slide = current_slide - 1;
182					if (next_slide < 1)
183						next_slide = 1;
184					if (next_slide <= 3)
185						move_to_hire_us = true; //this allows the scrolling to happen again
186					if (current_slide != next_slide)
187						move_to_slide(next_slide);
188			}
189		}, 50);
190	}
191});
192jQuery(function () {
193	//mobile - logo animation
194	var is_full_color = true;
195	var jq_full_logo = jQuery('#home-slides .logo-full');
196	var jq_header_logo = jQuery('header .logo');
197	var jq_header = jQuery('header');
198	setInterval(function () {
199		if (window.innerWidth > 980) return;
200		var t = getPageScroll();
201		if (t > 200) {
202			if (is_full_color) {
203				is_full_color = false;
204				jq_full_logo.addClass('slide-away');
205				jq_header_logo.addClass('fade-in');
206				jq_header.addClass('show-gradient');
207			}
208		} else if (!is_full_color) {
209			is_full_color = true;
210			jq_full_logo.removeClass('slide-away');
211			jq_header_logo.removeClass('fade-in');
212			jq_header.removeClass('show-gradient');
213		}
214	}, 100);
215});
216jQuery(function () {
217	//mobile - slide graphics
218	var lbl = '<div class="label">Timothy Financial Counsel</div>';
219
220	jQuery('.slide-graphic').each(function () {
221		var jq = jQuery(this);
222
223		var step = jq.data('step');
224
225		if (step == 1) {
226			var order = [0, 1, 2];
227		} else if (step == 2) {
228			var order = [2, 0, 1];
229		} else {
230			var order = [1, 2, 0];
231		}
232
233		var circle1 = jQuery('<div class="home-circle small fee-only" />');
234		circle1.append(jQuery('#home-circle-1').children().html());
235
236		var circle2 = jQuery('<div class="home-circle small diy" />');
237		circle2.append(jQuery('#home-circle-2').children().html());
238
239		var circle3 = jQuery('<div class="home-circle small wealth-management" />');
240		circle3.append(jQuery('#home-circle-3').children().html());
241
242		var circles = [circle1, circle2, circle3];
243
244		jq.append(circles[order[0]], circles[order[1]], circles[order[2]], lbl);
245
246		wait_for_visible(jq, function () {
247			jq.addClass('rotate-in');
248			setTimeout(function () {
249				jq.addClass('visible-text');
250			}, 750);
251		});
252	});
253});
254
255
256function enableBodyScroll() {
257	if (document.readyState === 'complete') {
258		document.body.style.position = '';
259		document.body.style.overflowY = '';
260		document.body.style.width = '';
261
262		if (document.body.style.marginTop) {
263			const scrollTop = -parseInt(document.body.style.marginTop, 10);
264			document.body.style.marginTop = '';
265			window.scrollTo(window.pageXOffset, scrollTop);
266		}
267	} else {
268		window.addEventListener('load', enableBodyScroll);
269	}
270}
271
272function disableBodyScroll() {
273	if (document.readyState === 'complete') {
274		if (document.body.scrollHeight > window.innerHeight) {
275			document.body.style.marginTop = `-${window.pageYOffset}px`;
276			document.body.style.position = 'fixed';
277			document.body.style.overflowY = 'scroll';
278			document.body.style.width = '100%';
279		}
280	} else {
281		window.addEventListener('load', () => disableBodyScroll());
282	}
283}
284
285jQuery(function() {
286	var scroll_dot = jQuery('#scroll-indicator span');
287	setInterval(function() {
288		var t = getPageScroll();
289		var h = document.body.clientHeight - window.innerHeight;
290		var perc = (t / h)*100;
291		if (perc > 100)
292			perc = 100;
293
294		if (typeof get_current_slide != 'undefined') {
295			if (get_move_to_hire_us()) {
296				var slide = get_current_slide();
297				if (slide == 1)
298					perc = 0;
299				if (slide == 2)
300					perc = 20;
301				else if (slide == 3)
302					perc = 40;
303				else if (slide == 4)
304					perc = 60;
305			}
306		}
307		
308		scroll_dot.css('top', perc + '%');
309	}, 60);
310});

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.