-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
107 lines (102 loc) · 2.22 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
var cursor = document.querySelector("#cursor");
var cBlur = document.querySelector("#cursor-blur");
document.addEventListener("mousemove", function (dets) {
cursor.style.left = dets.x + "px";
cursor.style.top = dets.y + "px";
cBlur.style.left = dets.x - 200 + "px";
cBlur.style.top = dets.y - 200 + "px";
})
let h4all = document.querySelectorAll("#nav h4");
h4all.forEach(function(elem){
elem.addEventListener("mouseenter",function(){
cursor.style.scale=2
cursor.style.border="1px solid white"
cursor.style.backgroundColor="transparent"
})
elem.addEventListener("mouseleave",function(){
cursor.style.scale=1
cursor.style.border="0px solid white"
cursor.style.backgroundColor="#95C11E"
})
})
gsap.to("#nav", {
backgroundColor: "black",
height: "110",
duration: 0.5,
scrollTrigger: {
trigger: "#nav",
scroller: "body",
start: "top -10%",
end: "top -11",
scrub: 2
}
});
gsap.to("#main", {
backgroundColor: "#000",
scrollTrigger: {
trigger: "#main",
scroller: "body",
start: "top -30%",
end: "top -70%",
scrub: 4
}
});
gsap.from("#about-us,#about-us-in",{
y:35,
opacity:0,
duration:1,
scrollTrigger: {
trigger: "#about-us",
scroller: "body",
start: "top 60%",
end: "top 57%",
scrub:3
}
})
gsap.from(".card",{
y:35,
opacity:0,
duration:1,
scrollTrigger: {
trigger: ".card",
scroller: "body",
start: "top 90%",
end: "top 60%",
scrub:3
}
})
gsap.from("#pic,#content",{
opacity:0,
duration:1,
scrollTrigger: {
trigger: "#pic",
scroller: "body",
start: "top 90%",
end: "top 80%",
scrub:3
}
})
gsap.from("#left",{
y:-70,
x:-70,
duration:1,
scrollTrigger: {
trigger: "#left",
scroller: "body",
start: "top 55%",
end: "top 45%",
scrub:4
}
})
gsap.to("#right",{
y:-50,
x:-50,
duration:1,
scrollTrigger: {
trigger: "#right",
scroller: "body",
start: "top 90%",
end: "top 100%",
scrub:4
}
})