-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
112 lines (96 loc) · 2 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
108
109
110
111
112
var crsr = document.querySelector("#curser");
var blur = document.querySelector("#curser-blur");
document.addEventListener("mousemove", function (dets) {
crsr.style.left = dets.x + "px";
crsr.style.top = dets.y + "px";
blur.style.left = dets.x - 250 + "px";
blur.style.top = dets.y - 250 + "px";
});
gsap.to("#nav",{
backgroundColor: "black",
duration:0.5,
height:"100px",
scrollTrigger:{
trigger:"#nav",
scroller:"body",
start:"top -10%",
end:"top -11%",
scrub:0.5
},
})
gsap.to("#main",{
backgroundColor:'black',
scrollTrigger:{
trigger:"#main",
scroller:"body",
start:"top -30%",
end:"top -60%",
scrub:1
}
})
/* EFFECT ON ABOUT section */
gsap.from("#about,#aboutIn",{
y:60,
opacity:0,
duration:2,
scrollTrigger:{
trigger:"#about",
scroller:"body",
// ye markers bss show karta hai tumhare web mai ka se ka tak apply hora ye bss
// markers:true,
start:"top 90%",
end:"top 88%",
scrub:1
}
})
gsap.from("#page4 h2",{
y:60,
scrollTrigger:{
trigger:"#page4 h2",
scroller:"body",
// markers:true,
start:"top 70%",
end:"top 68%",
scrub:3
}
})
gsap.from("#container",{
y:60,
opacity:0,
duration:2,
stagger:1,
scrollTrigger:{
trigger:".pic",
scroller:"body",
// ye markers bss show karta hai tumhare web mai ka se ka tak apply hora ye bss
// markers:true,
start:"top 90%",
end:"top 88%",
scrub:1
}
})
gsap.from("#page3",{
x:50,
opacity:0,
duration:2,
scrollTrigger:{
trigger:"#page3",
scroller:"body",
start:"top 50%",
// markers:true,
end:"top 48%",
scrub:1
}
})
var navH4= document.querySelectorAll("#nav h4");
navH4.forEach(function(elem){
elem.addEventListener("mouseenter",function(){
crsr.style.scale=3
crsr.style.border="0.1px solid #fff"
crsr.style.backgroundColor="transparent"
})
elem.addEventListener("mouseleave",function(){
crsr.style.scale=1
crsr.style.backgroundColor="#95c11e"
})
})