-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
41 lines (33 loc) · 763 Bytes
/
index.js
File metadata and controls
41 lines (33 loc) · 763 Bytes
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
const mobile_nav = document.querySelector(".mob-nav-icon");
const mobile_nav2 = document.querySelector(".nav-elements");
const nav_header = document.querySelector(".navigation");
const toggleNavbar = () => {
nav_header.classList.toggle("mob-active");
};
mobile_nav.addEventListener("click", () => toggleNavbar());
mobile_nav2.addEventListener("click", () => toggleNavbar());
// GSAP ANIMATION SECTION
var tl = gsap.timeline();
tl.from(".nav-logo", {
y: -100,
opacity: 0,
duration: 0.5
});
tl.from(".home-heading, .home-para", {
x: -190,
opacity: 0,
duration: 0.7,
stagger: 0.6,
})
tl.from(".home-btn", {
y: 50,
opacity: 0,
stagger: 0.3
})
gsap.from(".home-img", {
opacity: 0,
scale: 0,
y: 100,
duration: 1,
delay: 1.5,
})