-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
53 lines (39 loc) · 929 Bytes
/
main.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
48
49
50
51
52
53
// select element function
const selectElement = function (element) {
return document.querySelector(element);
};
let menuToggler = selectElement('.menu-toggle');
let body = selectElement('body');
menuToggler.addEventListener('click', function() {
body.classList.toggle('open');
});
// mine isnt working
// the addEventListener seems to be the error
// we want to do the animation on the scroll.
//scroll reveal
window.sr = ScrollReveal();
sr.reveal('.animate-left', {
origin: 'left',
duration: 1000,
distance: '25rem',
delay: 300
});
sr.reveal('.animate-right', {
origin: 'right',
duration: 1000,
distance: '25rem',
delay: 600
});
sr.reveal('.animate-top', {
origin: 'top ',
duration: 1000,
distance: '25rem',
delay: 600
});
sr.reveal('.animate-bottom', {
origin: 'bottom',
duration: 1000,
distance: '25rem',
delay: 600
});
// to trigger the animations I need to link the Scroll Reveal in js.bbnn