-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
47 lines (40 loc) · 886 Bytes
/
index.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
const selectElement = function (element) {
return document.querySelector(element);
};
// select the hamburger menu
let menuToggler = selectElement('.menu_toggle');
let body = selectElement('body');
// toggle the navigation bar
menuToggler.addEventListener('click', function () {
body.classList.toggle('open');
})
// Scroll Reveal
window.sr = ScrollReveal();
// animate the left side
sr.reveal('.animate_left', {
origin: 'left',
duration: '1000',
distance: '25rem',
delay: 300
});
// animate the right side
sr.reveal('.animate_right', {
origin: 'right',
duration: '1000',
distance: '25rem',
delay: 600
});
// animate top part
sr.reveal('.animate_top', {
origin: 'top',
duration: '1000',
distance: '25rem',
delay: 600
});
// animate bottom part
sr.reveal('.animate_bottom', {
origin: 'bottom',
duration: '1000',
distance: '25rem',
delay: 600
});