-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
37 lines (34 loc) · 856 Bytes
/
script.js
File metadata and controls
37 lines (34 loc) · 856 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
var crsr = document.querySelector("#cursor");
var blur = document.querySelector("#cursor-blur");
document.addEventListener("mousemove", function(dets) {
crsr.style.left = dets.x + "px";
crsr.style.top = dets.y + "px";
blur.style.left = dets.x - 150 + "px";
blur.style.top = dets.y - 150 + "px";
});
// nav element pr gsap lga rhe ha
gsap.to("#nav", {
backgroundColor: "#000",
duration: 0.5,
height: "100px",
scrollTrigger: {
trigger: "#nav",
scroller: "body",
// markers: true,
start: "top -10%",
end: "top -12%",
scrub: 2
}
});
gsap.to("#main", {
backgroundColor: "#000",
duration: 0.5,
scrollTrigger: {
trigger: "#main",
scroller: "body",
delay: 0.2,
start: "top -50%",
end: "top -100%",
scrub: 2
}
});