-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
49 lines (42 loc) · 976 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
window.onload = () =>{
let container = document.querySelector('.container-load');
container.style.visibility = 'hidden';
container.style.opacity = 0;
}
const selectElement = function (element){
return document.querySelector(element);
};
let menuToggler = selectElement('.menu-toggle');
let body = selectElement('body');
const closeMenu = () =>{
body.classList.remove('open');
}
menuToggler.addEventListener('click', function () {
body.classList.toggle('open');
})
// Scroll
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
})