PageSourceSearch

https://wahidmarketing.com/assets/js/script.js

js wahidmarketing.com collected 2026-10-04 08:22:20 UTC 18,448 bytes, 657 lines download raw bytes

1(function($) {
2	
3	"use strict";
4
5	
6	//Hide Loading Box (Preloader)
7	function handlePreloader() {
8		if($('.loader-wrap').length){
9			$('.loader-wrap').delay(1000).fadeOut(500);
10		}
11		TweenMax.to($(".loader-wrap .overlay"), 1.2, {
12            force3D: true,
13            left: "100%",
14            ease: Expo.easeInOut,
15        });
16	}
17
18	//Event Countdown Timer
19	if($('.time-countdown').length){  
20		$('.time-countdown').each(function() {
21		var $this = $(this), finalDate = $(this).data('countdown');
22		$this.countdown(finalDate, function(event) {
23			var $this = $(this).html(event.strftime('' + '<div class="counter-column"><span class="count">%D</span>Days</div> ' + '<div class="counter-column"><span class="count">%H</span>Hours</div>  ' + '<div class="counter-column"><span class="count">%M</span>Minutes</div>  ' + '<div class="counter-column"><span class="count">%S</span>Seconds</div>'));
24		});
25	 });
26	}
27
28	if ($(".preloader-close").length) {
29        $(".preloader-close").on("click", function(){
30            $('.loader-wrap').delay(200).fadeOut(500);
31        })
32    }
33
34    function dynamicCurrentMenuClass(selector) {
35        let FileName = window.location.href.split('/').reverse()[0];
36
37        selector.find('li').each(function () {
38            let anchor = $(this).find('a');
39            if ($(anchor).attr('href') == FileName) {
40                $(this).addClass('current');
41            }
42        });
43        // if any li has .current elmnt add class
44        selector.children('li').each(function () {
45            if ($(this).find('.current').length) {
46                $(this).addClass('current');
47            }
48        });
49        // if no file name return 
50        if ('' == FileName) {
51            selector.find('li').eq(0).addClass('current');
52        }
53    }
54
55    // dynamic current class        
56    let mainNavUL = $('.main-menu').find('.navigation');
57    dynamicCurrentMenuClass(mainNavUL);
58	
59	//Update Header Style and Scroll to Top
60	function headerStyle() {
61		if($('.main-header').length){
62			var windowpos = $(window).scrollTop();
63			var siteHeader = $('.main-header');
64			var scrollLink = $('.scroll-to-top');
65			var sticky_header = $('.main-header .sticky-header');
66			if (windowpos > 100) {
67				siteHeader.addClass('fixed-header');
68				sticky_header.addClass("animated slideInDown");
69				scrollLink.fadeIn(300);
70			} else {
71				siteHeader.removeClass('fixed-header');
72				sticky_header.removeClass("animated slideInDown");
73				scrollLink.fadeOut(300);
74			}
75		}
76	}
77	
78	headerStyle();
79
80	//Submenu Dropdown Toggle
81	if($('.main-header li.dropdown ul').length){
82		$('.main-header .navigation li.dropdown').append('<div class="dropdown-btn"><span class="fa fa-angle-right"></span></div>');
83	}
84
85	//Hidden Sidebar
86	if($('.hidden-sidebar').length){
87
88		var animButton = $(".sidemenu-nav-toggler"),
89	        hiddenBar = $(".hidden-sidebar"),
90	        navOverlay = $(".nav-overlay"),
91	        hiddenBarClose = $(".hidden-sidebar-close");
92
93	    function showMenu() {
94	        TweenMax.to(hiddenBar, 0.6, {
95	            force3D: false,
96	            right: "0",
97	            ease: Expo.easeInOut
98	        });
99	        hiddenBar.removeClass("close-sidebar");
100	    	navOverlay.fadeIn(500);
101	    }
102
103	    function hideMenu() {
104	        TweenMax.to(hiddenBar, 0.6, {
105	            force3D: false,
106	            right: "-480px",
107	            ease: Expo.easeInOut
108	        });
109	        hiddenBar.addClass("close-sidebar");
110	        navOverlay.fadeOut(500);
111	    }
112	    animButton.on("click", function() {
113	        if (hiddenBar.hasClass("close-sidebar")) showMenu();
114	        else hideMenu();
115	    });
116	    navOverlay.on("click", function() {
117	    	hideMenu();
118	    });
119	    hiddenBarClose.on("click", function() {
120	    	hideMenu();
121	    });
122	}
123
124	if ($('.nav-overlay').length) {
125		// / cursor /
126		var cursor = $(".nav-overlay .cursor"),
127		follower = $(".nav-overlay .cursor-follower");
128
129		var posX = 0,
130		posY = 0;
131
132		var mouseX = 0,
133		mouseY = 0;
134
135		TweenMax.to({}, 0.016, {
136			repeat: -1,
137			onRepeat: function() {
138				posX += (mouseX - posX) / 9;
139				posY += (mouseY - posY) / 9;
140
141				TweenMax.set(follower, {
142					css: { 
143						left: posX - 22,
144						top: posY - 22
145					}
146				});
147
148				TweenMax.set(cursor, {
149					css: { 
150						left: mouseX,
151						top: mouseY
152					}
153				});
154
155			}
156		});
157
158		$(document).on("mousemove", function(e) {
159			var scrollTop = window.pageYOffset || document.documentElement.scrollTop;
160			mouseX = e.pageX;
161			mouseY = e.pageY - scrollTop;
162		});
163		$("button, a").on("mouseenter", function() {
164			cursor.addClass("active");
165			follower.addClass("active");
166		});
167		$("button, a").on("mouseleave", function() {
168			cursor.removeClass("active");
169			follower.removeClass("active");
170		});
171		$(".nav-overlay").on("mouseenter", function() {
172			cursor.addClass("close-cursor");
173			follower.addClass("close-cursor");
174		});
175		$(".nav-overlay").on("mouseleave", function() {
176			cursor.removeClass("close-cursor");
177			follower.removeClass("close-cursor");
178		});
179	}
180
181	//Mobile Nav Hide Show
182	if($('.mobile-menu').length){
183		
184		$('.mobile-menu .menu-box').mCustomScrollbar();
185		
186		var mobileMenuContent = $('.main-header .nav-outer .main-menu').html();
187		$('.mobile-menu .menu-box .menu-outer').append(mobileMenuContent);
188		$('.sticky-header .main-menu').append(mobileMenuContent);
189		
190		//Dropdown Button
191		$('.mobile-menu li.dropdown .dropdown-btn').on('click', function() {
192			$(this).toggleClass('open');
193			$(this).prev('ul').slideToggle(500);
194		});
195		//Menu Toggle Btn
196		$('.mobile-nav-toggler').on('click', function() {
197			$('body').addClass('mobile-menu-visible');
198		});
199
200		//Menu Toggle Btn
201		$('.mobile-menu .menu-backdrop,.mobile-menu .close-btn,.scroll-nav li a').on('click', function() {
202			$('body').removeClass('mobile-menu-visible');
203		});
204	}
205
206	//Sidemenu Nav Hide Show
207	if($('.side-menu').length){
208		
209		$('.side-menu .menu-box').mCustomScrollbar();
210		
211		//Dropdown Button
212		$('.side-menu li.dropdown .dropdown-btn').on('click', function() {
213			$(this).toggleClass('open');
214			$(this).prev('ul').slideToggle(500);
215		});
216
217		$('body').addClass('side-menu-visible');
218		//Menu Toggle Btn
219		$('.side-nav-toggler').on('click', function() {
220			$('body').addClass('side-menu-visible');
221		});
222
223		//Menu Toggle Btn
224		$('.side-menu .side-menu-resize').on('click', function() {
225			$('body').toggleClass('side-menu-visible');
226		});
227
228		//Menu Toggle Btn
229		$('.main-header .mobile-nav-toggler-two').on('click', function() {
230			$('body').addClass('side-menu-visible-s2');
231		});
232
233		//Menu Overlay
234		$('.main-header .side-menu-overlay').on('click', function() {
235			$('body').removeClass('side-menu-visible-s2');
236		});
237	}
238	
239	//Search Popup
240	if($('#search-popup').length){
241		
242		//Show Popup
243		$('.search-toggler').on('click', function() {
244			$('#search-popup').addClass('popup-visible');
245		});
246		$(document).keydown(function(e){
247	        if(e.keyCode === 27) {
248	            $('#search-popup').removeClass('popup-visible');
249	        }
250	    });
251		//Hide Popup
252		$('.close-search,.search-popup .overlay-layer').on('click', function() {
253			$('#search-popup').removeClass('popup-visible');
254		});
255	}
256
257	// Language Selector
258	$(".languages").click(function(){
259       $(".languages ul").show();
260    })
261	$(".languages ul").mouseleave(function(){
262	    $(".languages ul").hide(); 
263	});
264   
265	$(".languages li a").click(function(){
266       $(".languages li a").removeClass('sel');
267       $(this).addClass('sel');
268       var selectedValue = $(this).text();
269       var showLang = selectedValue.substring(0, 2);
270       $('.languages .current').html(showLang);
271       $('.languages .current').attr("title", selectedValue);
272       $('.languages .hover').html(selectedValue);
273    })
274
275	function bannerSlider() {
276	    if ($(".banner-slider").length > 0) {
277
278		    // Banner Slider
279			var bannerSlider = new Swiper('.banner-slider', {
280				preloadImages: false,
281                loop: true,
282                grabCursor: true,
283                centeredSlides: false,
284                resistance: true,
285                resistanceRatio: 0.6,
286                speed: 1400,
287                spaceBetween: 0,
288                parallax: false,
289                effect: "fade",
290                fadeEffect: {
291                    crossFade: true
292                },
293				autoplay: {
294				    delay: 4000,
295                    disableOnInteraction: false
296				},
297	            navigation: {
298	                nextEl: '.banner-slider-button-next',
299	                prevEl: '.banner-slider-button-prev',
300	            },
301			});
302		}
303
304
305	}
306
307	//Price Range Slider
308	if($('.price-range-slider').length){
309		$( ".price-range-slider" ).slider({
310			range: true,
311			min: 10,
312			max: 200,
313			values: [ 10, 99 ],
314			slide: function( event, ui ) {
315			$( "input.property-amount" ).val( ui.values[ 0 ] + " - " + ui.values[ 1 ] );
316			}
317		});
318		
319		$( "input.property-amount" ).val( $( ".price-range-slider" ).slider( "values", 0 ) + " - $" + $( ".price-range-slider" ).slider( "values", 1 ) );	
320	}
321
322	// Lazyload Images
323	if($('.lazy-image').length){
324		new LazyLoad({
325			elements_selector: ".lazy-image",
326			load_delay: 0,
327			threshold: 300
328		});
329	}
330	
331	/////////////////////////////
332		//Universal Code for All Owl Carousel Sliders
333	/////////////////////////////
334	
335	if ($('.theme_carousel').length) {
336			$(".theme_carousel").each(function (index) {
337			var $owlAttr = {},
338			$extraAttr = $(this).data("options");
339			$.extend($owlAttr, $extraAttr);
340			$(this).owlCarousel($owlAttr);
341		});
342	}
343	
344	// Donation Progress Bar
345	if ($('.count-bar').length) {
346		$('.count-bar').appear(function(){
347			var el = $(this);
348			var percent = el.data('percent');
349			$(el).css('width',percent).addClass('counted');
350		},{accY: -50});
351
352	}
353
354	//Jquery Spinner / Quantity Spinner
355	if($('.quantity-spinner').length){
356		$("input.quantity-spinner").TouchSpin({
357		  verticalbuttons: true
358		});
359	}
360	
361	//Fact Counter + Text Count
362	if($('.count-box').length){
363		$('.count-box').appear(function(){
364	
365			var $t = $(this),
366				n = $t.find(".count-text").attr("data-stop"),
367				r = parseInt($t.find(".count-text").attr("data-speed"), 10);
368				
369			if (!$t.hasClass("counted")) {
370				$t.addClass("counted");
371				$({
372					countNum: $t.find(".count-text").text()
373				}).animate({
374					countNum: n
375				}, {
376					duration: r,
377					easing: "linear",
378					step: function() {
379						$t.find(".count-text").text(Math.floor(this.countNum));
380					},
381					complete: function() {
382						$t.find(".count-text").text(this.countNum);
383					}
384				});
385			}
386			
387		},{accY: 0});
388	}
389	
390	//Tabs Box
391	if($('.tabs-box').length){
392		$('.tabs-box .tab-buttons .tab-btn').on('click', function(e) {
393			e.preventDefault();
394			var target = $($(this).attr('data-tab'));
395			
396			if ($(target).is(':visible')){
397				return false;
398			}else{
399				target.parents('.tabs-box').find('.tab-buttons').find('.tab-btn').removeClass('active-btn');
400				$(this).addClass('active-btn');
401				target.parents('.tabs-box').find('.tabs-content').find('.tab').fadeOut(0);
402				target.parents('.tabs-box').find('.tabs-content').find('.tab').removeClass('active-tab');
403				$(target).fadeIn(300);
404				$(target).addClass('active-tab');
405			}
406		});
407	}
408	
409	//Accordion Box
410	if($('.accordion-box').length){
411		$(".accordion-box").on('click', '.acc-btn', function() {
412			
413			var outerBox = $(this).parents('.accordion-box');
414			var target = $(this).parents('.accordion');
415			
416			if($(this).hasClass('active')!==true){
417				$(outerBox).find('.accordion .acc-btn').removeClass('active');
418			}
419			
420			if ($(this).next('.acc-content').is(':visible')){
421				return false;
422			}else{
423				$(this).addClass('active');
424				$(outerBox).children('.accordion').removeClass('active-block');
425				$(outerBox).find('.accordion').children('.acc-content').slideUp(300);
426				target.addClass('active-block');
427				$(this).next('.acc-content').slideDown(300);	
428			}
429		});	
430	}
431	
432
433	//LightBox / Fancybox
434	if($('.lightbox-image').length) {
435		$('.lightbox-image').fancybox({
436			openEffect  : 'fade',
437			closeEffect : 'fade',
438			helpers : {
439				media : {}
440			}
441		});
442	}
443
444	//Sortable Masonary with Filters
445	function sortableMasonry() {
446		if ($('.sortable-masonry').length) {
447			var winDow = $(window);
448			// Needed variables
449			var $container = $('.sortable-masonry .items-container');
450			var $filter = $('.filter-btns');
451			$container.isotope({
452				filter: '.all',
453				animationOptions: {
454					duration: 500,
455					easing: 'linear'
456				}
457			});
458			// Isotope Filter 
459			$filter.find('li').on('click', function() {
460				var selector = $(this).attr('data-filter');
461				try {
462					$container.isotope({
463						filter: selector,
464						animationOptions: {
465							duration: 500,
466							easing: 'linear',
467							queue: false
468						}
469					});
470				} catch (err) {}
471				return false;
472			});
473			winDow.on('resize', function() {
474				var selector = $filter.find('li.active').attr('data-filter');
475				$container.isotope({
476					filter: selector,
477					animationOptions: {
478						duration: 500,
479						easing: 'linear',
480						queue: false
481					}
482				});
483				$container.isotope()
484			});
485			var filterItemA = $('.filter-btns li');
486			filterItemA.on('click', function() {
487				var $this = $(this);
488				if (!$this.hasClass('active')) {
489					filterItemA.removeClass('active');
490					$this.addClass('active');
491				}
492			});
493			$container.isotope("on", "layoutComplete", function(a, b) {
494                var a = b.length,
495                pcn = $(".filters .count");
496                pcn.html(a);                
497            }); 
498		}
499	}
500	sortableMasonry();
501
502
503	// Testimonial 
504	if ($('.testimonial-carousel').length) {
505		var testimonialThumb = new Swiper('.testimonial-thumbs', {
506			preloadImages: false,
507            loop: true,
508            speed: 2400,
509            slidesPerView: 3,
510            centeredSlides: true,
511            spaceBetween: 0,
512            effect: "slide",
513		});
514		var totalSlides = $(".swiper-container").length;
515		var testimonialContent = new Swiper('.testimonial-content', {
516			preloadImages: false,
517            loop: true,
518            speed: 2400,
519            spaceBetween: 0,
520            effect: "slide",
521            thumbs: {
522                swiper: testimonialThumb
523            }
524			
525		});
526		
527	}
528
529
530	// Single Image Carousel 
531	if ($('.single-image-carousel').length) {
532		var productThumbs = new Swiper('.single-image-carousel', {
533			preloadImages: false,
534            loop: true,
535            speed: 1400,
536            spaceBetween: 0,
537            effect: "fade",
538            autoplay: {
539			    delay: 5000,
540                disableOnInteraction: false
541			},
542
543			navigation: {
544	                nextEl: '.slider-button-next',
545	                prevEl: '.slider-button-prev',
546	            },
547		});
548
549	}
550
551	//Projects Tabs
552	if($('.project-tab').length){
553		$('.project-tab .project-tab-btns .p-tab-btn').on('click', function(e) {
554			e.preventDefault();
555			var target = $($(this).attr('data-tab'));
556			
557			if ($(target).hasClass('actve-tab')){
558				return false;
559			}else{
560				$('.project-tab .project-tab-btns .p-tab-btn').removeClass('active-btn');
561				$(this).addClass('active-btn');
562				$('.project-tab .p-tabs-content .p-tab').removeClass('active-tab');
563				$(target).addClass('active-tab');
564			}
565		});
566	}
567
568	// Isotop Layout
569	function isotopeBlock() {
570		if($(".isotope-block").length){
571			var $grid = $('.isotope-block').isotope();
572	
573		}
574	}
575
576	isotopeBlock();
577
578	//Progress Bar / Levels
579	if ($('.progress-levels .progress-box .bar-fill').length) {
580		$(".progress-box .bar-fill").each(function() {
581			var progressWidth = $(this).attr('data-percent');
582			$(this).css('width', progressWidth + '%');
583			$(this).children('.percent').html(progressWidth + '%');
584		});
585	}
586
587	// Scroll to a Specific Div
588	if($('.scroll-to-target').length){
589		$(".scroll-to-target").on('click', function() {
590			var target = $(this).attr('data-target');
591		   // animate
592		   $('html, body').animate({
593			   scrollTop: $(target).offset().top
594			 }, 1500);
595		});
596	}
597
598	if ($('.ajax-sub-form').length > 0) {
599	    $('.ajax-sub-form').ajaxChimp({
600	          language: 'es',
601	          url: "https://gmail.us17.list-manage.com/subscribe/post?u=8a43765a655b07d21fa500e4e&amp;id=2eda0a58a7" //Replace this with your mailchimp post URL.
602	    });
603
604	    $.ajaxChimp.translations.es = {
605	        'submit': 'Submitting...',
606	        0: 'Thanks for your subscription',
607	        1: 'Please enter a valid email',
608	        2: 'An email address must contain a single @',
609	        3: 'The domain portion of the email address is invalid (the portion after the @: )',
610	        4: 'The username portion of the email address is invalid (the portion before the @: )',
611	        5: 'This email address looks fake or invalid. Please enter a real email address'
612	    };
613	}
614
615	
616
617	
618	// Elements Animation
619	if($('.wow').length){
620		var wow = new WOW(
621		  {
622			boxClass:     'wow',      // animated element css class (default is wow)
623			animateClass: 'animated', // animation css class (default is animated)
624			offset:       0,          // distance to the element when triggering the animation (default is 0)
625			mobile:       true,       // trigger animations on mobile devices (default is true)
626			live:         true       // act on asynchronously loaded content (default is true)
627		  }
628		);
629		wow.init();
630	}
631
632	//Add One Page nav
633	if($('.scroll-nav').length) {
634		$('.scroll-nav ul').onePageNav();
635	}
636
637
638/* ==========================================================================
639   When document is Scrollig, do
640   ========================================================================== */
641	
642	$(window).on('scroll', function() {
643		headerStyle();
644	});
645	
646/* ==========================================================================
647   When document is loading, do
648   ========================================================================== */
649	
650	$(window).on('load', function() {
651		handlePreloader();
652		sortableMasonry();
653		isotopeBlock();
654		bannerSlider();		
655	});	
656
657})(window.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.