PageSourceSearch

https://www.wholesumclinic.com/wp-content/themes/uncode/library/js/utils.js?ver=1666377546

js wholesumclinic.com collected 2026-10-04 06:38:55 UTC 24,862 bytes, 764 lines download raw bytes

1(function($) {
2	"use strict";
3
4	window.requestAnimFrame = (function() {
5	return  window.requestAnimationFrame	   ||
6			window.webkitRequestAnimationFrame ||
7			window.mozRequestAnimationFrame	||
8			window.oRequestAnimationFrame	  ||
9			window.msRequestAnimationFrame	 ||
10			function(/* function */ callback, /* DOMElement */ element){
11				window.setTimeout(callback, 1000 / 60);
12			};
13})();
14
15window.requestTimeout = function(fn, delay) {
16	if( !window.requestAnimationFrame	  	&&
17		!window.webkitRequestAnimationFrame &&
18		!(window.mozRequestAnimationFrame && window.mozCancelRequestAnimationFrame) && // Firefox 5 ships without cancel support
19		!window.oRequestAnimationFrame	  &&
20		!window.msRequestAnimationFrame)
21			return window.setTimeout(fn, delay);
22
23	var start = new Date().getTime(),
24		handle = new Object();
25
26	function loop(){
27		var current = new Date().getTime(),
28			delta = current - start;
29
30		delta >= delay ? fn.call() : handle.value = requestAnimFrame(loop);
31	};
32
33	handle.value = requestAnimFrame(loop);
34	return handle;
35};
36
37window.clearRequestTimeout = function(handle) {
38	if ( typeof handle !== 'undefined' ) {
39		window.cancelAnimationFrame ? window.cancelAnimationFrame(handle.value) :
40		window.webkitCancelAnimationFrame ? window.webkitCancelAnimationFrame(handle.value) :
41		window.webkitCancelRequestAnimationFrame ? window.webkitCancelRequestAnimationFrame(handle.value) : /* Support for legacy API */
42		window.mozCancelRequestAnimationFrame ? window.mozCancelRequestAnimationFrame(handle.value) :
43		window.oCancelRequestAnimationFrame	? window.oCancelRequestAnimationFrame(handle.value) :
44		window.msCancelRequestAnimationFrame ? window.msCancelRequestAnimationFrame(handle.value) :
45		clearTimeout(handle);
46	}
47};
48
49function uncodeVisibilityChange() {
50	if (document.hidden) {
51		window.dispatchEvent(new CustomEvent('is-blur'));
52	} else {
53		window.dispatchEvent(new CustomEvent('is-focus'));
54	}
55  }
56document.addEventListener('visibilitychange', uncodeVisibilityChange, false);
57
58if ( SiteParameters.smoothScroll === 'on' && ! SiteParameters.is_frontend_editor ) {
59	window.lenis = new Lenis({
60		duration: 1
61	})
62
63	UNCODE.hDoc = Math.max( document.body.scrollHeight, document.body.offsetHeight, 
64		document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight );
65
66	function raf(time) {
67		window.lenis.raf(time)
68		requestAnimationFrame(raf)
69		window.dispatchEvent(new CustomEvent('lenis-scroll'));
70
71		if ( SiteParameters.uncode_smooth_scroll_safe ) {
72			var newHdoc = Math.max( document.body.scrollHeight, document.body.offsetHeight, 
73				document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight );
74			
75			if ( UNCODE.hDoc !== newHdoc ) {
76				UNCODE.hDoc = newHdoc;
77				window.lenis.resize();
78				//window.dispatchEvent(new CustomEvent('boxResized'));
79			}
80		}
81	}
82
83	requestAnimationFrame(raf)
84
85	$(window).on('unmodal-open uncode-sidecart-open', function(){
86		window.lenis.stop();
87	});
88
89	$(window).on('uncode-sidecart-closed', function(){
90		window.lenis.start();
91	});
92
93	$(document).on('unmodal-close', function(){
94		window.lenis.start();
95	});
96
97}
98
99var checkScrollTriggerRefresh;
100
101$(function(){
102	$(document).on('uncode-scrolltrigger-refresh', function(){
103		clearRequestTimeout(checkScrollTriggerRefresh);
104		checkScrollTriggerRefresh = requestTimeout(function(){
105			ScrollTrigger.refresh();
106			$('.scroll-refresh-hidden').removeClass('opacity_0');
107		}, 500);
108	});
109});
110
111UNCODE.checkImgLoad = function( src, cb, err, el ) {
112	var img = new Image();
113	img.onload = function () {
114		var result = (img.width > 0) && (img.height > 0);
115		cb(el);
116	};
117	img.onerror = function () {
118		err();
119	};
120	img.src = src
121};
122
123UNCODE.betterResize = function() {
124	var setResize,
125		doubleResize = true,
126		oldW = UNCODE.wwidth,
127		oldH = UNCODE.wheight,
128		setCTA;
129	$(window).on( 'resize orientationchange', function(){
130		if ( oldW === UNCODE.wwidth ) {
131			return;
132		} else {
133			oldW = UNCODE.wwidth;
134			$(window).trigger('wwResize');
135		}
136
137		if ( oldH === UNCODE.wheight ) {
138			return;
139		} else {
140			oldH = UNCODE.wheight;
141			$(window).trigger('whResize');
142		}
143	});
144
145	$(window).on( 'resize orientationchange', function(){
146		clearRequestTimeout(setCTA);
147		setCTA = requestTimeout( function(){ $(window).trigger('resize-int'); }, 100 );
148	});
149};
150
151UNCODE.shuffle = function(array) {
152	var currentIndex = array.length,
153		randomIndex;
154  
155	while (currentIndex > 0) {
156		randomIndex = Math.floor(Math.random() * currentIndex);
157		currentIndex--;
158		[array[currentIndex], array[randomIndex]] = [array[randomIndex], array[currentIndex]];
159	}
160  
161	return array;
162};
163
164Number.isInteger = Number.isInteger || function(value) {
165    return typeof value === "number" &&
166           isFinite(value) &&
167           Math.floor(value) === value;
168};
169
170UNCODE.utils = function() {
171	$(document).on('mouseover', 'a', function () {
172		if (!$(this).hasClass('star')) {
173			$(this).attr('data-title', $(this).attr('title'));
174			$(this).removeAttr('title');
175		}
176	});
177	$(document).on('mouseout', 'a', function () {
178		if (!$(this).hasClass('star')) {
179			$(this).attr('title', $(this).attr('data-title'));
180			$(this).removeAttr('data-title');
181		}
182	});
183
184	this.get_scroll_offset = function(e) {
185
186		var scroll_offset = 0,
187			target,
188			trigger;
189
190		if ( Number.isInteger(e) !== true && typeof e !== 'undefined' && typeof e.target !== 'undefined' && typeof e.currentTarget !== 'undefined' ) {
191			target = e.target;
192			trigger = e.currentTarget;
193		}
194
195		if ($('.menu-hide').length || $('.menu-hide-vertical').length) {
196			if (UNCODE.bodyTop > UNCODE.wheight / 2) {
197				UNCODE.hideMenu(100);
198			}
199		}
200
201		if ( ! $('body').hasClass('vmenu') || UNCODE.wwidth < UNCODE.mediaQuery ) {
202			// if  ( !( $('.menu-desktop-transparent').length && UNCODE.wwidth > UNCODE.mediaQuery ) && !( $('.menu-mobile-transparent').length && UNCODE.wwidth <= UNCODE.mediaQueryMobile ) ) {
203			if  ( !( $('.menu-desktop-transparent').length && UNCODE.wwidth > UNCODE.mediaQuery ) ) {
204				if ( ( $('.menu-sticky').length && !$('.menu-hide').length && !UNCODE.isMobile ) || ( $('.menu-sticky-mobile').length && UNCODE.isMobile && ! $('.menu-mobile-transparent').length ) ) {
205					if ( !$('.menu-hided').length ) {
206						if ( $('body').hasClass('hmenu-center') ) {
207							scroll_offset += ~~$('.menu-sticky .menu-container').outerHeight();
208						} else {
209							scroll_offset += ~~$('.logo-container:visible').outerHeight();
210						}
211					}
212				} else if ( $('.menu-sticky .menu-container:not(.menu-hide)').length && ! $('.menu-shrink').length && UNCODE.wwidth > UNCODE.mediaQuery ) {
213					var shrink = typeof $('.navbar-brand').data('padding-shrink') !== 'undefined' ?  $('.navbar-brand').data('padding-shrink')*2 : 36;
214					scroll_offset += (~~$('.menu-sticky .menu-container').outerHeight()) - ( $('.navbar-brand').data('minheight') + shrink );
215				} else {
216					if ( ($('.menu-sticky').length && !$('.menu-hide').length) || ($('.menu-sticky-vertical').length && !$('.menu-hide-vertical').length) ) {
217						scroll_offset += UNCODE.menuMobileHeight;
218					} else {
219						if ( typeof target !== 'undefined' && target.closest('.main-menu-container') != null && UNCODE.wwidth < UNCODE.mediaQuery && ! $('body').hasClass('vmenu') && ! $('body').hasClass('menu-mobile-transparent') && ! $('.menu-sticky').length ) {
220							//scroll_offset += $('.main-menu-container > div:first-child()').height() - 2;
221						} else {
222							if ( $(trigger)[0] !== $(document)[0] && $(trigger).length && typeof $(trigger).offset() !== 'undefined' && window.scrollY > ($(trigger).offset().top + UNCODE.menuMobileHeight) ) {
223								scroll_offset += UNCODE.menuMobileHeight;
224							}
225						}
226					}
227				}
228			}
229
230		}
231
232		scroll_offset += UNCODE.bodyBorder;
233
234		return scroll_offset;
235	}
236
237	if ( !UNCODE.isFullPage ) {
238		$(document).on('click', 'a[href*="#"]:not(.woocommerce-review-link):not(.one-dot-link)', function(e) {
239
240			var hash = (e.currentTarget).hash,
241			is_scrolltop = $(e.currentTarget).hasClass('scroll-top') ? true : false,
242			anchor = '';
243			if ($(e.currentTarget).data('toggle') == 'tab' || $(e.currentTarget).data('toggle') == 'collapse') return;
244			if ($(e.currentTarget).hasClass('woocommerce-review-link') && $('.wootabs .tab-content').length) {
245				e.preventDefault();
246				if (!$('#tab-reviews').is(':visible')) {
247					$('a[href="#tab-reviews"]').trigger('click');
248				}
249				var calc_scroll = $('.wootabs .tab-content').offset().top;
250				calc_scroll -= UNCODE.get_scroll_offset(e);
251
252				if  ( !( $('.menu-desktop-transparent').length && UNCODE.wwidth > UNCODE.mediaQuery ) && !( $('.menu-mobile-transparent').length && UNCODE.wwidth <= UNCODE.mediaQueryMobile ) ) {
253					var shrink = typeof $('.navbar-brand').data('padding-shrink') !== 'undefined' ?  $('.navbar-brand').data('padding-shrink')*2 : 36;
254
255					if ( $('.menu-sticky .menu-container:not(.menu-hide)').length && $('.menu-shrink').length ) {
256						scrollTo += UNCODE.menuHeight - ( $('.navbar-brand').data('minheight') + shrink );
257					}
258				}
259
260				var bodyTop = document.documentElement['scrollTop'] || document.body['scrollTop'],
261					delta = bodyTop - calc_scroll,
262					scrollSpeed = (SiteParameters.constant_scroll == 'on') ? Math.abs(delta) / parseFloat(SiteParameters.scroll_speed) : SiteParameters.scroll_speed;
263				if (scrollSpeed < 1000 && SiteParameters.constant_scroll == 'on') scrollSpeed = 1000;
264
265				requestTimeout(function(){
266					if (scrollSpeed == 0) {
267						$('html, body').scrollTop(calc_scroll);
268						UNCODE.scrolling = false;
269					} else {
270   						$('html, body').on("scroll wheel DOMMouseScroll mousewheel touchmove", function(){
271							$(this).stop();
272						}).animate({
273								scrollTop: calc_scroll
274							}, scrollSpeed, 'easeInOutCubic', function() {
275								$(this).off("scroll wheel DOMMouseScroll mousewheel touchmove");
276								UNCODE.scrolling = false;
277							}
278						);
279					}
280				}, 200);
281				return;
282			}
283			if (hash != undefined) {
284				var specialFormat = /[ !@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/;
285				var anchor = this.hash.slice(1);
286				if ( !specialFormat.test(hash) && location.pathname.replace(/^\//g,'') == this.pathname.replace(/^\//g,'') && location.hostname == this.hostname) {
287			  		if ( !specialFormat.test(hash) ) {
288			  			if ( $(hash).length )
289			  				anchor = $(hash);
290			  		}
291				}
292			}
293
294			if (is_scrolltop || anchor != '') {
295				if (is_scrolltop) {
296					e.preventDefault();
297					var bodyTop = document.documentElement['scrollTop'] || document.body['scrollTop'],
298					scrollSpeed = (SiteParameters.constant_scroll == 'on') ? Math.abs(bodyTop) / parseFloat(SiteParameters.scroll_speed) : SiteParameters.scroll_speed;
299					if (scrollSpeed < 1000 && SiteParameters.constant_scroll == 'on') scrollSpeed = 1000;
300
301					if (scrollSpeed == 0) {
302						$('html, body').scrollTop(0);
303						UNCODE.scrolling = false;
304					} else {
305   						$('html, body').on("scroll wheel DOMMouseScroll mousewheel touchmove", function(){
306							$(this).stop();
307						}).animate({
308							scrollTop: 0
309						}, scrollSpeed, 'easeInOutCubic', function() {
310							$(this).off("scroll wheel DOMMouseScroll mousewheel touchmove");
311							UNCODE.scrolling = false;
312						});
313					}
314				} else {
315					var scrollSection = (typeof anchor === 'string') ? $('[data-name="' + anchor + '"]') : anchor;
316					$.each($('.menu-container .menu-item > a, .widget_nav_menu .menu-smart .menu-item > a, #uncode-mobile-menu-block .menu-item > a'), function(index, val) {
317						var get_href = $(val).attr('href');
318						if (get_href != undefined) {
319							if (get_href.substring(get_href.indexOf('#')+1) == anchor) $(val).parent().addClass('active');
320							else $(val).parent().removeClass('active');
321						}
322					});
323					if (scrollSection.length) {
324						if ( $('body').hasClass('uncode-scroll-no-history') ) {
325							e.preventDefault();
326						}
327
328						if (UNCODE.menuOpened) {
329							if (UNCODE.wwidth < UNCODE.mediaQuery) {
330								window.dispatchEvent(UNCODE.menuMobileTriggerEvent);
331							} else {
332								$('.mmb-container-overlay .overlay-close').trigger('click');
333								$('.mmb-container .trigger-overlay.close')[0].dispatchEvent(new Event("click"));;
334							}
335						}
336
337						var calc_scroll = scrollSection.offset().top,
338							getOffset = UNCODE.get_scroll_offset(e),
339							$logo = $('.logo-container:visible'),
340							logoH,
341							$menu = $('#masthead .menu-container'),
342							menuH;
343
344						calc_scroll -= isNaN(getOffset) ? 0 : getOffset;
345
346						var bodyTop = document.documentElement['scrollTop'] || document.body['scrollTop'],
347							delta = bodyTop - calc_scroll,
348							scrollSpeed = (SiteParameters.constant_scroll == 'on') ? Math.abs(delta) / parseFloat(SiteParameters.scroll_speed) : SiteParameters.scroll_speed;
349						if (scrollSpeed < 1000 && SiteParameters.constant_scroll == 'on') scrollSpeed = 1000;
350
351						if  ( !( $('.menu-desktop-transparent').length && UNCODE.wwidth > UNCODE.mediaQuery ) && !( $('.menu-mobile-transparent').length && UNCODE.wwidth <= UNCODE.mediaQueryMobile ) ) {
352							if ( $('.menu-sticky .menu-container:not(.menu-hide)').length && ! $('.menu-shrink').length && ! $('body').hasClass('vmenu') && UNCODE.wwidth > UNCODE.mediaQuery ) {
353								logoH = $logo.outerHeight(),
354								menuH = $menu.outerHeight();
355								if ( calc_scroll < ( logoH + menuH ) ) {
356									calc_scroll = 0;
357								}
358							}
359						}
360
361						if ( UNCODE.menuStickyMobileOverlay === false && UNCODE.isMobile ) {
362							calc_scroll = calc_scroll - parseFloat( $('.overlay.overlay-menu').outerHeight() );
363						}
364
365						if (scrollSpeed == 0) {
366							$('html, body').scrollTop(calc_scroll);
367							UNCODE.scrolling = false;
368						} else {
369	   						$('html, body').on("scroll wheel DOMMouseScroll mousewheel touchmove", function(){
370								$(this).stop();
371							}).animate({
372								scrollTop: (delta > 0) ? calc_scroll - 0.1 : calc_scroll
373							}, scrollSpeed, 'easeInOutCubic', function() {
374								$(this).off("scroll wheel DOMMouseScroll mousewheel touchmove");
375								UNCODE.scrolling = false;
376								if  ( ( getOffset != UNCODE.get_scroll_offset(e) && !( $('.menu-desktop-transparent').length && UNCODE.wwidth > UNCODE.mediaQuery ) && !( $('.menu-mobile-transparent').length && UNCODE.wwidth <= UNCODE.mediaQueryMobile ) )
377								||
378								$('.menu-hided').length ) {
379									calc_scroll = scrollSection.offset().top;
380									getOffset = UNCODE.get_scroll_offset(e);
381									calc_scroll -= getOffset;
382									$('html, body').on("scroll wheel DOMMouseScroll mousewheel touchmove", function(){
383										$(this).stop();
384									}).animate({
385										scrollTop: (delta > 0) ? calc_scroll - 0.1 : calc_scroll
386										}, scrollSpeed, 'easeInOutCubic', function() {
387											$(this).off("scroll wheel DOMMouseScroll mousewheel touchmove");
388											UNCODE.scrolling = false;
389										}
390									);
391								}
392							});
393						}
394					}
395				}
396			}
397		});
398		$('.header-scrolldown').on('click', function(event) {
399
400			event.preventDefault();
401
402			var pageHeader = $(event.target).closest('#page-header'),
403				pageHeaderTop = pageHeader.offset().top,
404				pageHeaderHeight = pageHeader.outerHeight(),
405				scrollSpeed = (SiteParameters.constant_scroll == 'on') ? Math.abs(pageHeaderTop + pageHeaderHeight) / parseFloat(SiteParameters.scroll_speed) : SiteParameters.scroll_speed;
406			if (scrollSpeed < 1000 && SiteParameters.constant_scroll == 'on') scrollSpeed = 1000;
407
408			var calc_scroll = pageHeaderTop + pageHeaderHeight,
409			getOffset = UNCODE.get_scroll_offset(event);
410			calc_scroll -= getOffset;
411
412			if  ( !( $('.menu-desktop-transparent').length && UNCODE.wwidth > UNCODE.mediaQuery ) && !( $('.menu-mobile-transparent').length && UNCODE.wwidth <= UNCODE.mediaQueryMobile ) ) {
413				var shrink = typeof $('.navbar-brand').data('padding-shrink') !== 'undefined' ?  $('.navbar-brand').data('padding-shrink')*2 : 36;
414
415				if ( $('.menu-sticky .menu-container:not(.menu-hide)').length && $('.menu-shrink').length ) {
416					scrollTo += UNCODE.menuHeight - ( $('.navbar-brand').data('minheight') + shrink );
417				}
418			}
419
420			if (scrollSpeed == 0) {
421				$('html, body').scrollTop(calc_scroll);
422				UNCODE.scrolling = false;
423			} else {
424					$('html, body').on("scroll wheel DOMMouseScroll mousewheel touchmove", function(){
425						$(this).stop();
426					}).animate({
427						scrollTop: calc_scroll
428					}, scrollSpeed, 'easeInOutCubic', function() {
429						$(this).off("scroll wheel DOMMouseScroll mousewheel touchmove");
430						UNCODE.scrolling = false;
431						if (getOffset != UNCODE.get_scroll_offset(event) || $('.menu-hided').length) {
432							calc_scroll = pageHeaderTop + pageHeaderHeight;
433							getOffset = UNCODE.get_scroll_offset(event);
434							calc_scroll -= getOffset;
435								$('html, body').on("scroll wheel DOMMouseScroll mousewheel touchmove", function(){
436									$(this).stop();
437								}).animate({
438									scrollTop: calc_scroll
439								}, scrollSpeed, 'easeInOutCubic', function() {
440									$(this).off("scroll wheel DOMMouseScroll mousewheel touchmove");
441									UNCODE.scrolling = false;
442								}
443							);
444						}
445					}
446				);
447			}
448		});
449	}
450
451	// Colomun hover effect
452	// =================
453	$(document).on('mouseenter', '.col-link', function(e) {
454		var uncol = $(e.target).prev('.uncol'),
455		el = uncol.find('.column-background');
456		if (el) {
457			$('.btn-container .btn', uncol).addClass('active');
458			var elOverlay = $(el[0]).find('.block-bg-overlay');
459			if (elOverlay.length) {
460				var getOpacity = $(elOverlay).css('opacity');
461				if (getOpacity != 1) {
462					getOpacity = Math.round(getOpacity * 100) / 100;
463					var newOpacity = getOpacity + .1;
464					$(elOverlay).data('data-opacity', getOpacity);
465					$(elOverlay).css('opacity', newOpacity);
466				}
467			}
468		}
469	}).on('mouseleave', '.col-link', function(e) {
470		var uncol = $(e.target).prev('.uncol'),
471		el = uncol.find('.column-background');
472		$('.btn-container .btn', uncol).removeClass('active');
473		if (el) {
474			var elOverlay = $(el[0]).find('.block-bg-overlay');
475			if (elOverlay.length) {
476				var getOpacity = $(elOverlay).data('data-opacity');
477				$(elOverlay).css('opacity', getOpacity);
478			}
479		}
480	});
481
482	// Admin bar
483	// ============
484	var fixAdminBar = function() {
485		if ($('html').hasClass('admin-mode') && !SiteParameters.is_frontend_editor ) {
486			var getAdminBar = $('#wpadminbar');
487			if (getAdminBar.length) {
488				if (getAdminBar.css('position') !== 'hidden') {
489					var getAdminBarHeight = getAdminBar.height();
490					if (getAdminBar.css('position') === 'fixed') {
491						$('html').css({'margin-top':getAdminBarHeight + 'px','padding-top': UNCODE.bodyBorder+'px'});
492						$('.body-borders .top-border').css({'margin-top':getAdminBarHeight+'px'});
493					} else {
494						$('html').css({'padding-top':UNCODE.bodyBorder + 'px','margin-top':'0px'});
495						$('.body-borders .top-border').css({'margin-top':'0px'});
496					}
497				}
498			}
499		}
500	};
501	window.addEventListener('load', fixAdminBar);
502	window.addEventListener('resize', fixAdminBar);
503	// Print
504	// ===========
505	var beforePrint = function() {
506		window.dispatchEvent(new CustomEvent('resize'));
507		window.dispatchEvent(UNCODE.boxEvent);
508	};
509
510	if (window.matchMedia) {
511		var mediaQueryList = window.matchMedia('print');
512		mediaQueryList.addListener(function(mql) {
513			if (mql.matches) {
514				beforePrint();
515			}
516		});
517	}
518
519	window.onbeforeprint = beforePrint;
520
521	// Safari srcset
522	var safariSrcSet = function(){
523		if ( !SiteParameters.is_frontend_editor ) {
524			$('html.safari img[sizes]').each(function(){
525				var $img = $(this),
526					sizeImg = parseInt($img.attr('sizes'));
527				if ( typeof(sizeImg) === 'number' ) {
528					$img.attr('sizes', (sizeImg) + 'px');
529				}
530			});
531		}
532	};
533	window.addEventListener('load', safariSrcSet);
534}
535
536UNCODE.lettering = function() {
537
538	var setCTA;
539	var highlightStill = function(){
540
541		var $heading_texts = $('.heading-text:not(.animate_inner_when_almost_visible)');
542
543		$.each($heading_texts, function(key, el) {
544			var $heading = $(el);
545
546			if ( ! $('.heading-text-highlight-inner[data-animated="yes"]', $heading).length ) {
547				return;
548			}
549
550			if (UNCODE.isUnmodalOpen && !el.closest('#unmodal-content')) {
551				return;
552			}
553
554			var waypoint = new Waypoint({
555				context: UNCODE.isUnmodalOpen ? document.getElementById('unmodal-content') : window,
556				element: el,
557				handler: function() {
558					var $anims = $('.heading-text-highlight-inner[data-animated="yes"]', this.element),
559						anims_l = $anims.length;
560					$anims.each(function(_key_, _el_){
561						var $anim = $(_el_);
562
563						if ( ! $anim.hasClass('heading-text-highlight-animated') ) {
564							$anim.addClass('heading-text-highlight-animated');
565
566							if ( $heading.data('animate') === true ) {
567								$anim.css({
568									'-webkit-transition-duration': '0ms',
569									'-moz-transition-duration': '0ms',
570									'-o-transition-duration': '0ms',
571									'transition-duration': '0ms',
572								});
573							} else {
574								$anim.css({
575									'-webkit-transition-delay': ((_key_ + 2) * 200) + 'ms',
576									'-moz-transition-delay': ((_key_ + 2) * 200) + 'ms',
577									'-o-transition-delay': ((_key_ + 2) * 200) + 'ms',
578									'transition-delay': ((_key_ + 2) * 200) + 'ms',
579								});
580							}
581						}
582
583					});
584					$anims.last().one('webkitTransitionEnd oTransitionEnd mozTransitionEnd msTransitionEnd transitionEnd', function(e) {
585						$heading.data('animate', true);
586					});
587					$anims.removeAttr('data-animated');
588				},
589				offset: '100%'
590			});
591
592		});
593
594		Waypoint.refreshAll();
595		$( document.body ).trigger('uncode_waypoints');
596		if ( typeof ScrollTrigger !== 'undefined' && ScrollTrigger !== null ) {
597			$(document).trigger('uncode-scrolltrigger-refresh');
598		}
599
600	}
601
602	requestTimeout(function(){
603		highlightStill();
604		$(window).on( 'wwResize', function(){
605			clearRequestTimeout(setCTA);
606			setCTA = requestTimeout( highlightStill, 100 );
607		});
608	}, 400);
609
610};
611
612UNCODE.isUnmodalOpen = false;
613
614var manageVideoSize = function(){
615
616	var setVideoFit;
617	$('.wp-block-embed').each(function(){
618
619		var $this = $(this);
620
621		if ( $('iframe', $this).length ) {
622
623			var $iframe = $('> iframe, > a > iframe', $this),
624				w = parseFloat($iframe.attr('width')),
625				h = parseFloat($iframe.attr('height')),
626				url = $iframe.attr('src'),
627				ratio, frW;
628
629			if ( typeof url != 'undefined' && url.indexOf('soundcloud') == -1 && h !== 0  ) {
630
631				ratio = h / w;
632				var setResizeiFto,
633					resizeiFrame = function(){
634					frW = $iframe.width();
635					$iframe.css({
636						height: frW * ratio
637					});
638				};
639				resizeiFrame();
640				$(window).on( 'wwResize load', function(){
641					clearRequestTimeout(setResizeiFto);
642					setResizeiFto = requestTimeout( function() {
643						resizeiFrame();
644					}, 10 );
645				});
646
647			}
648
649		}
650
651	});
652
653};
654
655manageVideoSize();
656
657UNCODE.vivus = function(icon, time, delay, file) {
658	if (typeof Vivus !== 'undefined') {
659		var icon_options = {
660			type: 'delayed',
661			pathTimingFunction: Vivus.EASE_OUT,
662			animTimingFunction: Vivus.LINEAR,
663			duration: time,
664		}
665
666		if (delay) {
667			icon_options.delayStart = delay;
668		}
669
670		if (file) {
671			icon_options.file = file;
672		}
673
674		new Vivus(icon, icon_options);
675	}
676};
677
678UNCODE.lastURL = '';
679
680UNCODE.getURLParams = function(current_location, is_string) {
681	var params = {};
682	if (is_string) {
683		var url = current_location.split('?')[1];
684	} else {
685		var url = current_location.search;
686		url = url.substring(1);
687	}
688	if (url) {
689		var parts = url.split('&');
690		for (var i = 0; i < parts.length; i++) {
691			var nv = parts[i].split('=');
692			if (!nv[0]) {
693				continue;
694			}
695			params[nv[0]] = nv[1] || true;
696		}
697	}
698	return params;
699}
700
701UNCODE.hasEqualURLParams = function(obj1, obj2) {
702	for (var i in obj1) {
703		if (obj1.hasOwnProperty(i)) {
704			if (!obj2.hasOwnProperty(i)) {
705				return false;
706			}
707			if (obj1[i] != obj2[i]) {
708				return false;
709			}
710		}
711	}
712	for (var i in obj2) {
713		if (obj2.hasOwnProperty(i)) {
714			if (!obj1.hasOwnProperty(i)) {
715				return false;
716			}
717			if (obj1[i] != obj2[i]) {
718				return false;
719			}
720		}
721	}
722    return true;
723}
724
725UNCODE.magnetic = function(){
726	
727	$(document).on('mousemove', '.un-magnetic-zone', function(e){
728
729		var $zone = $(this),
730			zoneOff = $zone.offset(),
731			$mgntcEl = $('.un-magnetic-el', this),
732			elBound = this.getBoundingClientRect(),
733			maxSize = Math.max($zone.outerWidth(), $zone.outerHeight());
734
735		var Xvalue = e.pageX - (zoneOff.left + maxSize / 2),
736	  		Yvalue = e.pageY - (zoneOff.top + maxSize / 2);
737	  
738		$mgntcEl.each(function(key, val){
739			var magneticValue = $(val).attr('data-mgntc') || 0.5;
740		
741			val.animate({
742				transform: 'translate(' + (Xvalue * magneticValue) + '%, ' + (Yvalue * magneticValue) + '%)',
743			},{
744				duration: 500,
745				fill: 'forwards',
746			})
747	  	});
748	})
749	
750	$(document).on('mouseleave', '.un-magnetic-zone', function(e){
751		var $mgntcEl = $('.un-magnetic-el', this);
752
753		$mgntcEl.each(function(key, val){
754			val.animate({
755		  		transform: 'translate(0)',
756			},{
757		  		duration: 500,
758		  		fill: 'forwards',
759			})
760	  	});
761	})
762};
763
764})(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.