-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
46 lines (37 loc) · 1.29 KB
/
script.js
File metadata and controls
46 lines (37 loc) · 1.29 KB
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
const hamburger = document.querySelector(".hamburger");
const navMenu = document.querySelector(".nav-items");
hamburger.addEventListener("click", function () {
navMenu.classList.toggle("dis");
hamburger.classList.toggle("active");
});
const skip = document.querySelector(".skip");
const getintouch = document.querySelector(".getintouch");
const disable = document.querySelector(".disableget");
skip.addEventListener("click", function () {
getintouch.classList.toggle("disable");
disable.classList.add("getin");
disable.classList.remove("disableget");
});
const touch = document.getElementById("touch");
touch.addEventListener("click", function () {
getintouch.classList.toggle("disable");
touch.classList.remove("getin");
touch.classList.add("disableget");
});
const navbar = document.querySelector("nav");
window.addEventListener("scroll", function () {
let y = window.scrollY;
if (y >= 40) {
navbar.classList.add("scroll");
navbar.classList.remove("nav");
} else {
navbar.classList.add("nav");
navbar.classList.remove("scroll");
}
});
const preloader = document.getElementById("loading");
const container = document.getElementById("container");
window.addEventListener("load", function () {
preloader.style.display = "none";
container.style.display = "block";
});