PageSourceSearch

https://softpixel.pl/js/custom.js

js softpixel.pl collected 2026-10-08 12:00:20 UTC 20,195 bytes, 714 lines download raw bytes

1/**
2/**
3Core script to handle the entire theme and core functions
4**/
5var Samar = function(){
6	/* Search Bar ============ */
7	siteUrl = '';
8	
9	var screenWidth = $( window ).width();
10	
11	var homeSearch = function() {
12		'use strict';
13		/* top search in header on click function */
14		var quikSearch = jQuery("#quik-search-btn");
15		var quikSearchRemove = jQuery("#quik-search-remove");
16		
17		quikSearch.on('click',function() {
18			
19			jQuery('.dz-quik-search').fadeIn(500);
20			jQuery('.dz-quik-search').addClass('On');
21			
22			
23		});
24		
25		quikSearchRemove.on('click',function() {
26			jQuery('.dz-quik-search').fadeOut(500);
27			jQuery('.dz-quik-search').removeClass('On');
28			
29			
30		});	
31		/* top search in header on click function End*/
32	}
33	
34	/* One Page Layout ============ */
35	var onePageLayout = function() {
36		'use strict';
37		var headerHeight =   parseInt($('.onepage').css('height'), 10);
38		
39		$(".scroll").unbind().on('click',function(event) 
40		{
41			event.preventDefault();
42			
43			if (this.hash !== "") {
44				var hash = this.hash;	
45				var seactionPosition = $(hash).offset().top;
46				var headerHeight =   parseInt($('.onepage').css('height'), 10);
47				
48				
49				$('body').scrollspy({target: ".navbar", offset: headerHeight+2}); 
50				
51				var scrollTopPosition = seactionPosition - (headerHeight);
52				
53				$('html, body').animate({
54					scrollTop: scrollTopPosition
55				}, 800, function(){
56					
57				});
58			}   
59		});
60		$('body').scrollspy({target: ".navbar", offset: headerHeight + 2});  
61	}
62	
63	/* Header Height ============ */
64	var handleResizeElement = function(){
65		$('.header').css('height','');
66		var HeaderHeight = $('.header').height();
67		$('.header').css('height', HeaderHeight);
68		if(screenWidth > 991 ){
69			$('.homedemo').find('.mega-menu').css('height','calc(100vh - '+HeaderHeight+'px)');
70		}
71	}
72	
73	/* Load File ============ */
74	var dzTheme = function(){
75		 'use strict';
76		 var loadingImage = '<img src="images/loading.gif">';
77		 jQuery('.dzload').each(function(){
78		 var dzsrc =   siteUrl + $(this).attr('dzsrc');
79		  //jQuery(this).html(loadingImage);
80		 	jQuery(this).hide(function(){
81				jQuery(this).load(dzsrc, function(){
82					jQuery(this).fadeIn('slow');
83				}); 
84			})
85			
86		 });
87		 
88		
89		if(screenWidth <= 991 ){
90			jQuery('.navbar-nav > li > a, .sub-menu > li > a').unbind().on('click', function(e){
91				if(jQuery(this).parent().hasClass('open'))
92				{
93					jQuery(this).parent().removeClass('open');
94				}
95				else{
96					jQuery(this).parent().parent().find('li').removeClass('open');
97					jQuery(this).parent().addClass('open');
98				}
99			});
100		}
101		
102		
103		jQuery('.full-sidenav .navbar-nav > li > a').next('.sub-menu').slideUp();
104		jQuery('.full-sidenav .sub-menu > li > a').next('.sub-menu').slideUp();
105			
106		jQuery('.full-sidenav .navbar-nav > li > a, .full-sidenav .sub-menu > li > a').unbind().on('click', function(e){
107			jQuery('.full-sidenav .navbar-nav > li > a').not(this).next('.sub-menu').slideUp();
108			jQuery(this).next('.sub-menu').toggle(500);
109		});
110		jQuery('.menu-icon').on('click',function(){
111			jQuery('.menu-close,.full-sidenav').addClass('active');
112			onePageLayout();
113		});
114		jQuery('.menu-close').on('click',function(){
115			jQuery('.menu-close,.full-sidenav').removeClass('active');
116		});
117		
118		
119		jQuery('.contact-btn').on('click',function(){
120			jQuery('.contact-button, .contact-button-2').toggleClass('active');
121			
122		});
123		jQuery('.enter-button, .enquire').on('click',function(){
124			jQuery('.enter-form').addClass('active');
125			
126			setTimeout(function() {
127				jQuery('.enter-form').removeClass('active');
128			}, 500);
129		});
130		
131		setTimeout(function() {
132			jQuery("#myModal").modal('show');
133		}, 3000)
134		
135		
136		jQuery('.monthly').on('click',function(){
137			jQuery('.toggle-tabs').removeClass('yearly');
138			jQuery('.toggle-tabs').addClass('monthly');
139		});
140		jQuery('.yearly').on('click',function(){
141			jQuery('.toggle-tabs').addClass('yearly');
142			jQuery('.toggle-tabs').removeClass('monthly');
143		});
144		
145	}
146	
147	
148	/* Magnific Popup ============ */
149	var MagnificPopup = function(){
150		'use strict';	
151		if($(".mfp-gallery").length > 0 ) {
152			/* magnificPopup function */
153			jQuery('.mfp-gallery').magnificPopup({
154				delegate: '.mfp-link',
155				type: 'image',
156				tLoading: 'Loading image #%curr%...',
157				mainClass: 'mfp-img-mobile',
158				gallery: {
159					enabled: true,
160					navigateByImgClick: true,
161					preload: [0,1] // Will preload 0 - before current, and 1 after the current image
162				},
163				image: {
164					tError: '<a href="%url%">The image #%curr%</a> could not be loaded.',
165					titleSrc: function(item) {
166						return item.el.attr('title') + '<small></small>';
167					}
168				}
169			});
170		}
171		if($(".video").length > 0 ) {
172		/* magnificPopup function end */
173		
174		/* magnificPopup for paly video function */		
175		jQuery('.video').magnificPopup({
176			type: 'iframe',
177			iframe: {
178				markup: '<div class="mfp-iframe-scaler">'+
179						 '<div class="mfp-close"></div>'+
180						 '<iframe class="mfp-iframe" frameborder="0" allowfullscreen></iframe>'+
181						 '<div class="mfp-title">Some caption</div>'+
182						 '</div>'
183			},
184			callbacks: {
185				markupParse: function(template, values, item) {
186					values.title = item.el.attr('title');
187				}
188			}
189		});
190		}
191		if($(".popup-youtube, .popup-vimeo, .popup-gmaps").length > 0 ) {
192			/* magnificPopup for paly video function end*/
193			$('.popup-youtube, .popup-vimeo, .popup-gmaps').magnificPopup({
194				disableOn: 700,
195				type: 'iframe',
196				mainClass: 'mfp-fade',
197				removalDelay: 160,
198				preloader: false,
199
200				fixedContentPos: false
201			});
202		}
203	}
204	
205	
206	/* Scroll To Top ============ */
207	var scrollTop = function (){
208		'use strict';
209		var scrollTop = jQuery("button.scroltop");
210		/* page scroll top on click function */	
211		scrollTop.on('click',function() {
212			jQuery("html, body").animate({
213				scrollTop: 0
214			}, 1000);
215			return false;
216		})
217
218		jQuery(window).bind("scroll", function() {
219			var scroll = jQuery(window).scrollTop();
220			if (scroll > 900) {
221				jQuery("button.scroltop").fadeIn(1000);
222			} else {
223				jQuery("button.scroltop").fadeOut(1000);
224			}
225		});
226		/* page scroll top on click function end*/
227	}
228	
229	/* handle Accordian ============ */
230	var handleAccordian = function(){
231		/* accodin open close icon change */	 	
232		jQuery('#accordion').on('hidden.bs.collapse', function(e){
233			jQuery(e.target)
234				.prev('.panel-heading')
235				.find("i.indicator")
236				.toggleClass('glyphicon-minus glyphicon-plus');
237		});
238		jQuery('#accordion').on('shown.bs.collapse', function(e){
239			jQuery(e.target)
240				.prev('.panel-heading')
241				.find("i.indicator")
242				.toggleClass('glyphicon-minus glyphicon-plus');
243		});
244		/* accodin open close icon change end */
245	}
246	
247	/* Equal Height ============ */
248	var equalHeight = function(container) {
249		
250		if(jQuery(container).length == 0)
251		{
252			return false
253		}
254			
255		var currentTallest = 0, 
256			currentRowStart = 0, 
257			rowDivs = new Array(), 
258			$el, topPosition = 0;
259			
260		$(container).each(function() {
261			$el = $(this);
262			$($el).height('auto')
263			topPostion = $el.position().top;
264
265			if (currentRowStart != topPostion) {
266				for (currentDiv = 0; currentDiv < rowDivs.length; currentDiv++) {
267					rowDivs[currentDiv].height(currentTallest);
268				}
269				rowDivs.length = 0; // empty the array
270				currentRowStart = topPostion;
271				currentTallest = $el.height();
272				rowDivs.push($el);
273			} else {
274				rowDivs.push($el);
275				currentTallest = (currentTallest < $el.height()) ? ($el.height()) : (currentTallest);
276			}
277			for (currentDiv = 0; currentDiv < rowDivs.length; currentDiv++) {
278				rowDivs[currentDiv].height(currentTallest);
279			}
280		});
281		
282	}
283	
284	/* Footer Align ============ */
285	var footerAlign = function() {
286		'use strict';
287		jQuery('.site-footer').css('display', 'block');
288		jQuery('.site-footer').css('height', 'auto');
289		var footerHeight = jQuery('.site-footer').outerHeight();
290		jQuery('.footer-fixed > .page-wraper').css('padding-bottom', footerHeight);
291		jQuery('.site-footer').css('height', footerHeight);
292	}
293	
294	/* File Input ============ */
295	var fileInput = function(){
296		'use strict';
297		/* Input type file jQuery */	 	 
298		jQuery(document).on('change', '.btn-file :file', function() {
299			var input = jQuery(this);
300			var	numFiles = input.get(0).files ? input.get(0).files.length : 1;
301			var	label = input.val().replace(/\\/g, '/').replace(/.*\//, '');
302			input.trigger('fileselect', [numFiles, label]);
303		});
304		
305		jQuery('.btn-file :file').on('fileselect', function(event, numFiles, label) {
306			input = jQuery(this).parents('.input-group').find(':text');
307			var log = numFiles > 10 ? numFiles + ' files selected' : label;
308		
309			if (input.length) {
310				input.val(log);
311			} else {
312				//if (log) alert(log);
313			}
314		});
315		/* Input type file jQuery end*/
316	}
317	
318	/* Header Fixed ============ */
319	var headerFix = function(){
320		'use strict';
321		/* Main navigation fixed on top  when scroll down function custom */		
322		jQuery(window).on('scroll', function () {
323			if(jQuery('.sticky-header').length > 0){
324				var menu = jQuery('.sticky-header');
325				if ($(window).scrollTop() > menu.offset().top) {
326					menu.addClass('is-fixed');
327					$('.site-header .container > .logo-header .logo').attr('src','images/logo.png');
328					$('.site-header .container > .logo-header .logo-2').attr('src','images/logo-2.png');
329					$('.site-header .container > .logo-header .logo-3').attr('src','images/logo-3.png');
330				} else {
331					menu.removeClass('is-fixed');
332					$('.site-header .container > .logo-header .logo, .site-header .container > .logo-header .logo-2, .site-header .container > .logo-header .logo-3').attr('src','images/logo-white.png')
333				}
334			}
335		});
336		/* Main navigation fixed on top  when scroll down function custom end */
337	}
338	
339	/* Masonry Box ============ */
340	var masonryBox = function(){
341		'use strict';
342		
343		/* masonry by  = bootstrap-select.min.js */
344		if(jQuery('#masonry, .masonry').length > 0)
345		{
346			jQuery('.filters li').removeClass('active');
347			jQuery('.filters li:first').addClass('active');
348			var self = jQuery("#masonry, .masonry"); 
349			var filterValue = "";
350	 
351			if(jQuery('.card-container').length > 0)
352			{
353				var gutterEnable = self.data('gutter');
354				
355				var gutter = (self.data('gutter') === undefined)?0:self.data('gutter');
356				gutter = parseInt(gutter);
357				
358				
359				var columnWidthValue = (self.attr('data-column-width') === undefined)?'':self.attr('data-column-width');
360				if(columnWidthValue != ''){columnWidthValue = parseInt(columnWidthValue);}
361				
362				//alert(columnWidthValue);
363				
364				self.imagesLoaded(function () {
365					filter: filterValue,
366					self.masonry({
367						gutter: gutter,
368						columnWidth:columnWidthValue, 
369						//columnWidth:3, 
370						//gutterWidth: 15,
371						isAnimated: true,
372						itemSelector: ".card-container",
373						//horizontalOrder: true,
374						//fitWidth: true,
375						//stagger: 30
376						//containerStyle: null
377						//percentPosition: true
378					});
379					
380				}); 
381				
382			} 
383		}
384		if(jQuery('.filters').length)
385		{
386			jQuery(".filters li:first").addClass('active');
387			
388			jQuery(".filters").on("click", "li", function() {
389				
390				jQuery('.filters li').removeClass('active');
391				jQuery(this).addClass('active');
392				
393				var filterValue = $(this).attr("data-filter");
394				self.isotope({ 
395					filter: filterValue,
396					masonry: {
397						gutter: gutter,
398						columnWidth: columnWidthValue,
399						isAnimated: true,
400						itemSelector: ".card-container"
401					}
402				});
403			});
404		}
405		
406		/* masonry by  = bootstrap-select.min.js end */
407	}
408	
409	
410	/* Counter Number ============ */
411	var counter = function(){
412		if(jQuery('.counter').length)
413		{
414			jQuery('.counter').counterUp({
415				delay: 10,
416				time: 3000
417			});	
418		}
419	}
420	
421	/* Video Popup ============ */
422	var handleVideo = function(){
423		/* Video responsive function */	
424		jQuery('iframe[src*="youtube.com"]').wrap('<div class="embed-responsive embed-responsive-16by9"></div>');
425		jQuery('iframe[src*="vimeo.com"]').wrap('<div class="embed-responsive embed-responsive-16by9"></div>');	
426		/* Video responsive function end */
427	}
428	
429	/* Gallery Filter ============ */
430	var handleFilterMasonary = function(){
431		/* gallery filter activation = jquery.mixitup.min.js */ 
432		if (jQuery('#image-gallery-mix').length) {
433			jQuery('.gallery-filter').find('li').each(function () {
434				$(this).addClass('filter');
435			});
436			jQuery('#image-gallery-mix').mixItUp();
437		};
438		if(jQuery('.gallery-filter.masonary').length){
439			jQuery('.gallery-filter.masonary').on('click','span', function(){
440				var selector = $(this).parent().attr('data-filter');
441				jQuery('.gallery-filter.masonary span').parent().removeClass('active');
442				jQuery(this).parent().addClass('active');
443				jQuery('#image-gallery-isotope').isotope({ filter: selector });
444				return false;
445			});
446		}
447		/* gallery filter activation = jquery.mixitup.min.js */
448	}
449	
450	/* handle Bootstrap Select ============ */
451	var handleBootstrapSelect = function(){
452		/* Bootstrap Select box function by  = bootstrap-select.min.js */ 
453		if (jQuery('select').length) {
454		    jQuery('select').selectpicker();
455		}
456		/* Bootstrap Select box function by  = bootstrap-select.min.js end*/
457	}
458	
459	/* Resizebanner ============ */
460	var handleBannerResize = function(){
461		$(".full-height").css("height", $(window).height());
462	}
463	
464	/* Countdown ============ */
465	var handleCountDown = function(WebsiteLaunchDate){
466		/* Time Countr Down Js */
467		if($(".countdown").length)
468		{
469			$('.countdown').countdown({date: WebsiteLaunchDate+' 23:5'}, function() {
470				$('.countdown').text('we are live');
471			});
472		}
473		/* Time Countr Down Js End */
474	}
475	
476	/*handlePlaceholderAnimation*/
477	var handlePlaceholderAnimation = function()
478	{
479		/*if(jQuery('.dezPlaceAni').length)
480		{*/
481		
482			$('input, textarea').focus(function(){
483			  $(this).parents('.form-group').addClass('focused');
484			});
485			
486			$('input, textarea').blur(function(){
487			  var inputValue = $(this).val();
488			  if ( inputValue == "" ) {
489				$(this).removeClass('filled');
490				$(this).parents('.form-group').removeClass('focused');  
491			  } else {
492				$(this).addClass('filled');
493			  }
494			})
495		/*}*/
496	}
497	
498	
499	
500	/* WOW ANIMATION ============ */
501	var wow_animation = function(){
502		if($('.wow').length > 0)
503		{
504			var wow = new WOW(
505			{
506			  boxClass:     'wow',      // animated element css class (default is wow)
507			  animateClass: 'animated', // animation css class (default is animated)
508			  offset:       0,          // distance to the element when triggering the animation (default is 0)
509			  mobile:       false       // trigger animations on mobile devices (true is default)
510			});
511			wow.init();	
512		}	
513	}
514	
515	/* BGEFFECT ============ */
516	
517	var reposition = function (){
518		'use strict';
519		var modal = jQuery(this),
520		dialog = modal.find('.modal-dialog');
521		modal.css('display', 'block');
522		
523		/* Dividing by two centers the modal exactly, but dividing by three 
524		 or four works better for larger screens.  */
525		dialog.css("margin-top", Math.max(0, (jQuery(window).height() - dialog.height()) / 2));
526	}
527	
528	var handelResize = function (){
529		
530		/* Reposition when the window is resized */
531		jQuery(window).on('resize', function() {
532			jQuery('.modal:visible').each(reposition);
533		
534			equalHeight('.equal-wraper .equal-col');
535			footerAlign();
536		});
537	}
538	
539	/* Website Launch Date */ 
540	var WebsiteLaunchDate = new Date();
541	monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "
541November", "December"];
542	WebsiteLaunchDate.setMonth(WebsiteLaunchDate.getMonth() + 1);
543	WebsiteLaunchDate =  WebsiteLaunchDate.getDate() + " " + monthNames[WebsiteLaunchDate.getMonth()] + " " + WebsiteLaunchDate.getFullYear();
544	/* Website Launch Date END */ 
545	
546	/* Header Height ============ */
547	var setResizeMargin = function(){
548		if(($('.setResizeMargin').length > 0) && screenWidth >= 1280){
549			var containerSize = $('.container').width();
550			var getMargin = (screenWidth - containerSize)/2;
551			$('.setResizeMargin').css('margin-left',getMargin);
552		}
553		if(($('.setResizeMargin-right').length > 0) && screenWidth >= 1280){
554			var containerSize = $('.container').width();
555			var getMargin = (screenWidth - containerSize)/2;
556			$('.setResizeMargin-right').css('margin-right',getMargin);
557		}
558	}
559	
560	/* LightGallery ============ */
561	var lightGallery = function (){
562		if(($('#lightgallery, .lightgallery').length > 0)){
563			$('#lightgallery, .lightgallery').lightGallery({
564				selector : '.lightimg',
565				loop:true,
566				thumbnail:true,
567				exThumbImage: 'data-exthumbimage'
568			});
569		}
570	}	
571	
572	/* handle Bootstrap Touch Spin ============ */
573	var handleBootstrapTouchSpin = function(){
574		if(jQuery("input[name='demo_vertical2']").length)
575		{
576			jQuery("input[name='demo_vertical2']").TouchSpin({
577			  verticalbuttons: true,
578			  verticalupclass: 'ti-plus',
579			  verticaldownclass: 'ti-minus'
580			});
581		}
582	}
583	
584	var boxHover = function(){
585		jQuery('.pricingtable-wrapper, .box-hover').on('mouseenter',function(){
586			var selector = jQuery(this).parent().parent();
587			selector.find('.pricingtable-wrapper, .box-hover').removeClass('active');
588			jQuery(this).addClass('active');
589		});
590	}
591	
592	var customFileUpload = function(){	
593		$(".custom-file-input").on("change", function() {
594			var fileName = $(this).val().split("\\").pop();
595			$(this).siblings(".custom-file-label").addClass("selected").html(fileName);
596		});
597	}
598	
599	/* Range ============ */
600	var priceslider = function(){
601
602		if($(".price-slide, .price-slide-2").length > 0 ) {
603			$("#slider-range,#slider-range-2").slider({
604				range: true,
605				min: 300,
606				max: 4000,
607				values: [0, 5000],
608				slide: function(event, ui) {
609					var min = ui.values[0],
610						max = ui.values[1];
611					  $('#' + this.id).prev().val("$" + min + " - $" + max);
612				}
613			});
614		}
615	}
616	
617	var handleSupport = function(){
618		var support = '<a href="https://1.envato.market/VLMVO" target="_blank" class="bt-buy-now theme-btn"><i class="ti-shopping-cart"></i><span>Buy Now</span></a><a href="https://support.w3itexperts.com" target="_blank" class="bt-support-now theme-btn"><i class="ti-headphone-alt"></i><span>Support</span></a><!-- Go to www.addthis.com/dashboard to customize your tools --><script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5b221c5e31b4e54b"></script>';
619		jQuery('body').append(support);
620	}
621	
622	var handlePricingTabs = function(){
623		jQuery('.pricingtable-price.year').css("display","none");
624		jQuery('.toggle-tabs').on('click',function(){
625			if(jQuery('.toggle-tabs').hasClass('monthly')){
626				jQuery('.pricingtable-price.year').css("display","none");
627				jQuery('.pricingtable-price.month').css("display","block");
628			}
629			if(jQuery('.toggle-tabs').hasClass('yearly')){
630				jQuery('.pricingtable-price.year').css("display","block");
631				jQuery('.pricingtable-price.month').css("display","none");
632			}
633		})
634	}
635	
636	/* Function ============ */
637	return {
638		init:function(){
639			boxHover();
640			wow_animation();
641			onePageLayout();
642			dzTheme();
643			homeSearch();
644			handleResizeElement();
645			handlePlaceholderAnimation();
646			MagnificPopup();
647			handleAccordian();
648			scrollTop();
649			footerAlign();
650			fileInput();
651			headerFix();
652			handleVideo();
653			handleFilterMasonary();
654			handleCountDown(WebsiteLaunchDate);
655			handleBannerResize();
656			setResizeMargin();
657			handelResize();
658			lightGallery();
659			jQuery('.modal').on('show.bs.modal', reposition);
660			customFileUpload();
661			priceslider();
662			//handleSupport();
663			handlePricingTabs();
664		},
665
666		
667		load:function(){
668			handleBootstrapSelect();
669			equalHeight('.equal-wraper .equal-col');
670			counter();
671			masonryBox();
672			handleBootstrapTouchSpin();
673			
674		},
675		
676		resize:function(){
677			screenWidth = $(window).width();
678			dzTheme();
679			setTimeout(function(){
680				handleResizeElement();
681			}, 500);
682			
683		}
684	}
685	
686}();
687
688/* Document.ready Start */	
689jQuery(document).ready(function() {
690    'use strict';
691	Samar.init();
692	
693	jQuery('.navicon').on('click',function(){
694		$(this).toggleClass('open');
695	});
696
697});
698/* Document.ready END */
699
700/* Window Load START */
701jQuery(window).on('load',function () {
702	'use strict'; 
703	Samar.load();
704	setTimeout(function(){
705		jQuery('#loading-area').remove();
706	}, 0);
707});
708/*  Window Load END */
709/* Window Resize START */
710jQuery(window).on('resize',function () {
711	'use strict'; 
712	Samar.resize();
713});
714/*  Window Resize END */

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.