-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
43 lines (35 loc) · 803 Bytes
/
app.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
//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');
});
//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
});