-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
54 lines (43 loc) · 1.58 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
/*
Template Name: CryptoLand - Crypto Currency Landing Page Template.
Author: GrayGrids
*/
(function () {
//===== Prealoder
window.onload = function () {
window.setTimeout(fadeout, 500);
}
function fadeout() {
document.querySelector('.preloader').style.opacity = '0';
document.querySelector('.preloader').style.display = 'none';
}
/*=====================================
Sticky
======================================= */
window.onscroll = function () {
var header_navbar = document.querySelector(".navbar-area");
var sticky = header_navbar.offsetTop;
var logo = document.querySelector('.navbar-brand img')
if (window.pageYOffset > sticky) {
header_navbar.classList.add("sticky");
logo.src = 'assets/images/logo/logo.svg';
} else {
header_navbar.classList.remove("sticky");
logo.src = 'assets/images/logo/white-logo.svg';
}
// show or hide the back-top-top button
var backToTo = document.querySelector(".scroll-top");
if (document.body.scrollTop > 50 || document.documentElement.scrollTop > 50) {
backToTo.style.display = "flex";
} else {
backToTo.style.display = "none";
}
};
// WOW active
new WOW().init();
//===== mobile-menu-btn
let navbarToggler = document.querySelector(".mobile-menu-btn");
navbarToggler.addEventListener('click', function () {
navbarToggler.classList.toggle("active");
});
})();