PageSourceSearch

https://icare-haldia.org/public/website/assets/js/main.js

js icare-haldia.org collected 2026-10-03 01:59:55 UTC 11,025 bytes, 390 lines download raw bytes

1(function ($) {
2	"use strict";
3
4    jQuery(document).ready(function($){
5
6    	// Slicknav
7		$('#main-menu').slicknav({
8	        closeOnClick: true,
9	        label: '',
10	        appendTo:'.mobile-menu',
11	    });
12
13
14	    $(window).scroll(function(){
15
16	    	// Sticky Nav
17		    if ($(this).scrollTop() > 50) {
18		       $('.sticky').addClass('active');
19		    } else {
20		       $('.sticky').removeClass('active');
21		    }
22
23		    // Scroll To Top Hide/Show
24		    if ($(this).scrollTop() >= 1000) {        
25		        $('#scroll-to-top').fadeIn(200);
26		    } else {
27		        $('#scroll-to-top').fadeOut(200);
28		    }
29
30		});
31
32
33		// Scroll To Top Trigger
34		$('#scroll-to-top').click(function() {      
35		    $('body,html').animate({
36		        scrollTop : 0
37		    }, 500);
38		});
39
40
41		// Hero Slider
42		$('.hero-slider').owlCarousel({
43			loop: false,
44			rewind: true,
45			dots: false,
46			nav: true,
47			autoplay: true,
48			navText: ["<img src='public/website/assets/img/icons/arrow-prev.png'>","<img src='public/website/assets/img/icons/arrow-next.png'>"],
49			responsiveClass: true,
50			items: 1,
51			onInitialized  : counter, //When the plugin has initialized.
52			onTranslated : counter //When the translation of the stage has finished.
53		});
54		// Hero Slider Counter
55		function counter(event) {
56			var element   = event.target;         // DOM element, in this example .owl-carousel
57			var items     = event.item.count;     // Number of items
58			var item      = event.item.index + 1;     // Position of the current item
59
60			// it loop is true then reset counter from 1
61			if(item > items) {
62				item = item - items
63			}
64
65			// Add 0 before one digit Counter
66			function pad(number) {
67			    return (number < 10 ? '0' : '') + number
68			}
69
70			$('.hero-counter').html(pad(item)+" <span>/ "+pad(items)+"</span>");
71		}
72		// Hero Slider Animation
73		$(".hero-slider").on("translated.owl.carousel", function() {
74			$(".hero-slider .hero-slider-item .hero-counter").addClass("animated slideInUp").css("opacity", "1");
75			$(".hero-slider .hero-slider-item h1").addClass("animated fadeInLeft").css("opacity", "1");
76			$(".hero-slider .hero-slider-item p").addClass("animated fadeInRight").css("opacity", "1");
77			$(".hero-slider .hero-slider-item .btn").addClass("animated slideInDown").css("opacity", "1");
78		});
79		$(".hero-slider").on("translate.owl.carousel", function() {
80			$(".hero-slider .hero-slider-item .hero-counter").removeClass("animated slideInUp").css("opacity", "0");
81			$(".hero-slider .hero-slider-item h1").removeClass("animated fadeInLeft").css("opacity", "0");
82			$(".hero-slider .hero-slider-item p").removeClass("animated fadeInRight").css("opacity", "0");
83			$(".hero-slider .hero-slider-item .btn").removeClass("animated slideInDown").css("opacity", "0");
84		});
85
86
87		// Hero Slider Two
88		$('.hero-slider-two').owlCarousel({
89			loop: true,
90			dots: false,
91			nav: true,
92			navText: ["<img src='public/website/assets/img/icons/arrow-prev-short.png'>","<img src='public/website/assets/img/icons/arrow-next-short.png'>"],
93			responsiveClass: true,
94			items: 1,
95		});
96		// Hero Slider Two Animation
97		$(".hero-slider-two").on("translated.owl.carousel", function() {
98			$(".hero-slider-two .hero-slider-item h1").addClass("animated flipInX").css("opacity", "1");
99			$(".hero-slider-two .hero-slider-item p").addClass("animated fadeInUp").css("opacity", "1");
100			$(".hero-slider-two .hero-slider-item .btn").addClass("animated fadeInUp").css("opacity", "1");
101		});
102		$(".hero-slider-two").on("translate.owl.carousel", function() {
103			$(".hero-slider-two .hero-slider-item h1").removeClass("animated flipInX").css("opacity", "0");
104			$(".hero-slider-two .hero-slider-item p").removeClass("animated fadeInUp").css("opacity", "0");
105			$(".hero-slider-two .hero-slider-item .btn").removeClass("animated fadeInUp").css("opacity", "0");
106		});
107
108
109		// Hero Slider Three
110		$('.hero-slider-three').owlCarousel({
111			loop: true,
112			dots: true,
113			nav: false,
114			responsiveClass: true,
115			items: 1,
116		});
117		// Hero Slider Three Animation
118		$(".hero-slider-three").on("translated.owl.carousel", function() {
119			$(".hero-slider-three .hero-slider-item h1").addClass("animated fadeInDown").css("opacity", "1");
120			$(".hero-slider-three .hero-slider-item p").addClass("animated fadeInUp").css("opacity", "1");
121			$(".hero-slider-three .hero-slider-item .btn").addClass("animated fadeInUp").css("opacity", "1");
122		});
123		$(".hero-slider-three").on("translate.owl.carousel", function() {
124			$(".hero-slider-three .hero-slider-item h1").removeClass("animated fadeInDown").css("opacity", "0");
125			$(".hero-slider-three .hero-slider-item p").removeClass("animated fadeInUp").css("opacity", "0");
126			$(".hero-slider-three .hero-slider-item .btn").removeClass("animated fadeInUp").css("opacity", "0");
127		});
128
129
130		// About Three Slider Three
131		$('.about-three-slider').owlCarousel({
132			loop: true,
133			dots: true,
134			nav: false,
135			responsiveClass: true,
136			items: 1,
137		});
138
139
140		// Stop Modal Video on Close
141		$('.modal').on('hide.bs.modal', function(e) {    
142		    var $if = $(e.delegateTarget).find('iframe');
143		    var src = $if.attr("src");
144		    $if.attr("src", 'https://themejunction.net/empty.html');
145		    $if.attr("src", src);
146		});
147
148
149		// PGW Slider
150		$('.pgwSlider').pgwSlider();
151
152		lightbox.option({
153	      'resizeDuration': 500,
154	      'wrapAround': true,
155	      'alwaysShowNavOnTouchDevices': true,
156	    });
157
158
159	    // Testimonial Slider
160	    $('.testimonial-carousel').owlCarousel({
161		    loop: true,
162		    margin: 30,
163		    responsiveClass: true,
164		    responsive: {
165		        0: {
166		            items: 1
167		        },
168		        600: {
169		            items: 2
170		        },
171		        1000: {
172		            items: 2
173		        }
174		    }
175		});
176
177
178	    // Testimonial Slider Two
179	    $('.testimonial-carousel-two').owlCarousel({
180		    loop: true,
181		    margin: 30,
182		    responsiveClass: true,
183		    items: 1,
184		});
185
186
187	    // Testimonial Slider Three
188	    $('.testimonial-carousel-three').owlCarousel({
189		    loop: true,
190		    responsiveClass: true,
191		    items: 1,
192		    dots: false,
193			nav: true,
194			navText: ["<img src='https://icare-haldia.org/public/website/assets/img/icons/arrow-prev-short.png'>","<img src='https://icare-haldia.org/public/website/assets/img/icons/arrow-next-short.png'>"],
195		});
196
197
198		// Single Portfolio Slider
199		$('.single-portfolio-slider').owlCarousel({
200			loop: true,
201			dots: false,
202			nav: true,
203			navText: ["<img src='https://icare-haldia.org/public/website/assets/img/icons/arrow-prev-short.png'>","<img src='https://icare-haldia.org/public/website/assets/img/icons/arrow-next-short.png'>"],
204			responsiveClass: true,
205			items: 1,
206		});
207
208
209		// Header Search Form
210		$("#search-modal-btn").on("click", function(e) {
211			e.preventDefault();
212			$(".search-modal-wrpr").addClass("active");
213		});
214
215		$('.search-modal-wrpr .close-icon').on('click', function() {
216		  	$(".search-modal-wrpr").removeClass("active");
217		});
218
219
220		// Sliding Sidebar
221		$("#sliding-sidebar-btn").on("click", function(e) {
222			 e.preventDefault();
223			$(".sliding-sidebar, .body-overlay").addClass("active");
224		});
225		$(".sliding-sidebar .close-icon").on("click", function() {
226			$(".sliding-sidebar, .body-overlay").removeClass("active");
227		});
228		$(document).mouseup(function(e) 
229		{
230		    var container = $(".sliding-sidebar");
231
232		    // if the target of the click isn't the container nor a descendant of the container
233		    if (!container.is(e.target) && container.has(e.target).length === 0) 
234		    {
235		        $(".sliding-sidebar, .body-overlay").removeClass("active");
236		    }
237		});
238
239
240		// Smooth Scroll to Section
241		$('.smooth-scroll').click(function(event) {
242		    if (
243		      location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') 
244		      && 
245		      location.hostname == this.hostname
246		    ) {
247		      var target = $(this.hash);
248		      target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
249		      if (target.length) {
250		        event.preventDefault();
251		        $('html, body').animate({
252		          scrollTop: target.offset().top
253		        }, 1000, function() {
254		          var $target = $(target);
255		          $target.focus();
256		          if ($target.is(":focus")) { 
257		            return false;
258		          } else {
259		            $target.attr('tabindex','-1');
260		            $target.focus(); 
261		          };
262		        });
263		      }
264		    }
265		});
266		
267
268		// Active WOW JS
269		new WOW().init();
270
271
272		// Hero Section One Background Parallax
273		$("#hero-section-one-bg-parallax").paroller({ 
274			factor: 0.5, 
275			factorXs: 0.2, 
276			type: 'background', 
277			direction: 'vertical' 
278		});
279
280
281		// Hero Section Two Background Parallax
282		$("#hero-section-two-bg-parallax").paroller({ 
283			factor: 0.5, 
284			factorXs: 0.2, 
285			type: 'background', 
286			direction: 'vertical' 
287		});
288
289
290		// Hero Section Three Background Parallax
291		$("#hero-section-three-bg-parallax").paroller({ 
292			factor: 0.5, 
293			factorXs: 0.2, 
294			type: 'background', 
295			direction: 'vertical' 
296		});
297
298
299		// Active Count Down JS
300		$('#countdown').countdown({
301            year: 2024, // YYYY Format
302            month: 1, // 1-12
303            day: 1, // 1-31
304            hour: 0, // 24 hour format 0-23
305            minute: 0, // 0-59
306            second: 0, // 0-59
307        });
308
309
310        // Contact Form
311       	$('form[id="contact_form"]').validate({
312			rules: {
313				name: 'required',
314				email: {
315					required: true,
316					email: true,
317				},
318				subject: 'required',
319				message: 'required',
320			},
321
322			messages: {
323				name: 'Enter your full name.',
324				email: 'Enter a valid email.',
325				subject: 'Enter your subject.',
326				message: 'Write your message.',
327			},
328			submitHandler: function(form) {
329				// start ajax request 
330				$.ajax({
331					type: "POST",
332					url: "mail.php",
333					data: $('#contact_form').serialize(),
334					cache: false,
335					success: function (data) {
336						if(data == 'Y'){
337							$("#message_sent").modal('show');
338							$('#contact_form').trigger("reset");
339						}
340						else{
341							$("#message_fail").modal('show');
342						}
343					}
344				});
345				
346			}
347		});	
348
349    });
350
351
352    jQuery(window).load(function(){
353
354    	// Loading Spinner
355    	$('.spinner-wrpr').fadeOut();
356
357    	// Isotope Portfolio Item 
358		$('.portfolio-item-list').isotope({
359		  // options
360		  itemSelector: '.portfolio-item',
361		  percentPosition: true,
362		  masonry: {
363		    columnWidth: '.portfolio-item-sizer',
364		    horizontalOrder: true
365		  }
366		});
367		$('.portfolio-item-list').isotope();
368
369
370		// Isotope Portfolio Filter Button 
371		$('.portfolio-item-controls').on( 'click', 'button', function() {
372		  var filterValue = $(this).attr('data-filter');
373		  $('.portfolio-item-list').isotope({ filter: filterValue });
374		});
375
376
377		// Isotope Portfolio Filter Button Active Class 
378		$('.portfolio-item-controls').each( function( i, buttonGroup ) {
379		  var $buttonGroup = $( buttonGroup );
380		  $buttonGroup.on( 'click', 'button', function() {
381		    $buttonGroup.find('.active').removeClass('active');
382		    $( this ).addClass('active');
383		  });
384		});
385		
386        
387    });
388
389
390}(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.