-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.js
143 lines (139 loc) · 3.48 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
// NAVBAR AUTO-HIDE
document.addEventListener("DOMContentLoaded", function () {
el_autohide = document.querySelector('.autohide');
if (el_autohide) {
var last_scroll_top = 0;
window.addEventListener('scroll', function () {
let scroll_top = window.scrollY;
if (scroll_top < last_scroll_top) {
el_autohide.classList.remove('scrolled-down');
el_autohide.classList.add('scrolled-up');
} else {
el_autohide.classList.remove('scrolled-up');
el_autohide.classList.add('scrolled-down');
}
last_scroll_top = scroll_top;
});
}
});
// OWL SLIDER
$('.owl-carousel').owlCarousel({
nav: false,
items: 1,
loop: true,
margin: 15,
autoplay: true,
autoplayTimeout: 5000,
autoplaySpeed: 1000,
autoplayHoverPause: false,
responsive: {
0: {
items: 1
},
600: {
items: 1
},
1000: {
items: 1
}
}
})
// SWIPER SLIDER
var swiper = new Swiper(".mySwiper", {
loop: true,
spaceBetween: 30,
effect: "fade",
centeredSlides: true,
autoplay: {
delay: 5000,
disableOnInteraction: false,
},
pagination: {
el: ".swiper-pagination",
clickable: true,
},
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev",
},
});
// Google Map API
let map;
function initMap() {
var location = {
lat: 39.045753,
lng: -76.641273
};
map = new google.maps.Map(document.getElementById("map"), {
center: location,
zoom: 12
});
/*
*/
addMarker({
coordinates: {
lat: 38.9897,
lng: -76.9378
},
content: '<h6>Secret Mirage - Maryland Branch</h6>'
});
addMarker({
coordinates: {
lat: 42.4072,
lng: -71.3824
},
content: '<h6>Secret Mirage - Massachusetts Branch</h6>'
});
addMarker({
coordinates: {
lat: 39.5501,
lng: -105.7821
},
content: '<h6>Secret Mirage - Colorado Branch</h6>'
});
addMarker({
coordinates: {
lat: 32.3547,
lng: -89.3985
},
content: '<h6>Secret Mirage - Mississippi Branch</h6>'
});
addMarker({
coordinates: {
lat: 37.7749,
lng: -122.4194
},
content: '<h6>Secret Mirage - California Branch</h6>'
});
function addMarker(properties) {
var marker = new google.maps.Marker({
position: properties.coordinates,
map: map
});
if (properties.content) {
var infoWindow = new google.maps.InfoWindow({
content: properties.content
});
marker.addListener('click', function () {
infoWindow.open(map, marker);
})
}
}
}
// // PRELOADER
// function preloader() {
// var page = setTimeout(showPage, 5000);
// }
// function showPage() {
// document.getElementById("loader").style.setProperty('display', 'none', 'important');
// document.getElementById("body").style.overflow = "visible";
// document.getElementById("whole__section").style.visibility = "visible";
// }
// FakeLoader
$(document).ready(function () {
$.fakeLoader({
timeToHide: 6000,
bgColor: "#C59D5F",
spinner: "spinner1"
});
});