-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
41 lines (34 loc) · 949 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
const icon = document.querySelector('.material-icons');
const nav = document.querySelector('.navbar');
const navlink = document.querySelectorAll('.navLink');
icon.addEventListener('click', () => {
nav.classList.toggle('open');
icon.classList.toggle('color');
})
for ( let link of navlink ) {
link.addEventListener('click', () => {
nav.classList.remove('open');
icon.classList.toggle('color');
})}
const scrollBtn = document.querySelector('.circleBtn');
scrollBtn.addEventListener('click', () => {
document.body.scrollTop = 0;
document.documentElement.scrollTop =0;
})
const t1 = gsap.timeline({ defaults: { ease: 'circ' } })
t1.from('body', {
opacity: 0,
display: 'none',
duration: 1
}).from('.navbar', {
y: '-100%',
duration: 0.7
}).from('.hero .overlay .text',{
y: '-100%',
opacity: 0,
duration: .7
}).from('.hero .overlay .btn', {
y: '100%',
opacity: 0,
duration: 0.7
});