-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
95 lines (83 loc) · 2.21 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
// dets is mouse jab jab move ho ra hai tab tab kya kya ghantnaye ho rahi hai hai like Xaxis , Yaxis coardinate etc
let crsr =document.querySelector("#cursor")
let crsr2 =document.querySelector("#cursor-b")
document.addEventListener("mousemove",function(dets){
// console.log(dets.y)//give yaxis
// console.log(dets.x)//give xaxis
crsr.style.left=dets.x+"px"
crsr.style.top=dets.y+30+"px"
crsr2.style.left=dets.x-200+"px"
crsr2.style.top=dets.y-200+"px"
})
let h4=document.querySelectorAll("#nav h4")
h4.forEach(function(value){
value.addEventListener("mouseenter" , function(){
crsr.style.scale=3
crsr.style.border="1px solid white"
crsr.style.backgroundColor="transparent"
})
value.addEventListener("mouseleave" , function(){
crsr.style.scale=1
crsr.style.border="0px solid #95C11E"
crsr.style.backgroundColor="#95C11E"
})
})
gsap.to("#nav" , {
backgroundColor : "black" ,
duration : 0.5,
height:"110px",
scrollTrigger:{
trigger:"#nav",
scroller:"body",
start:"top -10px",//itna scroll karne par bar dikhne lagega
end:"top -11%",//itna scrool karne par bar dikhne lagega
scrub:1/*black nav black wala gayab hone ki timing 1 to 5 scale hai exdum se color na change hoye*/
}
})
gsap.to("#main" , {
backgroundColor: "#000",
scrollTrigger:{
trigger:"#main",
scroller:"body",
// markers: true,
start:"top -80%",
end:"top -10%",
scrub:2
}
})
gsap.from("#about-us img , #about-us-in" ,{
y:90,
duration:1,
// stagger : 0.4, /*stagger is used for one by one */
scrollTrigger:{
trigger:"about-us",
scroller:"body",
scrub:1
}
} )
gsap.from("#colon1" ,{
y:-70,
x:-70,
scrollTrigger:{
trigger:"#colon1",
scroller:"body",
scrub:2
}
})
gsap.from("#colon2" ,{
y:70,
x:70,
scrollTrigger:{
trigger:"#colon2",
scroller:"body",
scrub:2
}
})
gsap.from("#page4 h1" , {
y:50,
scrollTrigger:{
trigger:"#page4 h1",
scroller:"body",
scrub:3
}
})