PageSourceSearch

http://www.nimibriggs.org/wp-content/themes/envas/assets/js/functions.js

js nimibriggs.org collected 2026-10-02 23:12:01 UTC 11,450 bytes, 474 lines download raw bytes

1jQuery(function($) {
2	'use strict';
3
4	$(window).on('load',function(){
5		if($('.loader').length){
6			$('.loader').fadeOut(800);
7		}
8
9	});
10
11
12
13	$('body').append('<a href="#" class="back-to"><i class="icon-arrow-up2"></i></a>');
14 
15  // Smooth Scroll
16	 var $root = $('html, body');
17	 $('.scrolling').on('click', function() {
18		  $root.animate({
19				scrollTop: $( $.attr(this, 'href') ).offset().top
20		  }, 700);
21		  return false;
22	 });
23
24	
25  //Back to Top
26	 var amountScrolled = 700;
27	 $(window).on('scroll', function(){
28		 if ( $(window).scrollTop() > amountScrolled ) {
29			 $('a.back-to').fadeIn('slow');
30		 } else {
31			 $('a.back-to').fadeOut('slow');
32		 }
33	 });
34	 $('a.back-to').on('click', function(){
35		 $('html, body').animate({
36			 scrollTop: 0
37		 }, 700);
38		 return false;
39	 });	
40	 
41	
42	//Header Scroll
43   $(window).on('scroll', function() {
44        if ($(window).scrollTop() > 50) {
45            $(".layout_first, .layout_sixth, #layout_bottom").addClass('stick');
46        } else {
47            $(".layout_first, .layout_sixth, #layout_bottom").removeClass('stick');
48        }
49    });
50
51	 
52
53	
54	// =========== Push Menus =============
55   
56     var $menuLeft = $('.pushmenu-left');
57	  var $menuRight = $('.pushmenu-right');
58	  var $toggleleft = $('#menu_bars.left');
59	  var $toggleright = $('#menu_bars.right');
60		$toggleleft.on('click', function() {
61			$(this).toggleClass('active');
62			$('.pushmenu-push').toggleClass('pushmenu-push-toright');
63			 $menuLeft.toggleClass('pushmenu-open');
64			 return false;
65		});
66		
67		$toggleright.on('click', function() {
68			$(this).toggleClass('active');
69			$('.pushmenu-push').toggleClass('pushmenu-push-toleft');
70			 $menuRight.toggleClass('pushmenu-open');
71			 return false;
72		});
73		
74		
75	 
76	 // =========== Accorduions ===========
77	 $(".accordion_title > a").on("click", function(){
78		if($(this).hasClass('active')){
79		  $(this).removeClass("active");
80		  $(this).siblings('.content').slideUp(200);
81		  $(".accordion_title > a i").removeClass("fa-minus").addClass("fa-plus");
82		}
83		else{
84		$(".accordion_title > a i").removeClass("fa-minus").addClass("fa-plus");
85		$(this).find("i").removeClass("fa-plus").addClass("fa-minus");
86		$(".accordion_title > a").removeClass("active");
87		$(this).addClass("active");
88		$('.content').slideUp(200);
89		$(this).siblings('.content').slideDown(200);
90		}
91	 
92	 });
93	 
94
95	 // =========== tabbed content ===========
96    $(".tab_content").hide();
97    $(".tab_content:first").show();
98
99  /* if in tab mode */
100    $("ul.tabs").on('click','li', function() {
101		  $(".tab_content").hide();
102		  var activeTab = $(this).attr("rel"); 
103		  $("#"+activeTab).fadeIn();		
104		  $("ul.tabs li").removeClass("active");
105		  $(this).addClass("active");
106		  $(".tab_drawer_heading").removeClass("d_active");
107		  $(".tab_drawer_heading[rel^='"+activeTab+"']").addClass("d_active");
108    });
109	 
110	/* if in drawer mode on Mobile Version*/
111	$(".tab_drawer_heading").on('click', function() {
112       $(".tab_content").hide();
113       var d_activeTab = $(this).attr("rel"); 
114       $("#"+d_activeTab).fadeIn(1200);
115	    $(".tab_drawer_heading").removeClass("d_active");
116       $(this).addClass("d_active");
117	    $("ul.tabs li").removeClass("active");
118	    $("ul.tabs li[rel^='"+d_activeTab+"']").addClass("active");
119    });
120		
121
122   // ============= Fun Facts ==================
123	if(typeof $.fn.countTo=='function'){
124		$(".number-counters").appear(function () {
125			$(".number-counters [data-to]").each(function () {
126				var e = $(this).attr("data-to");
127				$(this).delay(200).countTo({
128					from: 1,
129					to: e,
130					speed: 1500,
131					refreshInterval: 50
132				})
133			})
134		});
135	}
136
137
138
139	if(typeof $.fn.owlCarousel!=='undefined'){
140		// =============== Owl Carousel =================
141		//Single Slide
142		$("#service_slider").owlCarousel({
143			autoPlay : true,
144			pagination :true,
145			stopOnHover : true,
146			navigation : false,
147			singleItem:true
148		});
149		$('.bravo_plan_slider').each(function(){
150			var me=$(this);
151			var args={
152				pagination :true,
153				stopOnHover : true,
154				navigation : false,
155				singleItem:true
156			};
157
158			if(me.data('autoplay')){
159				args.autoPlay=me.data('autoplay');
160				//args.autoplayTimeout=me.data('autoplay');
161			}
162			me.owlCarousel(args);
163		})
164
165		//News & Thoughts
166		$("#news_slider").owlCarousel({
167			autoPlay:4000,
168			items :3,
169			pagination :true ,
170			stopOnHover : true,
171			navigation : false,
172			itemsDesktop : [1199,2],
173			itemsDesktopSmall : [979,2]
174		});
175
176		//People Saying
177		$("#people_slider").owlCarousel({
178			autoPlay:$("#people_slider").data('autoplay'),
179			navigation : false,
180			stopOnHover : true,
181			slideSpeed : 300,
182			items :2,
183			itemsDesktop : [1199,2],
184			itemsDesktopSmall : [979,2],
185			paginationSpeed : true,
186		});
187
188		// Our Partners
189		$(" #logo_slider").owlCarousel({
190			autoPlay:3000,
191			pagination :true ,
192			stopOnHover : true,
193			navigation : false,
194			slideSpeed : 300,
195			paginationSpeed : true,
196			items :5,
197			itemsCustom :[
198				[0, 1],
199				[450, 2],
200				[768, 3],
201				[980, 4],
202			],
203		});
204
205		//Team
206		$("#team_slider").owlCarousel({
207			autoPlay:false,
208			items :3,
209			pagination :false ,
210			stopOnHover : true,
211			navigation : true,
212			navigationText :["<i class='fa fa-long-arrow-left'></i>","<i class='fa fa-long-arrow-right'></i>"],
213			itemsDesktop : [1199,2],
214			itemsDesktopSmall : [979,2]
215		});
216	}
217
218
219  
220  
221   // =========== Parallax ===========
222	 $('.parallax').parallax("50%", 0.3);
223	 $('.parallax_one').parallax("50%", 0.3);
224	 $('.parallax_two').parallax("50%", 0.3);
225	 $('#bg-video').parallax("50%", -0.7);
226	 $('.parallax_news').parallax("50%", -0.5);
227	 $('.parallax_bg_slider').parallax("50%", -0.5);
228	 $('.page_header').parallax("50%", -0.5);
229	 
230	 $('.bravo-parallax').each(function(){
231		 var s=$(this).data('p-speed');
232		 if(s===undefined) s=0.3;
233		 $(this).parallax("50%", parseFloat(s));
234	 });
235	 
236	 
237
238  if(typeof $.fn.cubeportfolio !== 'undefined'){
239	  // init cubeportfolio for Grids
240	  $('#grid_layout').cubeportfolio({
241		  layoutMode: 'mosaic',
242		  gapHorizontal:30,
243		  gapVertical:30,
244		  gridAdjustment: 'responsive',
245		  caption: 'fadeIn',
246		  displayType: 'fadeIn',
247		  // lightbox
248		  lightboxDelegate: '.cbp-lightbox',
249		  lightboxGallery: true,
250		  lightboxTitleSrc: 'data-title',
251		  lightboxCounter: '<div class="cbp-popup-lightbox-counter">{{current}} of {{total}}</div>',
252	  });
253
254	  //Portfolio
255	  $('#layout-project').cubeportfolio({
256		  layoutMode: 'mosaic',
257		  defaultFilter: '*',
258		  gapHorizontal: 20,
259		  gapVertical: 20,
260		  gridAdjustment: 'responsive',
261		  mediaQueries: [{
262			  width: 1500,
263			  cols: 4
264		  }, {
265			  width: 1100,
266			  cols: 4
267		  }, {
268			  width: 800,
269			  cols: 2
270		  }, {
271			  width: 480,
272			  cols: 2
273		  }, {
274			  width: 320,
275			  cols: 1
276		  }],
277
278		  // lightbox
279		  lightboxDelegate: '.cbp-lightbox',
280		  lightboxGallery: true,
281	  });
282
283
284	  // init cubeportfolio (Testinomial Page)
285	  $('#js-grid-masonry').cubeportfolio({
286		  layoutMode: 'grid',
287		  gapHorizontal: 50,
288		  gapVertical: 20,
289		  gridAdjustment: 'responsive',
290		  mediaQueries: [{
291			  width: 1500,
292			  cols: 3
293		  }, {
294			  width: 1100,
295			  cols: 3
296		  }, {
297			  width: 800,
298			  cols: 3
299		  }, {
300			  width: 480,
301			  cols: 2
302		  }, {
303			  width: 320,
304			  cols: 1
305		  }],
306
307	  });
308
309	  //Project Filter
310	  $('#projects').cubeportfolio({
311		  filters: '#project-filter',
312		  layoutMode: 'grid',
313		  defaultFilter: '*',
314		  animationType: 'slideDelay',
315		  gapHorizontal: 45,
316		  gapVertical: 30,
317		  gridAdjustment: 'responsive',
318		  // lightbox
319		  lightboxDelegate: '.cbp-lightbox',
320		  lightboxGallery: true,
321	  });
322	  var on_ajax=false;
323	  $('.bravo-load-more').click(function(){
324		  var me=$(this);
325		  if(on_ajax) return;
326
327		  me.append(' <i class="fa fa-spinner fa-pulse fa-fw"></i>');
328		  on_ajax=true;
329		  $.ajax({
330			  url:bravo_params.ajax_url,
331			  data:{
332				  action:'bravo_load_projects',
333				  term:$(this).data('term'),
334				  paged:$(this).data('paged')
335			  },
336			  type:'post',
337			  success:function(res){
338				  on_ajax=false;
339				  if(!res.next_page){
340					  me.remove();
341				  }else{
342					  me.data('paged',res.next_page);
343				  }
344				  if(res.html){
345					  $('#projects').cubeportfolio('appendItems',res.html);
346				  }
347				  me.find('.fa').remove();
348			  },
349			  error:function(e){
350				  on_ajax=false;
351				  me.find('.fa').remove();
352			  }
353		  });
354
355		  return false;
356	  });
357  }
358
359	 
360	 
361
362
363  
364  $('.bravo-sidebar ul').addClass('category');
365
366	// Custom
367	if(typeof $.fn.html5lightbox=='function')
368	jQuery(".custom_html5lightbox").html5lightbox({
369		skinsfoldername:bravo_params.skinsfolder
370	})
371
372
373	// Count Down
374	function getTimeRemaining(endtime) {
375		var t = Date.parse(endtime) - Date.parse(new Date());
376		var seconds = Math.floor((t / 1000) % 60);
377		var minutes = Math.floor((t / 1000 / 60) % 60);
378		var hours = Math.floor((t / (1000 * 60 * 60)) % 24);
379		var days = Math.floor(t / (1000 * 60 * 60 * 24));
380		return {
381			'total': t,
382			'days': days,
383			'hours': hours,
384			'minutes': minutes,
385			'seconds': seconds
386		};
387	}
388
389	function initializeClock(id, endtime) {
390		var clock = document.getElementById(id);
391		var daysSpan = clock.querySelector('.days');
392		var hoursSpan = clock.querySelector('.hours');
393		var minutesSpan = clock.querySelector('.minutes');
394		var secondsSpan = clock.querySelector('.seconds');
395
396		function updateClock() {
397			var t = getTimeRemaining(endtime);
398
399			daysSpan.innerHTML = t.days;
400			hoursSpan.innerHTML = ('0' + t.hours).slice(-2);
401			minutesSpan.innerHTML = ('0' + t.minutes).slice(-2);
402			secondsSpan.innerHTML = ('0' + t.seconds).slice(-2);
403
404			if (t.total <= 0) {
405				clearInterval(timeinterval);
406			}
407		}
408
409		updateClock();
410		var timeinterval = setInterval(updateClock, 1000);
411	}
412
413
414
415	if($('#clockdiv').length){
416		var deadline = new Date($('#clockdiv').data('date'));
417		console.log($('#clockdiv').data('date'));
418		console.log(deadline);
419		initializeClock('clockdiv', deadline);
420	}
421
422
423	$('.bravo_map_wrap').each(function(){
424		var map_div=$(this).find('.bravo_google_map');
425		var lt = map_div.data('lat');
426		var ld = map_div.data('lng');
427		var address=map_div.data('address');
428		var options = {
429			center: new google.maps.LatLng(lt, ld),
430			zoom: map_div.data('zoom'),
431			scrollwheel: false,
432			panControl: false,
433			zoomControl: true,
434			scaleControl: true,
435			mapTypeControl: false,
436			streetViewControl: false,
437		};
438		var div = map_div[0];
439		var map = new google.maps.Map(div, options);
440
441		var image = map_div.data('marker');
442
443		if(address){
444			var geocoder = new google.maps.Geocoder();
445
446			geocoder.geocode({
447					'address': address
448				},
449				function(results, status) {
450					if(status == google.maps.GeocoderStatus.OK) {
451
452						var marker = new google.maps.Marker({
453							position: results[0].geometry.location,
454							map: map,
455							icon: image
456						});
457						map.setCenter(results[0].geometry.location);
458					}
459				});
460		}else{
461			if(lt && ld){
462				var marker = new google.maps.Marker({
463					position: new google.maps.LatLng(lt, ld),
464					map: map,
465					icon: image
466				});
467			}
468		}
469
470	})
471}); 
472
473
474

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.