-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCarRent.js
46 lines (32 loc) · 1.1 KB
/
CarRent.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
'use strict';
/**
* navbar toggle
*/
const overlay = document.querySelector("[data-overlay]");
const navbar = document.querySelector("[data-navbar]");
const navToggleBtn = document.querySelector("[data-nav-toggle-btn]");
const navbarLinks = document.querySelectorAll("[data-nav-link]");
const navToggleFunc = function () {
navToggleBtn.classList.toggle("active");
navbar.classList.toggle("active");
overlay.classList.toggle("active");
}
navToggleBtn.addEventListener("click", navToggleFunc);
overlay.addEventListener("click", navToggleFunc);
for (let i = 0; i < navbarLinks.length; i++) {
navbarLinks[i].addEventListener("click", navToggleFunc);
}
/**
* header active on scroll
*/
const header = document.querySelector("[data-header]");
window.addEventListener("scroll", function () {
window.scrollY >= 10 ? header.classList.add("active")
: header.classList.remove("active");
});
// TYPE 1 STARTED--------176
// TYPE 1 END------------592
// TYPE 2 STARTED--------596
// TYPE 2 END---- ------1010
// TYPE 3 STARTED-------1017
// TYPE 3 ENDED---------1428