-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathscript.js
62 lines (56 loc) · 1.8 KB
/
script.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
54
55
56
57
58
59
60
61
62
function navAnimation() {
var nav = document.querySelector('nav');
nav.addEventListener('mouseenter', function () { //gsap has only two things to and from. from is used for starting the work and to is used for ending the work
let tl = gsap.timeline() // timeline is used to work in a synchronus flow. First nav-bottom will work then nav h5
tl.to("#nav-bottom", {
height: "23vh"
})
tl.to(".nav-part2 h5", {
display: "block"
})
tl.to(".nav-part2 h5 span", {
y: 0, // niche se nikal rha hai na isliye
// duration:0.3,
stagger: {
amount: 0.6 // duration aur stagger ko ek saath karne ki ninja technique
}
})
})
nav.addEventListener('mouseleave', function () {
let tl = gsap.timeline()
tl.to(".nav-part2 h5 span", {
y: 25,
stagger: {
amount: 0.2
}
})
tl.to(".nav-part2 h5", {
display: "none",
duration: 0.1
})
tl.to("#nav-bottom", {
height: 0,
duration: 0.2
})
})
}
navAnimation();
function myFunction1() {
var popup = document.getElementById("myPopup1");
popup.classList.toggle("show");
}
function myFunction2() {
var popup = document.getElementById("myPopup2");
popup.classList.toggle("show");
}
function myFunction3() {
var popup = document.getElementById("myPopup3");
popup.classList.toggle("show");
}
document.getElementById("scrollBtn").addEventListener("click", () => {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
});
function calender(){
window.location.href = "eventcalender.html";
}