PageSourceSearch

https://visapourlimage.com/wp-content/themes/uncode/library/js/utils.js?ver=342899567

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