Repository navigation
Expand file tree
/
Copy pathmain.js
More file actions
66 lines (54 loc) · 1.5 KB
/
Copy pathmain.js
File metadata and controls
66 lines (54 loc) · 1.5 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
const navLinks = document.getElementById("nav-links");
const menuBtn = document.getElementById("menu-btn");
const menuBtnIcon = menuBtn.querySelector("i");
menuBtn.addEventListener("click", (e) => {
navLinks.classList.toggle("open");
const isOpen = navLinks.classList.contains("open");
menuBtnIcon.setAttribute(
"class",
isOpen ? "ri-close-line" : "ri-menu-3-line"
);
});
navLinks.addEventListener("click", (e) => {
navLinks.classList.remove("open");
menuBtnIcon.setAttribute("class", "ri-menu-3-line");
});
const scrollRevealOption = {
distance: "50px",
origin: "bottom",
duration: 1000,
};
// header container
ScrollReveal().reveal(".header__content h1", {
...scrollRevealOption,
});
ScrollReveal().reveal(".header__content .section__description", {
...scrollRevealOption,
delay: 500,
});
ScrollReveal().reveal(".header__content .header__btn", {
...scrollRevealOption,
delay: 1000,
});
// about container
ScrollReveal().reveal(".about__content .section__header", {
...scrollRevealOption,
});
ScrollReveal().reveal(".about__content .section__description", {
...scrollRevealOption,
delay: 500,
});
ScrollReveal().reveal(".about__content .about__btn", {
...scrollRevealOption,
delay: 1000,
});
// service container
ScrollReveal().reveal(".service__card", {
...scrollRevealOption,
interval: 500,
});
// portfolio container
ScrollReveal().reveal(".portfolio__card", {
duration: 1000,
interval: 500,
});