PageSourceSearch

https://cyfrowarepublika.pl/wp-content/themes/recond/assets/js/scripts.js?ver=1.0

js cyfrowarepublika.pl collected 2026-10-08 12:02:51 UTC 37,619 bytes, 1,402 lines download raw bytes

1"use strict";
2
3jQuery(document).on('ready', function() { 
4
5	initSwiper();
6	initEvents();
7	initStyles();
8	initMap();
9	initCollapseMenu();	
10	checkCountUp();	
11	initScrollReveal();
12	initCountDown();
13	initPortfolio();
14	initTracks();
15});
16
17jQuery(window).on('scroll', function (event) {
18
19	checkNavbar();
20	checkGoTop();
21	checkScrollAnimation();
22}).scroll();
23
24jQuery(window).on('load', function(){
25
26	initMasonry();
27	initParallax();
28});
29
30jQuery(window).on("resize", function () {
31
32	setResizeStyles();
33}).resize();
34
35
36
37/* Navbar menu initialization */
38function initCollapseMenu() {
39
40	var navbar = jQuery('#navbar'),
41		navbar_toggle = jQuery('.navbar-toggle'),
42		navbar_wrapper = jQuery("#nav-wrapper");
43
44    navbar_wrapper.on('click', '.navbar-toggle', function (e) {
45
46        navbar_toggle.toggleClass('collapsed');
47        navbar.toggleClass('collapse');
48        navbar_wrapper.toggleClass('mob-visible');
49    });
50
51	// Anchor mobile menu
52	navbar.on('click', '.menu-item-type-custom > a', function(e) {
53
54		if ( typeof jQuery(this).attr('href') !== 'undefined' && jQuery(this).attr('href') !== '#' && ( jQuery(this).attr('href').charAt(0) === '#' || jQuery(this).attr('href').charAt(0) === '/' ) )  {
55
56
57	        navbar_toggle.addClass('collapsed');
58	        navbar.addClass('collapse');
59	        navbar_wrapper.removeClass('mob-visible');
60    	}  	    
61    });
62
63    navbar.on('click', '.menu-item-has-children > a', function(e) {
64
65    	var el = jQuery(this);
66
67    	if (!el.closest('#navbar').hasClass('collapse')) {
68
69    		if ((el.attr('href') === undefined || el.attr('href') === '#') || e.target.tagName == 'A') {
70
71		    	el.next().toggleClass('show');
72		    	el.parent().toggleClass('show');
73
74		    	return false;
75		    }
76	    }
77    });
78
79    var lastWidth;
80    jQuery(window).on("resize", function () {
81
82    	checkNavbar();
83
84    	var winWidth = jQuery(window).width(),
85    		winHeight = jQuery(window).height();
86
87       	lastWidth = winWidth;
88    });	
89}
90
91/* Navbar attributes depends on resolution and scroll status */
92function checkNavbar() {
93
94	var navbar = jQuery('#navbar'),
95		scroll = jQuery(window).scrollTop(),
96    	navBar = jQuery('nav.navbar:not(.no-dark)'),
97    	topBar = jQuery('.ltx-topbar-block'),
98    	navbar_toggle = jQuery('.navbar-toggle'),
99    	navbar_wrapper = jQuery("#nav-wrapper"),
100	    slideDiv = jQuery('.slider-full'),
101	    winWidth = jQuery(window).width(),
102    	winHeight = jQuery(window).height(),
103		navbar_mobile_width = navbar.data('mobile-screen-width');
104
105   	if ( winWidth < navbar_mobile_width ) {
106
107		navbar.addClass('navbar-mobile').removeClass('navbar-desktop');
108	}
109		else {
110
111		navbar.addClass('navbar-desktop').removeClass('navbar-mobile');
112	}
113
114	navbar_wrapper.addClass('inited');
115
116	if ( topBar.length ) {
117
118		navBar.data('offset-top', topBar.height());
119	}
120
121    if (winWidth > navbar_mobile_width && navbar_toggle.is(':hidden')) {
122
123        navbar.addClass('collapse');
124        navbar_toggle.addClass('collapsed');
125        navbar_wrapper.removeClass('mob-visible');
126    }
127
128    jQuery("#nav-wrapper.navbar-layout-transparent + .page-header, #nav-wrapper.navbar-layout-transparent + .main-wrapper").css('margin-top', '-' + navbar_wrapper.height() + 'px');
129
130
131    if (scroll > 1) navBar.addClass('dark'); else navBar.removeClass('dark');
132}
133
134
135/* Check GoTop Visibility*/
136function checkGoTop() {
137
138	var gotop = jQuery('.ltx-go-top'),
139		scrollBottom = jQuery(document).height() - jQuery(window).height() - jQuery(window).scrollTop();
140
141	if ( gotop.length ) {
142
143		if ( jQuery(window).scrollTop() > 100 ) {
144
145			gotop.addClass('show');
146		}
147			else {
148
149			gotop.removeClass('show');
150    	}
151
152    	if ( scrollBottom < 50 ) {
153
154    		gotop.addClass('scroll-bottom');
155    	}
156    		else {
157
158    		gotop.removeClass('scroll-bottom');
159   		}
160	}	
161}
162
163/* All keyboard and mouse events */
164function initEvents() {
165
166	setTimeout(function() { if ( typeof Pace !== 'undefined' ) { Pace.stop(); }  }, 3000);	
167
168
169	var $sections = jQuery('#entry-div > *');
170	var $currentSection;
171	jQuery(window).scroll(function(){
172
173		var currentScroll = jQuery(this).scrollTop();
174
175		$sections.each(function(){
176			var divPosition = jQuery(this).offset().top;
177
178			if( divPosition - 1 < currentScroll ){
179				$currentSection = jQuery(this);
180			}
181
182			var id = $currentSection.attr('id');
183			if (typeof id !== "undefined") {
184
185				jQuery('#menu-main-menu > li').removeClass('current-menu-ancestor current-menu-parent current-menu-item current_page_item ');
186				jQuery('a[href="#'+id+'"]').parent().addClass('current-menu-parent current-menu-item current_page_item ');
187			}
188		  
189		})
190	});
191
192	jQuery('.swipebox.photo').magnificPopup({type:'image', gallery: { enabled: true }}
192);
193	jQuery('.swipebox.image-video').magnificPopup({type:'iframe'});
194
195	initMenuFilter();
196
197	if (!/Mobi/.test(navigator.userAgent) && jQuery(window).width() > 768) {
198
199		jQuery('.matchHeight').matchHeight();
200		jQuery('.items-matchHeight article').matchHeight();
201	}	
202
203	// WooCommerce grid-list toggle
204	jQuery('.gridlist-toggle').on('click', 'a', function() {
205
206		jQuery('.matchHeight').matchHeight();
207	});
208
209	jQuery('.menu-types').on('click', 'a', function() {
210
211		var el = jQuery(this);
212
213		el.addClass('active').siblings('.active').removeClass('active');
214		el.parent().find('.type-value').val(el.data('value'));
215
216		return false;
217	});
218
219	/* Scrolling to navbar from "go top" button in footer */
220    jQuery('.ltx-go-top').on('click', function() {
221
222	    jQuery('html, body').animate({ scrollTop: 0 }, 1200);
223
224	    return false;
225	});
226
227    jQuery('.alert').on('click', '.close', function() {
228
229	    jQuery(this).parent().fadeOut();
230	    return false;
231	});	
232
233	jQuery(".topbar-icons.mobile, .topbar-icons.icons-hidden")
234		.mouseover(function() {
235
236			jQuery('.topbar-icons.icons-hidden').addClass('show');
237			jQuery('#navbar').addClass('muted');
238		})
239		.mouseout(function() {
240			jQuery('.topbar-icons.icons-hidden').removeClass('show');
241			jQuery('#navbar').removeClass('muted');
242	});
243
244	// TopBar Search
245    var searchHandler = function(event){
246
247        if (jQuery(event.target).is(".top-search, .top-search *")) return;
248        jQuery(document).off("click", searchHandler);
249        jQuery('.top-search').removeClass('show-field');
250        jQuery('#navbar').removeClass('muted');
251    }
252
253    jQuery('#top-search-ico-close').on('click', function (e) {
254
255		jQuery(this).parent().toggleClass('show-field');
256		jQuery('#navbar').toggleClass('muted');    	
257    });
258
259	jQuery('#top-search-ico').on('click', function (e) {
260
261		e.preventDefault();
262		jQuery(this).parent().toggleClass('show-field');
263		jQuery('#navbar').toggleClass('muted');
264
265        if (jQuery(this).parent().hasClass('show-field')) {
266
267        	jQuery(document).on("click", searchHandler);
268        }
269        	else {
270
271        	jQuery(document).off("click", searchHandler);
272        }
273	});
274
275	var search_href = jQuery('.top-search').data('base-href');
276
277	jQuery('.top-search input').keypress(function (e) {
278		if (e.which == 13) {
279			window.location = search_href + '?s=' + jQuery('.top-search input').val();
280			return false;
281		}
282	});
283
284	jQuery('.ltx-navbar-search span').on('click', function (e) {
285		window.location = search_href + '?s=' + jQuery('.ltx-navbar-search input').val();
286	});	
287
288	jQuery('.woocommerce').on('click', 'div.quantity > span', function(e) {
289
290		var f = jQuery(this).siblings('input');
291		if (jQuery(this).hasClass('more')) {
292			f.val(Math.max(0, parseInt(f.val()))+1);
293		} else {
294			f.val(Math.max(1, Math.max(0, parseInt(f.val()))-1));
295		}
296		e.preventDefault();
297
298		jQuery(this).siblings('input').change();
299
300		return false;
301	});
302
303	jQuery('.ltx-arrow-down').on('click', function() {
304
305		var next = jQuery(this).closest('.slider-zoom').closest('.vc_row').next();
306		jQuery("html, body").animate({ scrollTop: jQuery(next).offset().top - 100 }, 500);
307	});
308
309	if ( jQuery("#ltx-modal").length && !ltxGetCookie('ltx-modal-cookie') ) {
310
311		jQuery("#ltx-modal").modal("show");
312	}
313
314	jQuery('#ltx-modal').on('click', '.ltx-modal-yes', function() {
315	
316    	jQuery('body').removeClass('modal-open');
317	    jQuery('#ltx-modal').remove();
318	    jQuery('.modal-backdrop').remove();
319	    ltxSetCookie('ltx-modal-cookie', 1, jQuery(this).data('period'));
320	});	
321
322	jQuery('#ltx-modal').on('click', '.ltx-modal-no', function() {
323
324	    window.location.href = jQuery(this).data('no');
325	    return false;
326	});		
327}
328
329function initCountDown() {
330
331	var countDownEl = jQuery('.ltx-countdown');
332
333	if (jQuery(countDownEl).length) {
334
335			jQuery(countDownEl).each(function(i, el) {
336
337			jQuery(el).countdown(jQuery(el).data('date'), function(event) {
338
339				jQuery(this).html(event.strftime('' + jQuery(countDownEl).data('template')));
340			});		
341		});
342	}
343}
344
345
346function ltxUrlDecode(str) {
347
348   return decodeURIComponent((str+'').replace(/\+/g, '%20'));
349}
350
351/* Parallax initialization */
352function initParallax() {
353
354	// Only for desktop
355	if (/Mobi/.test(navigator.userAgent)) return false;
356
357	jQuery('.ltx-parallax').parallax("50%", 0.2);	
358	jQuery('.ltx-parallax.wpb_column .vc_column-inner').parallax("50%", 0.3);	
359
360	if ( jQuery('.ltx-parallax-slider').length ) {
361
362		jQuery('.ltx-parallax-slider').each(function(e, el) {
363
364			var scene = jQuery(el).get(0);
365			var parallaxInstance = new Parallax(scene, {
366
367				hoverOnly : true,
368				limitY: 0,
369				selector : '.ltx-layer',
370			});
371		});
372	}
373
374	jQuery(".ltx-scroll-parallax").each(function(i, el) {
375
376		jQuery(el).paroller({ factor: jQuery(el).data('factor'), type: 'foreground', direction: jQuery(el).data('direction') });
377	});
378
379
380	jQuery(".ltx-parallax-slider .layer").each(function(i, el) {
381
382		jQuery(el).paroller({ factor: jQuery(el).data('factor'), type: jQuery(el).data('type'), direction: jQuery(el).data('direction') });
383	});	
384}
385
386/* Adding custom classes to element */
387function initStyles() {
388
389	jQuery('form:not(.checkout, .woocommerce-shipping-calculator) select:not(#rating), aside select, .footer-widget-area select').wrap('<div class="select-wrap"></div>');
390	jQuery('.wpcf7-checkbox').parent().addClass('margin-none');
391
392	jQuery('input[type="submit"], button[type="submit"]').not('.btn').addClass('btn btn-xs');
393	jQuery('#send_comment').removeClass('btn-xs');
394	jQuery('#searchsubmit').removeClass('btn');
395
396	jQuery('.form-btn-shadow .btn,.form-btn-shadow input[type="submit"]').addClass('btn-shadow');
397	jQuery('.form-btn-wide .btn,.form-btn-wide input[type="submit"]').addClass('btn-wide');
398
399
400	jQuery('.woocommerce .button').addClass('btn btn-main color-hover-black').removeClass('button');
401	jQuery('.woocommerce .wc-forward:not(.checkout)').removeClass('btn-black').addClass('btn-main');
402	jQuery('.woocommerce-message .btn, .woocommerce-info .btn').addClass('btn-xs');
403	jQuery('.woocommerce .price_slider_amount .btn').removeClass('btn-black color-hover-white').addClass('btn btn-main btn-xs color-hover-black');
404	jQuery('.woocommerce .checkout-button').removeClass('btn-black color-hover-white').addClass('btn btn-main btn-xs color-hover-black');
405	jQuery('button.single_add_to_cart_button').removeClass('btn-xs color-hover-white').addClass('color-hover-main');
406	jQuery('.woocommerce .coupon .btn').removeClass('color-hover-white').addClass('color-hover-main');
407
408	jQuery('.widget_product_search button').removeClass('btn btn-xs');
409	jQuery('.input-group-append .btn').removeClass('btn-xs');
410
411	jQuery('.ltx-hover-logos img').each(function(i, el) { jQuery(el).clone().addClass('ltx-img-hover').insertAfter(el); });
412	
413	jQuery(".container input[type=\"submit\"], .container input[type=\"button\"], .container .btn").wrap('<span class="ltx-btn-wrap"></span');
414	jQuery('.search-form .ltx-btn-wrap').removeClass('ltx-btn-wrap');
415	jQuery('.ltx-btn-wrap > .btn-main').parent().addClass('ltx-btn-wrap-main');
416	jQuery('.ltx-btn-wrap > .btn-black').parent().addClass('ltx-btn-wrap-black');
417	jQuery('.ltx-btn-wrap > .btn-white').parent().addClass('ltx-btn-wrap-white');
418
419	jQuery('.ltx-btn-wrap > .color-hover-main').parent().addClass('ltx-btn-wrap-hover-main');
420	jQuery('.ltx-btn-wrap > .color-hover-black').parent().addClass('ltx-btn-wrap-hover-black');
421	jQuery('.ltx-btn-wrap > .color-hover-white').parent().addClass('ltx-btn-wrap-hover-white');
422
423	jQuery('.woocommerce .products .item .ltx-btn-wrap .btn').addClass('btn-xs');
424
425	jQuery(".container .wpcf7-submit").removeClass('btn-xs').wrap('<span class="ltx-btn-wrap"></span');
426
427	jQuery('.woocommerce-result-count, .woocommerce-ordering').wrapAll('<div class="ltx-wc-order"></div>');
428
429	jQuery('.blog-post .nav-links > a').wrapInner('<span></span>');
430	jQuery('.blog-post .nav-links > a[rel="next"]').wrap('<span class="next"></span>');
431	jQuery('.blog-post .nav-links > a[rel="prev"]').wrap('<span class="prev"></span>');
432
433	jQuery('section.bg-overlay-true-black, .wpb_row.bg-overlay-true-black').prepend('<div class="ltx-overlay-true-black"></div>');
434	jQuery('section.bg-overlay-white, .wpb_row.bg-overlay-white').prepend('<div class="ltx-overlay-white"></div>');
435	jQuery('section.bg-overlay-black, .wpb_row.bg-overlay-black, .wpb_column.bg-overlay-black .vc_column-inner').prepend('<div class="ltx-overlay-black"></div>');
436	jQuery('section.bg-overlay-dark, .wpb_row.bg-overlay-dark').prepend('<div class="ltx-overlay-dark"></div>');
437	jQuery('section.bg-overlay-xblack, .wpb_row.bg-overlay-xblack').prepend('<div class="ltx-overlay-xblack"></div>');
438	jQuery('section.bg-overlay-gradient, .wpb_row.bg-overlay-gradient').prepend('<div class="ltx-overlay-gradient"></div>');
439	jQuery('section.bg-overlay-waves, .wpb_row.bg-overlay-waves').prepend('<div class="ltx-overlay-waves"></div>');
440	jQuery('section.bg-overlay-half, .wpb_row.bg-overlay-half').prepend('<div class="ltx-overlay-half"></div>');
441	jQuery('section.bg-overlay-divider, .wpb_row.bg-overlay-divider').prepend('<div class="ltx-overlay-divider"></div>');
442	jQuery('section.bg-overlay-highlight, .wpb_row.bg-overlay-highlight, .wpb_column.bg-overlay-highlight > .vc_column-inner').prepend('<div class="ltx-overlay-highlight"></div>');
443	jQuery('section.white-space-top, .wpb_row.white-space-top').prepend('<div class="ltx-white-space-top"></div>');
444
445	var header_icon_class = jQuery('#ltx-header-icon').data('icon');
446
447	var update_width = jQuery('.woocommerce-cart-form__contents .product-subtotal').outerWidth();
448
449	jQuery('button[name="update_cart"]').css('width', update_width);
450
451	jQuery('.wp-searchform .btn').removeClass('btn');
452
453	if ( jQuery('.woocommerce .products').length ) {
454
455		jQuery('.woocommerce .products .product').each(function(i, el) {
456
457			var href = jQuery(el).find('a').attr('href'),
458				img = jQuery(el).find('.image img');
459
460			jQuery(img).wrap('<a href="'+ href +'">');
461		});
462	}
463
464	// Settings copyrights overlay for non-default heights
465	var copyrights = jQuery('.copyright-block.copyright-layout-copyright-transparent'),
466		footer = jQuery('#ltx-widgets-footer + .copyright-block'),
467		widgets_footer = jQuery('#ltx-widgets-footer'),
468		footerHeight = footer.outerHeight();
469
470	widgets_footer.css('padding-bottom', 0 + footerHeight + 'px');
471	footer.css('margin-top', '-' + footerHeight + 'px');
472
473	copyrights.css('margin-top', '-' + copyrights.outerHeight() + 'px')
474
475	// Cart quanity change
476	jQuery('.woocommerce div.quantity,.woocommerce-page div.quantity').append('<span class="more"></span><span class="less"></span>');
477	jQuery(document).off('updated_wc_div').on('updated_wc_div', function () {
478
479		jQuery('.woocommerce div.quantity,.woocommerce-page div.quantity').append('<span class="more"></span><span class="less"></span>');
480		initStyles();
481	});
482
483	var bodyStyles = window.getComputedStyle(document.body);
484	var niceScrollConf = {cursorcolor:bodyStyles.getPropertyValue('--white'),cursorborder:"0px",background:"#000",cursorwidth: "8px",cursorborderradius: "0px",autohidemode:false};
485
486	jQuery('.events-sc.ltx-scroll').niceScroll(niceScrollConf);		
487}
488
489/* Styles reloaded then page has been resized */
490function setResizeStyles() {
491
492	var videos = jQuery('.blog-post article.format-video iframe'),
493		container = jQuery('.blog-post'),
494		bodyWidth = jQuery(window).outerWidth(),
495		contentWrapper = jQuery('.ltx-content-wrapper.ltx-footer-parallax'),
496		footerWrapper = jQuery('.ltx-content-wrapper.ltx-footer-parallax + .ltx-footer-wrapper');
497
498		contentWrapper.css('margin-bottom', footerWrapper.outerHeight() + 'px');
499
500	jQuery.each(videos, function(i, el) {
501
502		var height = jQuery(el).height(),
503			width = jQuery(el).width(),
504			containerW = jQuery(container).width(),
505			ratio = containerW / width;
506
507		jQuery(el).css('width', width * ratio);
508		jQuery(el).css('height', height * ratio);
509	});
510
511	if ( jQuery('.services-sc.layout-list').length ) {
512
513		var el = jQuery('.services-sc.layout-list');
514
515		if ( !el.hasClass('inited') ) {
516
517			var bodyStyles = window.getComputedStyle(document.body);
518			var niceScrollConf = {cursorcolor:bodyStyles.getPropertyValue('--black'),cursorborder:"0px",background:bodyStyles.getPropertyValue('--gray'),cursorwidth: "7px",cursorborderradius: "0px",autohidemode:false};
519
520			el.find('.ltx-list-wrap').niceScroll(niceScrollConf);	
521		}
522	}
523
524	document.documentElement.style.setProperty( '--fullwidth', bodyWidth + 'px' );
525}
526
527/* Starting countUp function */
528function checkCountUp() {
529
530	if (jQuery(".countUp").length){
531
532		jQuery('.countUp').counterUp();
533	}
534}
535
536/* 
537	Scroll Reveal Initialization
538	Catches the classes: ltx-sr-fade_in ltx-sr-text_el ltx-sr-delay-200 ltx-sr-duration-300 ltx-sr-sequences-100
539*/
540function initScrollReveal() {
541
542	if (/Mobi/.test(navigator.userAgent) || jQuery(window).width() < 768) return false;
543
544	window.sr = ScrollReveal();
545
546	var srAnimations = {
547		zoom_in: {
548			
549			opacity : 1,
550			scale    : 0.01,
551		},
552		fade_in: {
553			distance: 0,
554			opacity : 0,
555			scale : 1,
556		},
557		slide_from_left: {
558			distance: '200%',
559			origin: 'left',			
560		},
561		slide_from_right: {
562			distance: '150%',
563			origin: 'right',			
564		},
565		slide_from_top: {
566			distance: '150%',
567			origin: 'top',			
568		},
569		slide_from_bottom: {
570			distance: '150%',
571			origin: 'bottom',			
572		},
573		slide_rotate: {
574			rotate: { x: 0, y: 0, z: 360 },		
575		},		
576	};
577
578	var srElCfg = {
579
580		block: [''],
581		items: ['article', '.item'],
582		text_el: ['.heading', '.header', '.subheader', '.btn', '.btn-wrap', 'p', 'ul'],
583		list_el: ['li']
584	};
585
586
587	/*
588		Parsing elements class to get variables
589	*/
590	jQuery('.ltx-sr').each(function() {
591
592		var el = jQuery(this),
593			srClass = el.attr('class');
594
595		var srId = srClass.match(/ltx-sr-id-(\S+)/),
596			srEffect = srClass.match(/ltx-sr-effect-(\S+)/),
597			srEl = srClass.match(/ltx-sr-el-(\S+)/),
598			srDelay = srClass.match(/ltx-sr-delay-(\d+)/),
599			srDuration = srClass.match(/ltx-sr-duration-(\d+)/),
600			srSeq = srClass.match(/ltx-sr-sequences-(\d+)/); 
601
602		var cfg = srAnimations[srEffect[1]];
603
604		var srConfig = {
605
606			delay : parseInt(srDelay[1]),
607			duration : parseInt(srDuration[1]),
608			easing   : 'ease-in-out',
609			afterReveal: function (domEl) { jQuery(domEl).css('transition', 'all .3s ease'); }
610		}			
611
612		cfg = jQuery.extend({}, cfg, srConfig);
613
614		var initedEls = [];
615		jQuery.each(srElCfg[srEl[1]], function(i, e) {
616
617			initedEls.push('.ltx-sr-id-' + srId[1] + ' ' + e);
618		});
619
620		sr.reveal(initedEls.join(','), cfg, parseInt(srSeq[1]));
621	});
622}
623
624/*
625	Slider filter 
626	Filters element in slider and reinits swiper slider after
627*/
628function initSliderFilter(swiper) {
629
630	var btns = jQuery('.slider-filter'),
631		container = jQuery('.slider-filter-container');
632
633	var ww = jQuery(window).width(),
634		wh = jQuery(window).height();
635
636	if (btns.length) {
637
638		btns.on('click', 'a.cat, span.cat, span.img', function() {
639
640			var el = jQuery(this),
641				filter = el.data('filter'),
642				limit = el.data('limit');
643
644			container.find('.filter-item').show();
645			el.parent().parent().find('.cat-active').removeClass('cat-active')
646			el.parent().parent().find('.cat-li-active').removeClass('cat-li-active')
647			el.addClass('cat-active');
648			el.parent().addClass('cat-li-active');
649
650			if (filter !== '') {
651
652				container.find('.filter-item').hide();
653				container.find('.filter-item.filter-type-' + filter + '').fadeIn(900);
654			}
655
656			if (swiper !== 0) {
657
658				swiper.slideTo(0, 0);
659
660				swiper.update();
661			}
662
663			return false;
664		});
665
666		// First Init, Activating first tab
667		var firstBtn = btns.find('.cat:first')
668
669		firstBtn.addClass('cat-active');
670		firstBtn.parent().addClass('cat-li-active');
671		container.find('.filter-item').hide();
672		container.find('.filter-item.filter-type-' + firstBtn.data('filter') + '').show();
673	}
674}
675
676/*
677	Menu filter
678*/
679function initMenuFilter() {
680
681	var container = jQuery('.ltx-menu-sc'),
682		btns = jQuery('.ltx-menu-sc .menu-filter');
683
684	if ( container.length )  {
685
686		var bodyStyles = window.getComputedStyle(document.body);
687		var niceScrollConf = {cursorcolor:bodyStyles.getPropertyValue('--main'),cursorborder:"0px",background:"#1E1D1C",cursorwidth: "10px",cursorborderradius: "0px",autohidemode:false};
688
689
690		if (btns.length) {
691
692			btns.on('click', 'a.cat, span.cat', function() {
693
694				var el = jQuery(this),
695					filter = el.data('filter');
696
697				container.find('article').show();
698				el.parent().parent().find('.cat-active').removeClass('cat-active')
699				el.addClass('cat-active');
700
701				if (filter !== '') {
702
703					container.find('article').hide().removeClass('show');
704					container.find('article.filter-type-' + filter + '').fadeIn('slow').addClass('show');
705				}
706
707				jQuery('.menu-sc .items').getNiceScroll().resize();
708
709				return false;
710			});
711
712			// First Init, Activating first tab
713			var firstBtn = btns.find('.cat:first')
714
715			firstBtn.addClass('cat-active');
716			container.find('article').hide();
717			container.find('article.filter-type-' + firstBtn.data('filter') + '').show().addClass('show');
718		}
719
720		jQuery('.ltx-menu-sc.ltx-menu-layout-scroll .items').niceScroll(niceScrollConf);	
721	}
722}
723
724/* Swiper slider initialization */
725function initSwiper() {
726
727	var products = jQuery('.products-slider'),
728		slidersLtx = jQuery('.slider-sc'),
729		servicesEl = jQuery('.services-slider'),
730		locationsEl = jQuery('.ltx-locations-slider'),
731		clientsSwiperEl = jQuery('.testimonials-slider'),
732		gallerySwiperEl = jQuery('.swiper-gallery'),
733		albumsEl = jQuery('.ltx-album-sc'),
734		artists = jQuery('.ltx-clients'),
735		postGalleryEl = jQuery('.ltx-post-gallery'),
736		portfolio = jQuery('.ltx-portfolio-slider'),
737		teamEl = jQuery('.ltx-team-slider'),		
738		sliderFc = jQuery('.ltx-slider-fc'),		
739		textSwiperEl = jQuery('.swiper-text'),
740		schedule = jQuery('.swiper-schedule');
741	
742	if (portfolio.length) {
743
744		if ( portfolio.data('autoplay') === 0 ) {
745
746			var autoplay = false;
747		}
748			else {
749
750			var autoplay = {
751				delay: portfolio.data('autoplay'),
752				disableOnInteraction: false,
753			}
754		}		
755
756	    var portfolioSwiper = new Swiper(portfolio, {
757
758			direction   : 'horizontal',
759			
760			navigation: {
761				nextEl: '.arrow-right',
762				prevEl: '.arrow-left',
763			},	
764
765			speed		: 1000,   
766			loop 		: true,
767		
768			autoplay: autoplay,	
769		
770	    });
771
772	    portfolioSwiper.update();
773	}
774
775	if (albumsEl.length) {
776
777		jQuery(albumsEl).each(function(i, el) {
778
779			if ( jQuery(el).find('.ltx-gallery-thumbs').length ) {
780
781			    var galleryThumbs = new Swiper(jQuery(el).find('.ltx-gallery-thumbs'), {
782			      spaceBetween: 30,
783			      slidesPerView: 6,
784			      watchSlidesVisibility: true,
785			      watchSlidesProgress: true,
786			    });
787
788			    var thumbs = { swiper: galleryThumbs };
789
790				jQuery(window).on('resize', function() {
791
792					var ww = jQuery(window).width(),
793						wh = jQuery(window).height();
794
795						if (ww > 1200) { galleryThumbs.params.slidesPerView = 6; }
796						if (ww <= 1200) { galleryThumbs.params.slidesPerView = 4; }
797						if (ww <= 1000) { galleryThumbs.params.slidesPerView = 3; }
798						if (ww <= 768) { galleryThumbs.params.slidesPerView = 2; }		
799					
800						galleryThumbs.update();
801				});
802			}
803				else {
804
805				var thumbs  = false;
806			}		
807
808
809		    var galleryTop = new Swiper(jQuery(el).find('.ltx-gallery-top'), {
810
811			  effect : 'coverflow',
812
813		      speed		: 1000,
814
815		      thumbs : thumbs
816		    });
817
818
819		});
820	}
821
822
823	if (teamEl.length) {
824
825		var autoplay = false;
826
827	    var teamSwiper = new Swiper(teamEl, {
828
829			speed		: 1000,
830			spaceBetween : 30,
831			navigation: {
832				nextEl: '.arrow-right',
833				prevEl: '.arrow-left',
834			},
835			pagination : {
836
837				el: '.swiper-pages',
838				clickable: true,				
839			},			
840			slidesPerView : 3,
841		
842			autoplay: autoplay,			
843	    });
844
845	    initSliderFilter(teamSwiper);
846	}
847		else {
848
849	    initSliderFilter(0);
850	}
851
852	if (slidersLtx.length) {
853
854		if ( slidersLtx.data('autoplay') === 0 ) {
855
856			var autoplay = false;
857		}
858			else {
859
860			var autoplay = {
861				delay: slidersLtx.data('autoplay'),
862				disableOnInteraction: false,
863			}
864		}
865
866	    var slidersSwiper = new Swiper(slidersLtx, {
867
868			speed		: 1000,
869
870			effect : 'fade',
871			fadeEffect: { crossFade: true },
872
873			autoplay: autoplay,	
874
875			navigation: {
876				nextEl: '.arrow-right',
877				prevEl: '.arrow-left',
878			},			
879	
880			pagination : {
881
882				el: '.swiper-pages',
883				clickable: true,				
884			},
885
886	    });
887
888	    slidersSwiper.update();   
889	}
890
891	if (sliderFc.length) {
892
893		if ( sliderFc.data('autoplay') === 0 ) {
894
895			var autoplay = false;
896		}
897			else {
898
899			var autoplay = {
900				delay: sliderFc.data('autoplay'),
901				disableOnInteraction: false,
902			}
903		}		
904
905	    var sliderFcSwiper = new Swiper(sliderFc, {
906
907			direction   : 'horizontal',
908			
909			navigation: {
910				nextEl: '.arrow-right',
911				prevEl: '.arrow-left',
912			},	
913			spaceBetween : 30,
914
915			loop		: true,   
916			speed		: 1000,   
917			slidesPerGroup: 3,
918			slidesPerView : sliderFc.data('cols'),
919			/*
920			mousewheel: {
921			    invert: false,
922			},
923			*/
924			on: {
925				init: function () {
926
927					sliderFcChangeBg();
928				},
929			},
930		
931			autoplay    : autoplay,
932		
933	    });
934
935	    sliderFcSwiper.update();
936
937	    jQuery('.ltx-slider-fc-wrapper').on('mouseover', '.swiper-slide', function(i, el) {
938
939	    	jQuery('.ltx-slider-fc-wrapper').addClass('hovered');
940	    	jQuery('.ltx-slider-fc-wrapper .swiper-slide').removeClass('hovered');
941	    	jQuery(i.currentTarget).addClass('hovered');
942	    	sliderFcChangeBg(i.currentTarget);
943	    });
944
945	}
946
947	if (locationsEl.length) {
948
949	    var locationsSwiper = new Swiper(locationsEl, {
950
951			direction   : 'horizontal',
952			
953			navigation: {
954				nextEl: '.arrow-right',
955				prevEl: '.arrow-left',
956			},	
957
958			slidesPerView : locationsEl.data('cols'),		
959			slidesPerColumn : locationsEl.data('per-col'),
960	    });
961
962	    locationsSwiper.update();
963	}
964
965	if (postGalleryEl.length) {
966
967	    var postGallerySwiper = new Swiper(postGalleryEl, {
968
969			navigation: {
970				nextEl: '.arrow-right',
971				prevEl: '.arrow-left',
972			},
973			loop		: true,   
974
975			speed		: 1000,   
976		
977			autoplay    : postGalleryEl.data('autoplay'),
978			autoplayDisableOnInteraction	: false,
979		
980	    });
981
982	    postGallerySwiper.update();
983	}
984
985	if (clientsSwiperEl.length) {
986
987		if ( clientsSwiperEl.data('autoplay') === 0 ) {
988
989			var autoplay = false;
990		}
991			else {
992
993			var autoplay = {
994				delay: clientsSwiperEl.data('autoplay'),
995				disableOnInteraction: false,
996			}
997		}
998
999	    var clientsSwiper = new Swiper(clientsSwiperEl, {
1000
1001	    	initialSlide : 1,
1002			speed		: 1000,
1003			slidesPerView : clientsSwiperEl.data('cols'),	
1004			centeredSlides: true,
1005
1006			spaceBetween: 30,
1007			loop: true,
1008
1009			navigation: {
1010				nextEl: '.arrow-right',
1011				prevEl: '.arrow-left',
1012			},
1013	
1014			autoplay: autoplay,	
1015
1016	    });
1017
1018	    clientsSwiper.update();
1019	}
1020
1021	if (products.length) {
1022
1023	    var productsSwiper = new Swiper(products, {
1024
1025			speed		: 1000,
1026			slidesPerView : products.data('cols'),	        
1027			slidesPerGroup : 1,	    
1028			navigation: {
1029				nextEl: '.arrow-right',
1030				prevEl: '.arrow-left',
1031			},			    
1032
1033			autoplay    : products.data('autoplay'),
1034			autoplayDisableOnInteraction	: false,
1035	    });
1036
1037	    initSliderFilter(productsSwiper);
1038	}
1039
1040	if (servicesEl.length) {
1041
1042		jQuery(servicesEl).each(function(i, el) {
1043
1044			if ( servicesEl.data('autoplay') === 0 ) {
1045
1046				var autoplay = false;
1047			}
1048				else {
1049
1050				var autoplay = {
1051					delay: servicesEl.data('autoplay'),
1052					disableOnInteraction: false,
1053				}
1054			}
1055
1056		    var servicesSwiper = new Swiper(jQuery(el).find('.swiper-container'), {
1057
1058				speed		: 1000,
1059				spaceBetween: 30,
1060				loop: true,
1061
1062				navigation: {
1063					nextEl: jQuery(el).find('.arrow-right'),
1064					prevEl: jQuery(el).find('.arrow-left'),
1065				},	    
1066				slidesPerView : servicesEl.data('cols'),
1067			
1068				autoplay: autoplay,	
1069		    });
1070
1071			jQuery(window).on('resize', function() {
1072
1073				var ww = jQuery(window).width();		    
1074
1075				if (ww > 1600) { servicesSwiper.params.slidesPerView = 3; }
1076				if (ww <= 1599) { servicesSwiper.params.slidesPerView = 2; }
1077				if (ww <= 1199) { servicesSwiper.params.slidesPerView = 2; }		
1078				if (ww <= 768) { servicesSwiper.params.slidesPerView = 1; }		
1079			
1080				servicesSwiper.update();			
1081			});
1082		});
1083	}
1084
1085	if (artists.length) {	
1086
1087		jQuery(artists).each(function(i, el) {
1088
1089		    var artistsSwiper = new Swiper(jQuery(el).find('.swiper-container'), {
1090
1091		    	slidesPerView : 4,
1092				navigation: {
1093					nextEl: jQuery(el).find('.arrow-right'),
1094					prevEl: jQuery(el).find('.arrow-left'),
1095				},	    	
1096		    });
1097
1098			jQuery(window).on('resize', function() {
1099
1100				var ww = jQuery(window).width();	
1101
1102				if (ww >= 1200) { artistsSwiper.params.slidesPerView = 4; }
1103				if (ww <= 1199) { artistsSwiper.params.slidesPerView = 3; }
1104				if (ww <= 1000) { artistsSwiper.params.slidesPerView = 2; }
1105				if (ww <= 768) { artistsSwiper.params.slidesPerView = 1; }
1106			
1107				artistsSwiper.update();			
1108			});
1109		});
1110	}
1111
1112
1113	if (gallerySwiperEl.length) {	
1114
1115		jQuery(gallerySwiperEl).each(function(i, el) {
1116
1117			if ( jQuery(el).data('autoplay') === 0 ) {
1118
1119				var autoplay = false;
1120			}
1121				else {
1122
1123				var autoplay = {
1124					delay: jQuery(el).data('autoplay'),
1125					disableOnInteraction: true,
1126				}
1127			}
1128
1129			var gallerySlides = 7;
1130			if ( jQuery(el).hasClass('grid-big')) gallerySlides = 4;
1131
1132		    var gallerySwiper = new Swiper(jQuery(el), {
1133		    	slidesPerView : gallerySlides,
1134		    	loop		: true,
1135		    	freeMode: true,
1136		    	speed : 1500,
1137		    	autoplay: autoplay,	
1138		    });
1139
1140		    jQuery(window).on('resize', function() {
1141
1142		    	var ww = jQuery(window).width();
1143
1144				if ( gallerySlides == 7) {
1145
1146					gallerySwiper.params.slidesPerView = 7;
1147					if (ww <= 1199) { gallerySwiper.params.slidesPerView = 5; }
1148					if (ww <= 768) { gallerySwiper.params.slidesPerView = 3; }		
1149					if (ww <= 480) { gallerySwiper.params.slidesPerView = 2; }		
1150				}
1151					else {
1152
1153					gallerySwiper.params.slidesPerView = 4;
1154					if (ww <= 1199) { gallerySwiper.params.slidesPerView = 3; }
1155					if (ww <= 768) { gallerySwiper.params.slidesPerView = 3; }		
1156					if (ww <= 480) { gallerySwiper.params.slidesPerView = 2; }		
1157				}
1158			
1159				gallerySwiper.update();
1160			});
1161		});
1162	}
1163
1164	if (textSwiperEl.length) {	
1165
1166	    var textSwiperEl = new Swiper(textSwiperEl, {
1167			direction   : 'horizontal',
1168			nextButton	: '.arrow-right',
1169			prevButton	: '.arrow-left',
1170			loop		: true,
1171			autoplay    : 4000,
1172			autoplayDisableOnInteraction	: false,        
1173	    });
1174	}	
1175
1176	jQuery(window).on('resize', function(){
1177
1178		var ww = jQuery(window).width(),
1179			wh = jQuery(window).height();
1180
1181		if (sliderFc.length) {
1182
1183			if (ww > 1200) { sliderFcSwiper.params.slidesPerView = 3; }
1184			if (ww <= 1200) { sliderFcSwiper.params.slidesPerView = 3; }
1185			if (ww <= 1000) { sliderFcSwiper.params.slidesPerView = 2; }
1186			if (ww <= 768) { sliderFcSwiper.params.slidesPerView = 1; }		
1187		
1188			sliderFcSwiper.update();			
1189		}
1190
1191		if (clientsSwiperEl.length) {
1192
1193			if (ww <= 1000) { clientsSwiper.params.slidesPerView = 1; }	else { clientsSwiper.params.slidesPerView = 1; }
1194		
1195			clientsSwiper.update();			
1196		}
1197			else
1198		if (clientsSwiperEl.length && clientsSwiperEl.data('cols') == 2) {
1199
1200			if (ww > 1600) { clientsSwiper.params.slidesPerView = 2; }
1201			if (ww <= 1000) { clientsSwiper.params.slidesPerView = 1; }		
1202			if (ww <= 768) { clientsSwiper.params.slidesPerView = 1; }		
1203		
1204			clientsSwiper.update();			
1205		}					
1206
1207		if (teamEl.length ) {
1208
1209
1210			teamSwiper.params.slidesPerView = 3;
1211			if (ww <= 1199) { teamSwiper.params.slidesPerView = 2; }
1212			if (ww <= 768) { teamSwiper.params.slidesPerView = 1; }		
1213		
1214			teamSwiper.update();			
1215		}
1216	
1217
1218		if (products.length && products.data('cols') >= 2) {
1219
1220			if (ww >= 1600) { productsSwiper.params.slidesPerView = 4; }
1221			if (ww <= 1599) { productsSwiper.params.slidesPerView = 3; }
1222			if (ww <= 1199) { productsSwiper.params.slidesPerView = 2; }
1223			if (ww <= 768) { productsSwiper.params.slidesPerView = 1; }		
1224		
1225			productsSwiper.update();			
1226		}	
1227
1228		if (locationsEl.length) {
1229
1230			if (ww >= 1600) { locationsSwiper.params.slidesPerView = 3; }
1231			if (ww <= 1599) { locationsSwiper.params.slidesPerView = 2; }
1232			if (ww <= 1199) { locationsSwiper.params.slidesPerView = 2; }
1233			if (ww <= 768) { locationsSwiper.params.slidesPerView = 1; }		
1234		
1235			locationsSwiper.update();			
1236		}
1237
1238
1239
1240	}).resize();
1241}
1242
1243function initPortfolio() {
1244
1245	var wrapper = jQuery('.portfolio-sc');
1246
1247	if ( wrapper.length ) {
1248
1249		jQuery(wrapper).each(function(i, el) {
1250
1251			var menu = jQuery(el).find('.ltx-portfolio-menu:not(".ltx-dropbox")'),
1252				drop = jQuery(el).find('.ltx-portfolio-menu.ltx-dropbox'),
1253				items = jQuery(el).find('.ltx-portfolio-items');
1254
1255			jQuery(drop).find('select').wrap('<div class="select-wrap"></div>');;
1256
1257			jQuery(menu).find('li:first-child').addClass('active');
1258			jQuery(items).find('.item:first-child').addClass('active');
1259
1260			var height = jQuery(items).find('.item:first-child').height();
1261
1262			wrapper.css('min-height', height + 'px');
1263
1264			jQuery(menu).on('click', 'a', function() {
1265
1266				var id = jQuery(this).data('id');
1267
1268				jQuery(menu).find('.active').removeClass('active');
1269				jQuery(this).parent().addClass('active');
1270				jQuery(items).find('.active').removeClass('active');
1271				jQuery(items).find('.ltx-portfolio-' + id).addClass('active');
1272
1273
1274				return false;
1275			});
1276
1277			jQuery(drop).on('change', function() {
1278
1279				var id = jQuery(this).find("option:selected").val();
1280
1281				jQuery(items).find('.active').removeClass('active');
1282				jQuery(items).find('.ltx-portfolio-' + id).addClass('active');
1283
1284				return false;
1285			});
1286
1287			jQuery(window).on("resize", function () {
1288
1289				var height = jQuery(items).find('.item:first-child').height();
1290				wrapper.css('min-height', height + 'px');
1291			});
1292		});
1293	}
1294}
1295
1296
1297/* Masonry initialization */
1298function initMasonry() {
1299
1300	jQuery('.masonry').masonry({
1301	  itemSelector: '.item',
1302	  columnWidth:  '.item'
1303	});		
1304
1305	jQuery('.gallery-inner').masonry({
1306	  itemSelector: '.mdiv',
1307	  columnWidth:  '.mdiv'
1308	});			
1309}
1310
1311/* Google maps init */
1312function initMap() {
1313
1314	jQuery('.ltx-google-maps').each(function(i, mapEl) {
1315
1316		mapEl = jQuery(mapEl);
1317		if (mapEl.length) {
1318
1319			var uluru = {lat: mapEl.data('lat'), lng: mapEl.data('lng')};
1320			var map = new google.maps.Map(document.getElementById(mapEl.attr('id')), {
1321			  zoom: mapEl.data('zoom'),
1322			  center: uluru,
1323			  scrollwheel: false,
1324			  styles: mapStyles
1325			});
1326
1327			var marker = new google.maps.Marker({
1328			  position: uluru,
1329			  icon: mapEl.data('marker'),
1330			  map: map
1331			});
1332		}
1333	});
1334}
1335
1336function ltxGetCookie(name) {
1337	var nameEQ = name + "=";
1338	var ca = document.cookie.split(';');
1339	for (var i = 0; i < ca.length; i++) {
1340		var c = ca[i];
1341		while (c.charAt(0) == ' ') c = c.substring(1, c.length);
1342		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
1343	}
1344	return null;
1345}
1346
1347/* jPlayer tracks init */
1348function initTracks() {
1349
1350	var tracks = jQuery('.ltx-tracks-player');
1351
1352	if ( tracks.length ) {
1353
1354		jQuery(tracks).each(function(i, el) {
1355
1356			var playerWrapper = jQuery(el),
1357				player = jQuery(el).find('.jp-jplayer'),
1358				tracks = jQuery(el).data('items');
1359
1360			var ltxPlaylist = new jPlayerPlaylist({
1361			  jPlayer: "#" + player.attr('id'),
1362			  cssSelectorAncestor: "#" + playerWrapper.attr('id')
1363			}, [
1364   
1365			], {
1366			  playlistOptions: {
1367			    enableRemoveControls: true
1368			  },
1369			  swfPath: "/js",
1370			  supplied: "mp3",
1371			  smoothPlayBar: true,
1372			  keyEnabled: false,
1373			  audioFullScreen: false
1374			});
1375
1376			jQuery(tracks).each(function(t, track) {
1377
1378				ltxPlaylist.add({
1379			      title: track.title,
1380			      artist: track.artist,
1381			      poster: track.poster,
1382			      mp3: track.file,
1383			    });
1384			});
1385		});
1386	}
1387}
1388
1389/* Scroll animation used for homepages */
1390function checkScrollAnimation() {
1391
1392	var scrollBlock = jQuery('.ltx-chart');
1393    if (scrollBlock.length) {
1394
1395	    var scrollTop = scrollBlock.offset().top - window.innerHeight;
1396
1397	    if (!scrollBlock.hasClass('done') && jQuery(window).scrollTop() > scrollTop) {
1398
1399	    	scrollBlock.addClass('done');
1400	    }  
1401	}
1402}

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.