PageSourceSearch

https://gayashan1991.github.io/TND/js/script.js

js gayashan1991.github.io collected 2026-10-03 09:14:04 UTC 16,061 bytes, 647 lines download raw bytes

1(function($) {
2	
3	"use strict";
4	
5	//Hide Loading Box (Preloader)
6	function handlePreloader() {
7		if($('.preloader').length){
8			$('.preloader').delay(200).fadeOut(500);
9		}
10	}
11	
12	//Update Header Style and Scroll to Top
13	function headerStyle() {
14		if($('.main-header').length){
15			var windowpos = $(window).scrollTop();
16			var siteHeader = $('.main-header');
17			var scrollLink = $('.scroll-to-top');
18			var sticky_header = $('.main-header .sticky-header');
19			if (windowpos > 700) {
20				siteHeader.addClass('fixed-header');
21				scrollLink.fadeIn(300);
22			} else{
23				siteHeader.removeClass('fixed-header');
24				scrollLink.fadeOut(300);
25			}
26		}
27	}
28	headerStyle();
29
30	//Sticky Header Hide/Show On Scroll
31	(function($) {
32		var iScrollPos = 0;
33		var sticky_header = $('.main-header .sticky-header');
34		$(window).scroll(function () {
35		    var iCurScrollPos = $(this).scrollTop();
36		    if (iCurScrollPos > iScrollPos) {
37		        $('.main-header .sticky-header').css({"position": "fixed", "width": "100%", "top": "-120px"});
38		    } else {
39		        $('.main-header .sticky-header').css({"top": "0"});
40		    }
41		    iScrollPos = iCurScrollPos;
42		});
43	})(jQuery);
44
45	//Submenu Dropdown Toggle
46	if($('.main-header li.dropdown ul').length){
47		$('.main-header .navigation li.dropdown').append('<div class="dropdown-btn"><span class="fa fa-plus"></span></div>');
48	}
49
50	//Mobile Nav Hide Show
51	if($('.mobile-menu').length){
52		
53		var mobileMenuContent = $('.main-header .nav-outer .main-menu').html();
54		var mobileHeaderContent = $('.main-header .nav-outer .outer-box').html();
55		var stickyMenuContent = $('.main-header .nav-outer .main-menu').html();
56		$('.mobile-menu').append('<div class="close-btn"><span class="icon fa fa-times"></span></div>');
57		$('.mobile-header .nav-outer').append('<div class="mobile-nav-toggler"><span class="icon fa fa-bars"></span></div>');
58		$('.mobile-menu .menu-box').append(mobileMenuContent);
59		$('.mobile-header .nav-outer').append(mobileHeaderContent);
60		$('.sticky-header .main-menu').append(stickyMenuContent);
61		$('.sticky-header .main-menu .navbar-collapse').addClass('show');
62		$('.mobile-menu .menu-box .navbar-collapse').addClass('show');
63		$('.mobile-menu .close-btn').on('click', function() {
64			$('body').removeClass('mobile-menu-visible');
65		});
66
67		//Dropdown Button
68		$('.mobile-menu li.dropdown .dropdown-btn').on('click', function() {
69			$(this).prev('ul').slideToggle(500);
70			$(this).toggleClass('active');
71		});
72		//Menu Toggle Btn
73		$('.mobile-nav-toggler').on('click', function() {
74			$('body').addClass('mobile-menu-visible');
75		});
76
77		//Menu Toggle Btn
78		$('.mobile-menu .menu-backdrop,.mobile-menu .close-btn').on('click', function() {
79			$('body').removeClass('mobile-menu-visible');
80		});
81	}
82
83	//Header Search
84	if($('.search-btn').length) {
85		$('.search-btn').on('click', function() {
86			$('.main-header').addClass('search-active');
87		});
88		$('.close-search, .search-back-drop').on('click', function() {
89			$('.main-header').removeClass('search-active');
90		});
91	}
92
93
94	//Services Carousel
95	if ($('.services-carousel').length) {
96		$('.services-carousel').owlCarousel({
97			loop:true,
98			margin:0,
99			nav:false,
100			smartSpeed: 700,
101			autoplay: false,
102			navText: [ '<span class="fa fa-angle-left"></span>', '<span class="fa fa-angle-right"></span>' ],
103			responsive:{
104				0:{
105					items:1
106				},
107				600:{
108					items:2
109				},
110				768:{
111					items:2
112				},
113				1024:{
114					items:3
115				},
116				1280:{
117					items:4
118				}
119			}
120		});    		
121	}
122
123	//Recipes Carousel
124	if ($('.recipes-carousel').length) {
125		$('.recipes-carousel').owlCarousel({
126			loop:true,
127			margin:0,
128			nav:false,
129			smartSpeed: 400,
130			autoplay: false,
131			navText: [ '<span class="fa fa-angle-left"></span>', '<span class="fa fa-angle-right"></span>' ],
132			responsive:{
133				0:{
134					items:1
135				},
136				768:{
137					items:1
138				},
139				1024:{
140					items:1
141				}
142			}
143		});    		
144	}
145
146	//Testimonial Carousel
147	if ($('.testimonial-carousel').length) {
148		$('.testimonial-carousel').owlCarousel({
149			loop:true,
150			margin:0,
151			nav:true,
152			smartSpeed: 700,
153			autoplay: true,
154			navText: [ '<span class="fa fa-angle-left"></span>', '<span class="fa fa-angle-right"></span>' ],
155			responsive:{
156				0:{
157					items:1
158				},
159				600:{
160					items:1
161				},
162				1024:{
163					items:1
164				},
165			}
166		});    		
167	}
168
169	//Testimonial Carousel
170	if ($('.testimonial-carousel-two').length) {
171		$('.testimonial-carousel-two').owlCarousel({
172			loop:false,
173			margin:30,
174			nav:true,
175			smartSpeed: 700,
176			autoplay: true,
177			navText: [ '<span class="fa fa-angle-left"></span>', '<span class="fa fa-angle-right"></span>' ],
178			responsive:{
179				0:{
180					items:1
181				},
182				768:{
183					items:2
184				},
185				1024:{
186					items:3
187				},
188			}
189		});    		
190	}
191
192	//Portfolio Carousel
193	if ($('.portfolio-carousel').length) {
194		$('.portfolio-carousel').owlCarousel({
195			loop:false,
196			margin:0,
197			nav:false,
198			smartSpeed: 400,
199			autoplay: false,
200			navText: [ '<span class="fa fa-angle-left"></span>', '<span class="fa fa-angle-right"></span>' ],
201			responsive:{
202				0:{
203					items:1
204				},
205				600:{
206					items:2
207				},
208				768:{
209					items:2
210				},
211				1024:{
212					items:3
213				}
214			}
215		});    		
216	}
217
218	//Team Carousel
219	if ($('.team-carousel').length) {
220		$('.team-carousel').owlCarousel({
221			loop:false,
222			margin:0,
223			nav:false,
224			smartSpeed: 700,
225			autoplay: false,
226			navText: [ '<span class="fa fa-angle-left"></span>', '<span class="fa fa-angle-right"></span>' ],
227			responsive:{
228				0:{
229					items:1
230				},
231				600:{
232					items:2
233				},
234				768:{
235					items:2
236				},
237				1024:{
238					items:3
239				},
240				1280:{
241					items:4
242				}
243			}
244		});    		
245	}
246
247	//Single Item Carousel
248	if ($('.single-item-carousel').length) {
249		$('.single-item-carousel').owlCarousel({
250			loop:true,
251			margin:0,
252			nav:true,
253			smartSpeed: 700,
254			autoplay: false,
255			navText: [ '<span class="fa fa-arrow-left"></span>', '<span class="fa fa-arrow-right"></span>' ],
256			responsive:{
257				0:{
258					items:1
259				},
260				600:{
261					items:1
262				},
263				1024:{
264					items:1
265				}
266			}
267		});    		
268	}
269
270	//Four Item Carousel
271	if ($('.four-items-carousel').length) {
272		$('.four-items-carousel').owlCarousel({
273			loop:false,
274			margin:0,
275			nav:false,
276			smartSpeed: 700,
277			autoplay: false,
278			navText: [ '<span class="fa fa-angle-left"></span>', '<span class="fa fa-angle-right"></span>' ],
279			responsive:{
280				0:{
281					items:1
282				},
283				600:{
284					items:2
285				},
286				768:{
287					items:2
288				},
289				1024:{
290					items:3
291				},
292				1280:{
293					items:4
294				}
295			}
296		});    		
297	}
298
299	//Make Content Sticky
300	if ($('.sticky-sidebar').length) {
301	    $('.sidebar-side').theiaStickySidebar({
302	      // Settings
303	      additionalMarginTop: 60
304	    });
305	}
306
307	// Custom Select Box
308	if ($('.sortby-select').length) {
309    	$('.sortby-select').select2();
310	}
311
312	// cooked single ingredient
313	if ($('.cooked-single-ingredient').length) {
314    	$('.cooked-single-ingredient .cooked-ingredient-checkbox').on('click', function() {
315			$(this).parent('.cooked-single-ingredient').toggleClass('checked');
316		});
317	}
318
319	// Open modal in AJAX callback
320	$('#call-btn').on('click', function(event) {
321	  event.preventDefault();
322	  this.blur();
323	  $.get(this.href, function(html) {
324	    $(html).appendTo('body').modal({
325			clickClose: false,
326			closeClass: 'cooked-close-fsm',
327			closeExisting: true,
328			fadeDuration: 300,
329			fadeDelay: 0.15
330	    });
331	  });
332	});
333
334	//Jquery Knob animation  // Pie Chart Animation
335	if($('.dial').length){
336		$('.dial').appear(function(){
337          var elm = $(this);
338          var color = elm.attr('data-fgColor');  
339          var perc = elm.attr('value');  
340 
341          elm.knob({ 
342               'value': 0, 
343                'min':0,
344                'max':100,
345                'skin':'tron',
346                'readOnly':true,
347                'thickness':0.06,
348				'dynamicDraw': true,
349				'displayInput':false
350          });
351
352          $({value: 0}).animate({ value: perc }, {
353			  duration: 2000,
354              easing: 'swing',
355              progress: function () { elm.val(Math.ceil(this.value)).trigger('change');
356              }
357          });
358
359          //circular progress bar color
360          $(this).append(function() {
361             // elm.parent().parent().find('.circular-bar-content').css('color',color);
362              //elm.parent().parent().find('.circular-bar-content .txt').text(perc);
363          });
364
365          },{accY: 20});
366    }
367
368	// background Video
369	if ($('.video-section').length) {
370		function ytb_bg() {
371			$(function(){
372			  $('[data-youtube]').youtube_background({});
373			});
374		}
375		ytb_bg();
376	}
377
378	//Default Masonary
379	function defaultMasonry() {
380		if($('.masonry-items-container').length){
381	
382			var winDow = $(window);
383			// Needed variables
384			var $container=$('.masonry-items-container');
385	
386			$container.isotope({
387				itemSelector: '.masonry-item',
388				 masonry: {
389					columnWidth : '.masonry-item'
390				 },
391				animationOptions:{
392					duration:500,
393					easing:'linear'
394				}
395			});
396	
397			winDow.on('resize', function(){
398
399				$container.isotope({ 
400					itemSelector: '.masonry-item',
401					animationOptions: {
402						duration: 500,
403						easing	: 'linear',
404						queue	: false
405					}
406				});
407			});
408		}
409	}
410
411	defaultMasonry();
412
413	//MixItup Gallery
414	if($('.filter-list').length){
415	 	 $('.filter-list').mixItUp();
416	 }
417
418	//Message Box
419	if($('.message-box').length){
420		$('.message-box .close-btn').on('click', function(e) {
421			$(this).parent('.message-box').fadeOut();
422		});
423	}
424
425	//Accordion Box
426	if($('.accordion-box').length){
427		$(".accordion-box").on('click', '.acc-btn', function() {
428			
429			var outerBox = $(this).parents('.accordion-box');
430			var target = $(this).parents('.accordion');
431			
432			if($(this).hasClass('active')!==true){
433				$(outerBox).find('.accordion .acc-btn').removeClass('active ');
434			}
435			
436			if ($(this).next('.acc-content').is(':visible')){
437				return false;
438			}else{
439				$(this).addClass('active');
440				$(outerBox).children('.accordion').removeClass('active-block');
441				$(outerBox).find('.accordion').children('.acc-content').slideUp(300);
442				target.addClass('active-block');
443				$(this).next('.acc-content').slideDown(300);	
444			}
445		});	
446	}
447
448	//Fact Counter + Text Count
449	if($('.count-box').length){
450		$('.count-box').appear(function(){
451	
452			var $t = $(this),
453				n = $t.find(".count-text").attr("data-stop"),
454				r = parseInt($t.find(".count-text").attr("data-speed"), 10);
455				
456			if (!$t.hasClass("counted")) {
457				$t.addClass("counted");
458				$({
459					countNum: $t.find(".count-text").text()
460				}).animate({
461					countNum: n
462				}, {
463					duration: r,
464					easing: "linear",
465					step: function() {
466						$t.find(".count-text").text(Math.floor(this.countNum));
467					},
468					complete: function() {
469						$t.find(".count-text").text(this.countNum);
470					}
471				});
472			}
473			
474		},{accY: 0});
475	}
476
477	//Progress Bar
478	if($('.progress-line').length){
479		$('.progress-line').appear(function(){
480			var el = $(this);
481			var percent = el.data('width');
482			$(el).css('width',percent+'%');
483		},{accY: 0});
484	}
485
486	//Tabs Box
487	if($('.tabs-box').length){
488		$('.tabs-box .tab-buttons .tab-btn').on('click', function(e) {
489			e.preventDefault();
490			var target = $($(this).attr('data-tab'));
491			
492			if ($(target).is(':visible')){
493				return false;
494			}else{
495				target.parents('.tabs-box').find('.tab-buttons').find('.tab-btn').removeClass('active-btn');
496				$(this).addClass('active-btn');
497				target.parents('.tabs-box').find('.tabs-content').find('.tab').fadeOut(0);
498				target.parents('.tabs-box').find('.tabs-content').find('.tab').removeClass('active-tab animated fadeIn');
499				$(target).fadeIn(300);
500				$(target).addClass('active-tab animated fadeIn');
501			}
502		});
503	}
504
505	//Price Range Slider
506	if($('.price-range-slider').length){
507		$( ".price-range-slider" ).slider({
508			range: true,
509			min: 0,
510			max: 90,
511			values: [ 0, 84 ],
512			slide: function( event, ui ) {
513			$( "input.property-amount" ).val( ui.values[ 0 ] + " - " + ui.values[ 1 ] );
514			}
515		});
516		
517		$( "input.property-amount" ).val( $( ".price-range-slider" ).slider( "values", 0 ) + " - $" + $( ".price-range-slider" ).slider( "values", 1 ) );	
518	}
519
520	//LightBox / Fancybox
521	if($('.lightbox-image').length) {
522		$('.lightbox-image').fancybox({
523			openEffect  : 'fade',
524			closeEffect : 'fade',
525			helpers : {
526				media : {}
527			}
528		});
529	}
530	
531	//Contact Form Validation
532	if($('#email-form').length){
533		$('#submit').click(function(){
534			
535            var o = new Object();
536            var form = '#email-form';
537			
538			var username = $('#email-form .username').val();
539			var email = $('#email-form .email').val();
540			
541			if(username == '' || email == '')
542			{
543				$('#email-form .response').html('<div class="failed">Please fill the required fields.</div>');
544				return false;
545			}
546            
547            $.ajax({
548                url:"sendemail.php",
549                method:"POST",
550                data: $(form).serialize(),
551                beforeSend:function(){
552                    $('#email-form .response').html('<div class="text-info"><img src="images/icons/preloader.gif"> Loading...</div>');
553                },
554                success:function(data){
555                    $('form').trigger("reset");
556                    $('#email-form .response').fadeIn().html(data);
557                    setTimeout(function(){
558                        $('#email-form .response').fadeOut("slow");
559                    }, 5000);
560                },
561                error:function(){
562                    $('#email-form .response').fadeIn().html(data);
563                }
564            });
565        });
566	}
567
568	//Subscribe Form
569	if($('#subscribe-form').length){
570		$('#subscribe-newslatters').click(function(){
571			
572            var o = new Object();
573            var form = '#subscribe-form';
574			var email = $('#subscribe-form .email').val();
575			
576			if(email == '')
577			{
578				$('#subscribe-form .response').html('<div class="failed">Please enter your Email Address.</div>');
579				return false;
580			}
581            
582            $.ajax({
583                url:"sendnewslatters.php",
584                method:"POST",
585                data: $(form).serialize(),
586                beforeSend:function(){
587                    $('#subscribe-form .response').html('<div class="text-info"><img src="images/icons/preloader.gif"> Loading...</div>');
588                },
589                success:function(data){
590                    $('form').trigger("reset");
591                    $('#subscribe-form .response').fadeIn().html(data);
592                    setTimeout(function(){
593                        $('#subscribe-form .response').fadeOut("slow");
594                    }, 5000);
595                },
596                error:function(){
597                    $('#subscribe-form .response').fadeIn().html(data);
598                }
599            });
600        });
601	}
602
603	// Scroll to a Specific Div
604	if($('.scroll-to-target').length){
605		$(".scroll-to-target").on('click', function() {
606			var target = $(this).attr('data-target');
607		   // animate
608		   $('html, body').animate({
609			   scrollTop: $(target).offset().top
610			 }, 1500);
611	
612		});
613	}
614	
615	// Elements Animation
616	if($('.wow').length){
617		var wow = new WOW(
618		  {
619			boxClass:     'wow',      // animated element css class (default is wow)
620			animateClass: 'animated', // animation css class (default is animated)
621			offset:       0,          // distance to the element when triggering the animation (default is 0)
622			mobile:       false,       // trigger animations on mobile devices (default is true)
623			live:         true       // act on asynchronously loaded content (default is true)
624		  }
625		);
626		wow.init();
627	}
628
629
630/* ==========================================================================
631   When document is Scrollig, do
632   ========================================================================== */
633	
634	$(window).on('scroll', function() {
635		headerStyle();
636	});
637	
638/* ==========================================================================
639   When document is loading, do
640   ========================================================================== */
641	
642	$(window).on('load', function() {
643		handlePreloader();
644		defaultMasonry();
645	});	
646
647})(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.