PageSourceSearch

https://beauforthousingnc.com/Portals/_default/Skins/obvio/resource/vendor/visible/visible.js?cdv=2058

js beauforthousingnc.com collected 2026-10-04 13:29:52 UTC 8,425 bytes, 270 lines download raw bytes

1 
2
3jQuery.fn.visible = function (partial) {
4	var $t = $(this),
5		$w = $(window),
6		viewTop = $w.scrollTop(),
7		viewBottom = viewTop + $w.height() * 0.85,
8		_top = $t.offset().top ? $t.offset().top : ($t.parent().length ? $t.parent().offset().top:0),
9		_bottom = _top + $t.height(),
10		compareTop = partial === true ? _bottom : _top,
11		compareBottom = partial === true ? _top : _bottom;
12	
13	if ($t.hasClass("visible")) {
14		return false
15	}
16	return ((compareBottom <= viewBottom) && (compareTop >= viewTop))
17};
18 
19jQuery.fn.dynamicnumbers = function (number, time, speed) {
20	var numbers = parseInt(number),
21		i = 0,
22		interval, $el = this,
23		times = time ? time : 1000,
24		speeds = speed ? speed : 20,
25		cent = RegExp(/[(\%)]+/).test(number) ? "%" : "";
26	var dynamic = function () {
27		if (i < numbers) {
28			i = Math.min(i + numbers / (times / speeds), numbers);
29			$el.css("min-width", Math.max(parseInt($el.width()), parseInt($el.css("min-width"))));
30			$el.data("separator") ? $el.text(String(parseInt(i)).replace(/(\d)(?=(?:\d{3})+$)/g, "$1,") + cent) : $el.text(parseInt(i) + cent)
31		} else {
32			$el.data("separator") ? $el.text(String(numbers).replace(/(\d)(?=(?:\d{3})+$)/g, "$1,") + cent) : $el.text(number);
33			clearTimeout(interval)
34		}
35	};
36	interval = setInterval(dynamic, speeds)
37};
38
39var animationType = {
40	width: function (el) {
41		delay = el.data("delay") !== undefined ? el.data("delay") : 400;
42		speed = el.data("speed") !== undefined ? el.data("speed") : 50;
43		el.css("width", el.attr("data-width"));
44		el.find("span").show().dynamicnumbers(el.attr("data-width"), delay, speed)
45	},
46	height: function (el) {
47		delay = el.data("delay") !== undefined ? el.data("delay") : 400;
48		speed = el.data("speed") !== undefined ? el.data("speed") : 50;
49		el.css("height", el.attr("data-height"));
50		el.find("span").show().dynamicnumbers(el.attr("data-height"), delay, speed)
51	},
52	number: function (el) {
53		delay = el.data("delay") !== undefined ? el.data("delay") : 1500;
54		speed = el.data("speed") !== undefined ? el.data("speed") : 50;
55		el.dynamicnumbers(el.attr("data-number"), delay, speed)
56	},
57	typewriter: function (el) {
58		var array = el.html().split("|");
59
60		var icolor = false;
61		if (el.data("color")) {
62			icolor = (el.data("color")).split("|")
63		}
64		if (icolor) {
65			if (icolor[0] === "none") {
66				el.removeAttr("style")
67			} else {
68				el.css("color", icolor[0])
69			}
70		}
71		if ($(window).width() < 768) {
72			el.html(array[0]);
73			return false;
74		}
75
76		var p_index = 0,
77			p_length = array.length;
78		var html = array[p_index],
79			index = 0,
80			time = 100,
81			l = html.length,
82			loop = el.data("loop") !== undefined ? el.data("loop") : true;
83		delay = el.data("delay") !== undefined ? el.data("delay") : 3000;
84		speed = el.data("speed") !== undefined ? el.data("speed") : 100;
85		el.addClass("active").html(" ");
86		var printer = function () {
87			if (index < l) {
88				index++;
89				if (html.slice(index, index + 1) === " ") {
90					clearInterval(stack);
91					setTimeout(function () {
92						stack = setInterval(printer, speed)
93					}, speed);
94				}
95				el.html(html.slice(0, index + 1));
96			} else {
97				if (loop || p_index < p_length - 1) {
98					clearInterval(stack);
99					setTimeout(function () {
100						stack = setInterval(delete_printer, 30)
101					}, delay);
102				} else {
103					clearInterval(stack);
104					el.removeClass("active")
105				}
106			}
107		};
108		var delete_printer = function () {
109			if (index > 0) {
110				el.html(html.slice(0, index - 1));
111				index--;
112			} else {
113				p_index = p_index <= p_length - 2 ? p_index + 1 : 0;
114				html = array[p_index];
115				l = html.length;
116				if (icolor) {
117					if (icolor[p_index] === "none") {
118						el.removeAttr("style")
119					} else {
120						el.css("color", icolor[p_index])
121					}
122				}
123				clearInterval(stack);
124				setTimeout(function () {
125					stack = setInterval(printer, time)
126				}, 300);
127			}
128		};
129		var stack = setInterval(printer, speed);
130
131	},
132	textslider: function (el) {
133		var speed = el.data("speed") ? el.data("speed") : 3000;
134		el.animate({
135			"width": el.find(".active").width() + 1
136		}, 400)
137
138		var textslide = function () {
139			if ($(window).width() <= 767) return false;
140			el.find("span").removeClass("previous");
141			var curr = el.find(".active");
142			curr.removeClass("active").addClass("previous");
143			if (curr.next().length !== 0) {
144				curr.next().addClass("active");
145			} else {
146				el.find("span").eq(0).addClass("active");
147			}
148			el.animate({
149				"width": el.find(".active").width() + 1
150			}, 400);
151		};
152
153		setInterval(textslide, speed);
154	},
155
156	iconsvg: function (el) {
157		if (typeof Vivus == "undefined") return false;
158		i = Math.random().toString(36).substr(2);
159		var id = "icon-svg-" + i;
160		el.find("svg").attr("id", id);
161		new Vivus(id, {
162			duration: 40,
163			type: "sync"
164		})
165
166	},
167	animationhover: function (el) {
168		var t = el.css("animation-duration");
169		t = t.indexOf("ms") > 0 ? parseInt(t) : parseInt(t) * 1000;
170		el.delay(t).queue(function () {
171			$(this).removeClass("animated").addClass("visible").on("mouseenter", function () {
172				if (!$(this).hasClass("animated")) {
173					$(this).addClass("animated").delay(t).queue(function () {
174						$(this).removeClass("animated").dequeue()
175					})
176				}
177			}).dequeue()
178		})
179	},
180	clip:function (el) {
181	}
182};
183var animationStart = function (el) {
184	type = el.attr("data-width") && "width" || el.attr("data-height") && "height" || el.attr("data-number") && "number" || el.hasClass("dg-typewriter") && "typewriter" || el.hasClass("dng-clip") && "clip" || el.hasClass("dng-clip-text") && "clip" || el.hasClass("text-slide") && "textslider" || (el.hasClass("icon-svg") && !el.attr("id") && el.find("svg").length) && "iconsvg" || el.hasClass("animationhover") && "animationhover" || false, t
184ype && animationType[type](el)
185};
186
187
188var addJsAnimation = function (element) {
189
190	function clipAnimation(e){
191
192
193		if(e.hasClass("dng-clip")){
194			e.find(".dng-clipping-shade").remove();
195			var shade = $('<span class="dng-clipping-shade">');
196			var data =	e.data("clipping");
197			if(!data) return;
198			if(data["bg"]){
199				shade.css({"background":data["bg"]});
200			}
201			if(data["duration"]){
202				e.css({"-webkit-animation-duration":data["duration"]+"ms","animation-duration":data["duration"]+"ms"});
203			}
204			if(data["timing"]){
205				e.css({"-webkit-animation-timing-function":data["timing"],"animation-timing-function":data["timing"]});
206			}
207			if(data["delay"]){ 
208				e.css({"-webkit-animation-delay":data["delay"]+"ms","animation-delay":data["delay"]+"ms"});
209			} 
210			if(! e.children().length && e.hasClass("dng-clip-text")){
211				e.wrapInner($('<span class="dng-clipping-wrapper">'));
212			}
213			e.append(shade);
214		}
215
216	}
217
218
219	if(typeof IntersectionObserver == "function"){ 
220		let observer = new IntersectionObserver( function(entries) {
221				entries.forEach(function(entry) {
222					if (entry.intersectionRatio > 0 && entry.intersectionRatio <= 1) {
223					var el = $(entry.target);
224						if(!el.hasClass("animated")){
225							animationStart(el);
226							el.removeClass("visible").addClass("animated");
227						}
228						observer.unobserve(entry.target);
229					}
230				})
231			},{threshold: [0.15]});
232
233			element.each(function(){
234				observer.observe(this);
235				clipAnimation($(this));
236			})
237	}else{
238
239		element.each(function (i, n) {
240			var el = $(n);
241			(el.visible(true) || el.parents(".triggerAnimation").length) && !el.hasClass("animated") && (animationStart(el), el.removeClass("visible").addClass("animated"));
242		});
243
244		var animationscroll = function (el, event) {
245			(el.visible(true) || el.parents(".triggerAnimation").length) && !el.hasClass("animated") && (animationStart(el), el.removeClass("visible").addClass("animated"), $(this).unbind(event))
246		};	
247
248		element.each(function () {
249			var e = $(this);
250
251			if ($(".dng-main").data("page-type") == "verticalfullpage") {
252				$(".dng-main").scroll(function (event) {
253					var w = $(this);
254					animationscroll(e, event)
255				})
256			} else {
257
258				$(window).scroll(function (event) {
259					var w = $(this);
260					animationscroll(e, event)
261				})
262			}
263			clipAnimation(e);
264		})
265	}
266};
267
268$(function(){
269	addJsAnimation($(".animation:not(.animated),.animationhover:not(.animated),.icon-svg:not(.animated),.css3-animate:not(.animated)"));
270});

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.