PageSourceSearch

https://meteoexploration.com/static/assets/js/gaia.js

js meteoexploration.com collected 2026-09-24 23:06:37 UTC 11,550 bytes, 309 lines download raw bytes

1/*!
2
3 =========================================================
4 * Gaia Bootstrap Template PRO - v1.0.1
5 =========================================================
6
7 * Product Page: https://www.creative-tim.com/product/gaia-bootstrap-template-pro
8 * Copyright 2019 Creative Tim (https://www.creative-tim.com)
9
10 * Coded by Creative Tim
11
12 =========================================================
13
14 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
15
16 */
17
18var transparent = true;
19
20var fixedTop = false;
21
22var navbar_initialized = false;
23
24var scroll;
25
26scroll = ( 2500 - $(window).width() ) / $(window).width();
27
28var window_height;
29var window_width;
30
31var content_opacity = 0;
32var content_transition = 0;
33var no_touch_screen = false;
34
35var burger_menu;
36
37var scroll_distance = 500;
38
39$(document).ready(function(){
40    BrowserDetect.init();
41
42    if(BrowserDetect.browser == 'Explorer' && BrowserDetect.version <= 9){
43        $('body').html(better_browser);
44    }
45
46    window_width = $(window).width();
47    window_height = $(window).height();
48
49    burger_menu = $('.navbar').hasClass('navbar-burger') ? true : false;
50
51    if (!Modernizr.touch){
52        $('body').addClass('no-touch');
53        no_touch_screen = true;
54    }
55
56    // Init navigation toggle for small screens
57    if(window_width < 992 || burger_menu){
58        gaia.initRightMenu();
59    }
60
61    if($('.content-with-opacity').length != 0){
62        content_opacity = 1;
63    }
64
65    $navbar = $('.navbar[color-on-scroll]');
66    scroll_distance = $navbar.attr('color-on-scroll') || 500;
67
68    $('.google-map').each(function(){
69        var lng = $(this).data('lng');
70        var lat = $(this).data('lat');
71
72        gaia.initGoogleMaps(this, lat, lng);
73    });
74
75});
76
77//activate collapse right menu when the windows is resized
78$(window).resize(function(){
79    if($(window).width() < 992){
80        gaia.initRightMenu();
81        //gaia.checkResponsiveImage();
82    }
83    if($(window).width() > 992 && !burger_menu){
84        $('nav[role="navigation"]').removeClass('navbar-burger');
85        gaia.misc.navbar_menu_visible = 1;
86        navbar_initialized = false;
87    }
88});
89
90$(window).on('scroll',function(){
91
92    gaia.checkScrollForTransparentNavbar();
93
94
95    if(window_width > 992){
96        gaia.checkScrollForParallax();
97    }
98
99    if(content_opacity == 1 ){
100        gaia.checkScrollForContentTransitions();
101    }
102
103});
104
105$('a[data-scroll="true"]').click(function(e){
106    var scroll_target = $(this).data('id');
107    var scroll_trigger = $(this).data('scroll');
108
109    if(scroll_trigger == true && scroll_target !== undefined){
110        e.preventDefault();
111
112        $('html, body').animate({
113             scrollTop: $(scroll_target).offset().top - 50
114        }, 1000);
115    }
116
117});
118
119gaia = {
120    misc:{
121        navbar_menu_visible: 0
122    },
123    initRightMenu: function(){
124
125         if(!navbar_initialized){
126            $toggle = $('.navbar-toggle');
127            $toggle.click(function (){
128
129                if(gaia.misc.navbar_menu_visible == 1) {
130                    $('html').removeClass('nav-open');
131                    gaia.misc.navbar_menu_visible = 0;
132                    $('#bodyClick').remove();
133                     setTimeout(function(){
134                        $toggle.removeClass('toggled');
135                     }, 550);
136
137                } else {
138                    setTimeout(function(){
139                        $toggle.addClass('toggled');
140                    }, 580);
141
142                    div = '<div id="bodyClick"></div>';
143                    $(div).appendTo("body").click(function() {
144                        $('html').removeClass('nav-open');
145                        gaia.misc.navbar_menu_visible = 0;
146                        $('#bodyClick').remove();
147                         setTimeout(function(){
148                            $toggle.removeClass('toggled');
149                         }, 550);
150                    });
151
152                    $('html').addClass('nav-open');
153                    gaia.misc.navbar_menu_visible = 1;
154
155                }
156            });
157            navbar_initialized = true;
158        }
159
160    },
161
162    checkScrollForTransparentNavbar: debounce(function() {
163            if($(document).scrollTop() > scroll_distance ) {
164                if(transparent) {
165                    transparent = false;
166                    $navbar.removeClass('navbar-transparent');
167                }
168            } else {
169                if( !transparent ) {
170                    transparent = true;
171                    $navbar.addClass('navbar-transparent');
172                }
173            }
174    }, 17),
175
176    checkScrollForParallax: debounce(function() {
177        	$('.parallax').each(function() {
178        	    var $elem = $(this);
179
180        	    if(isElementInViewport($elem)){
181                  var parent_top = $elem.offset().top;
182                  var window_bottom = $(window).scrollTop();
183                  var $image = $elem.children('.image');
184
185            	  oVal = ((window_bottom - parent_top) / 3);
186                  $image.css('transform','translate3d(0px, ' + oVal + 'px, 0px)');
187        	    }
188            });
189
190    }, 6),
191
192    checkScrollForContentTransitions: debounce(function() {
193         $('.content-with-opacity').each(function() {
194             var $content = $(this);
195
196             if(isElementInViewport($content)){
197                  var window_top = $(window).scrollTop();
198            	  opacityVal = 1 - (window_top / 230);
199
200                  if(opacityVal < 0){
201                      opacityVal = 0;
202                      return;
203                  } else {
204                    $content.css('opacity',opacityVal);
205                  }
206
207        	    }
208         });
209    }, 6),
210
211    initGoogleMaps: function($elem, lat, lng){
212        var myLatlng = new google.maps.LatLng(lat, lng);
213
214        var mapOptions = {
215          zoom: 13,
216          center: myLatlng,
217          scrollwheel: false, //we disable de scroll over the map, it is a really annoing when you scroll through page
218          disableDefaultUI: true,
219          styles: [{"featureType":"administrative","elementType":"labels","stylers":[{"visibility":"on"},{"gamma":"1.82"}]},{"featureType":"administrative","elementType":"labels.text.fill","stylers":[{"visibility":"on"},{"gamma":"1.96"},{"lightness":"-9"}]},{"featureType":"administrative","elementType":"labels.text.stroke","stylers":[{"visibility":"off"}]},{"featureType":"landscape","elementType":"all","stylers":[{"visibility":"on"},{"lightness":"25"},{"gamma":"1.00"},{"saturation":"-100"}]},{"featureType":"poi.business","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"poi.park","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"road","elementType":"geometry.stroke","stylers":[{"visibility":"off"}]},{"featureType":"road","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"road.highway","elementType":"geometry","stylers":[{"hue":"#ffaa00"},{"saturation":"-43"},{"visibility":"on"}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"visibility":"off"}]},{"featureType":"road.highway","elementType":"labels","stylers":[{"visibility":"simplified"},{"hue":"#ffaa00"},{"saturation":"-70"}]},{"featureType":"road.highway.controlled_access","elementType":"labels","stylers":[{"visibility":"on"}]},{"featureType":"road.arterial","elementType":"all","stylers":[{"visibility":"on"},{"saturation":"-100"},{"lightness":"30"}]},{"featureType":"road.local","elementType":"all","stylers":[{"saturation":"-100"},{"lightness":"40"},{"visibility":"off"}]},{"featureType":"transit.station.airport","elementType":"geometry.fill","stylers":[{"visibility":"on"},{"gamma":"0.80"}]},{"featureType":"water","elementType":"all","stylers":[{"visibility":"off"}]}]
220        }
221        var map = new google.maps.Map($elem, mapOptions);
222
223        var marker = new google.maps.Marker({
224            position: myLatlng,
225            title:"Hello World!"
226        });
227
228        // To add the marker to the map, call setMap();
229        marker.setMap(map);
230    }
231
232}
233
234// Returns a function, that, as long as it continues to be invoked, will not
235// be triggered. The function will be called after it stops being called for
236// N milliseconds. If `immediate` is passed, trigger the function on the
237// leading edge, instead of the trailing.
238
239function debounce(func, wait, immediate) {
240	var timeout;
241	return function() {
242		var context = this, args = arguments;
243		clearTimeout(timeout);
244		timeout = setTimeout(function() {
245			timeout = null;
246			if (!immediate) func.apply(context, args);
247		}, wait);
248		if (immediate && !timeout) func.apply(context, args);
249	};
250};
251
252
253function isElementInViewport(elem) {
254    var $elem = $(elem);
255
256    // Get the scroll position of the page.
257    var scrollElem = ((navigator.userAgent.toLowerCase().indexOf('webkit') != -1) ? 'body' : 'html');
258    var viewportTop = $(scrollElem).scrollTop();
259    var viewportBottom = viewportTop + $(window).height();
260
261    // Get the position of the element on the page.
262    var elemTop = Math.round( $elem.offset().top );
263    var elemBottom = elemTop + $elem.height();
264
265    return ((elemTop < viewportBottom) && (elemBottom > viewportTop));
266}
267
268
269var BrowserDetect = {
270    init: function () {
271        this.browser = this.searchString(this.dataBrowser) || "Other";
272        this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "Unknown";
273    },
274    searchString: function (data) {
275        for (var i = 0; i < data.length; i++) {
276            var dataString = data[i].string;
277            this.versionSearchString = data[i].subString;
278
279            if (dataString.indexOf(data[i].subString) !== -1) {
280                return data[i].identity;
281            }
282        }
283    },
284    searchVersion: function (dataString) {
285        var index = dataString.indexOf(this.versionSearchString);
286        if (index === -1) {
287            return;
288        }
289
290        var rv = dataString.indexOf("rv:");
291        if (this.versionSearchString === "Trident" && rv !== -1) {
292            return parseFloat(dataString.substring(rv + 3));
293        } else {
294            return parseFloat(dataString.substring(index + this.versionSearchString.length + 1));
295        }
296    },
297
298    dataBrowser: [
299        {string: navigator.userAgent, subString: "Chrome", identity: "Chrome"},
300        {string: navigator.userAgent, subString: "MSIE", identity: "Explorer"},
301        {string: navigator.userAgent, subString: "Trident", identity: "Explorer"},
302        {string: navigator.userAgent, subString: "Firefox", identity: "Firefox"},
303        {string: navigator.userAgent, subString: "Safari", identity: "Safari"},
304        {string: navigator.userAgent, subString: "Opera", identity: "Opera"}
305    ]
306
307};
308
309var better_browser = '<div class="container"><div class="better-browser row"><div class="col-md-2"></div><div class="col-md-8"><h3>We are sorry but it looks like your Browser doesn\'t support our website Features. In order to get the full experience please download a new version of your favourite browser.</h3></div><div class="col-md-2"></div><br><div class="col-md-4"><a href="https://www.mozilla.org/ro/firefox/new/" class="btn btn-warning">Mozilla</a><br></div><div class="col-md-4"><a href="https://www.google.com/chrome/browser/desktop/index.html" class="btn ">Chrome</a><br></div><div class="col-md-4"><a href="http://windows.microsoft.com/en-us/internet-explorer/ie-11-worldwide-languages" class="btn">Internet Explorer</a><br></div><br><br><h4>Thank you!</h4></div></div>';

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.