-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
41 lines (34 loc) · 752 Bytes
/
main.js
File metadata and controls
41 lines (34 loc) · 752 Bytes
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
//Select element function
const selectElement = (element) => {
return document.querySelector(element);
};
let menuToggle = selectElement(".menu-toggle");
let body = selectElement("body");
menuToggle.addEventListener("click", () => {
body.classList.toggle("open");
});
window.animate = ScrollReveal();
animate.reveal(".animate-right", {
duration: 1000,
origin: "right",
distance: "25rem",
delay: 400,
});
animate.reveal(".animate-left", {
duration: 1000,
origin: "left",
distance: "25rem",
delay: 800,
});
animate.reveal(".animate-top", {
duration: 1000,
origin: "top",
distance: "25rem",
delay: 400,
});
animate.reveal(".animate-bottom", {
duration: 1000,
origin: "bottom",
distance: "25rem",
delay: 400,
});