PageSourceSearch

https://urbanbeers.org/js/main.js

js urbanbeers.org collected 2026-10-02 02:05:08 UTC 5,346 bytes, 239 lines download raw bytes

1;(function () {
2	
3	'use strict';
4
5
6
7	var isMobile = {
8		Android: function() {
9			return navigator.userAgent.match(/Android/i);
10		},
11			BlackBerry: function() {
12			return navigator.userAgent.match(/BlackBerry/i);
13		},
14			iOS: function() {
15			return navigator.userAgent.match(/iPhone|iPad|iPod/i);
16		},
17			Opera: function() {
18			return navigator.userAgent.match(/Opera Mini/i);
19		},
20			Windows: function() {
21			return navigator.userAgent.match(/IEMobile/i);
22		},
23			any: function() {
24			return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows());
25		}
26	};
27
28	var fullHeight = function() {
29
30		if ( !isMobile.any() ) {
31			$('.js-fullheight').css('height', $(window).height());
32			$(window).resize(function(){
33				$('.js-fullheight').css('height', $(window).height());
34			});
35		}
36
37	};
38
39
40	var counter = function() {
41		$('.js-counter').countTo({
42			 formatter: function (value, options) {
43	      return value.toFixed(options.decimals);
44	    },
45		});
46	};
47
48
49	var counterWayPoint = function() {
50		if ($('#colorlib-counter').length > 0 ) {
51			$('#colorlib-counter').waypoint( function( direction ) {
52										
53				if( direction === 'down' && !$(this.element).hasClass('animated') ) {
54					setTimeout( counter , 400);					
55					$(this.element).addClass('animated');
56				}
57			} , { offset: '90%' } );
58		}
59	};
60
61	// Animations
62	var contentWayPoint = function() {
63		var i = 0;
64		$('.animate-box').waypoint( function( direction ) {
65
66			if( direction === 'down' && !$(this.element).hasClass('animated') ) {
67				
68				i++;
69
70				$(this.element).addClass('item-animate');
71				setTimeout(function(){
72
73					$('body .animate-box.item-animate').each(function(k){
74						var el = $(this);
75						setTimeout( function () {
76							var effect = el.data('animate-effect');
77							if ( effect === 'fadeIn') {
78								el.addClass('fadeIn animated');
79							} else if ( effect === 'fadeInLeft') {
80								el.addClass('fadeInLeft animated');
81							} else if ( effect === 'fadeInRight') {
82								el.addClass('fadeInRight animated');
83							} else {
84								el.addClass('fadeInUp animated');
85							}
86
87							el.removeClass('item-animate');
88						},  k * 200, 'easeInOutExpo' );
89					});
90					
91				}, 100);
92				
93			}
94
95		} , { offset: '85%' } );
96	};
97
98
99	var burgerMenu = function() {
100
101		$('.js-colorlib-nav-toggle').on('click', function(event){
102			event.preventDefault();
103			var $this = $(this);
104
105			if ($('body').hasClass('offcanvas')) {
106				$this.removeClass('active');
107				$('body').removeClass('offcanvas');	
108			} else {
109				$this.addClass('active');
110				$('body').addClass('offcanvas');	
111			}
112		});
113
114
115
116	};
117
118	// Click outside of offcanvass
119	var mobileMenuOutsideClick = function() {
120
121		$(document).click(function (e) {
122	    var container = $("#colorlib-aside, .js-colorlib-nav-toggle");
123	    if (!container.is(e.target) && container.has(e.target).length === 0) {
124
125	    	if ( $('body').hasClass('offcanvas') ) {
126
127    			$('body').removeClass('offcanvas');
128    			$('.js-colorlib-nav-toggle').removeClass('active');
129			
130	    	}
131	    	
132	    }
133		});
134
135		$(window).scroll(function(){
136			if ( $('body').hasClass('offcanvas') ) {
137
138    			$('body').removeClass('offcanvas');
139    			$('.js-colorlib-nav-toggle').removeClass('active');
140			
141	    	}
142		});
143
144	};
145
146	var sliderMain = function() {
147		
148	  	$('#colorlib-hero .flexslider').flexslider({
149			animation: "fade",
150			slideshowSpeed: 5000,
151			directionNav: true,
152			start: function(){
153				setTimeout(function(){
154					$('.slider-text').removeClass('animated fadeInUp');
155					$('.flex-active-slide').find('.slider-text').addClass('animated fadeInUp');
156				}, 500);
157			},
158			before: function(){
159				setTimeout(function(){
160					$('.slider-text').removeClass('animated fadeInUp');
161					$('.flex-active-slide').find('.slider-text').addClass('animated fadeInUp');
162				}, 500);
163			}
164
165	  	});
166
167	};
168
169	var stickyFunction = function() {
170
171		var h = $('.image-content').outerHeight();
172
173		if ($(window).width() <= 992 ) {
174			$("#sticky_item").trigger("sticky_kit:detach");
175		} else {
176			$('.sticky-parent').removeClass('stick-detach');
177			$("#sticky_item").trigger("sticky_kit:detach");
178			$("#sticky_item").trigger("sticky_kit:unstick");
179		}
180
181		$(window).resize(function(){
182			var h = $('.image-content').outerHeight();
183			$('.sticky-parent').css('height', h);
184
185
186			if ($(window).width() <= 992 ) {
187				$("#sticky_item").trigger("sticky_kit:detach");
188			} else {
189				$('.sticky-parent').removeClass('stick-detach');
190				$("#sticky_item").trigger("sticky_kit:detach");
191				$("#sticky_item").trigger("sticky_kit:unstick");
192
193				$("#sticky_item").stick_in_parent();
194			}
195			
196
197			
198
199		});
200
201		$('.sticky-parent').css('height', h);
202
203		$("#sticky_item").stick_in_parent();
204
205	};
206
207	var owlCrouselFeatureSlide = function() {
208		$('.owl-carousel').owlCarousel({
209			animateOut: 'fadeOut',
210		   animateIn: 'fadeIn',
211		   autoplay: true,
212		   loop:true,
213		   margin:0,
214		   nav:true,
215		   dots: false,
216		   autoHeight: true,
217		   items: 1,
218		   navText: [
219		      "<i class='icon-arrow-left3 owl-direction'></i>",
220		      "<i class='icon-arrow-right3 owl-direction'></i>"
221	     	]
222		})
223	};
224
225	// Document on load.
226	$(function(){
227		fullHeight();
228		counter();
229		counterWayPoint();
230		contentWayPoint();
231		burgerMenu();
232		mobileMenuOutsideClick();
233		sliderMain();
234		stickyFunction();
235		owlCrouselFeatureSlide();
236	});
237
238
239}());

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.