-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscript.js
114 lines (103 loc) · 2.53 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
113
114
// Initialize Lenis
const lenis = new Lenis({
autoRaf: true,
});
// Listen for the scroll event and log the event data
lenis.on('scroll', (e) => {
console.log(e);
});
let tl = gsap.timeline({
scrollTrigger:{
trigger : ".front-page",
start: "top top",
end: "100%",
// markers:true,
scrub: true,
pin: true,
}
})
tl.fromTo('.front-page', {clipPath: "circle(5%)"}, {clipPath: "circle(75%)", duration:3})
tl.fromTo('.perfume-note', {scale : 0.8}, {scale: 0, opacity: 0, duration: 1}, "-=3")
let tl2 = gsap.timeline({
scrollTrigger:{
trigger:".second-page, .hero .hero-txt",
start:"10% 20%",
end:"50% 50% ",
// markers:true,
pin:true,
scrub:1,
pinSpacing:false
}
})
tl2.from(".second-page", {opacity:0, y:"100%"})
tl2.from(".hero-txt", {x:"-150%"},"<1.5")
tl2.from(".hero-img", {x:"150%"},"<")
let tl3 = gsap.timeline({
scrollTrigger:{
trigger:".third-page-content1",
start:"50% 50%",
end:"180% 50%",
// markers:true,
scrub:true,
pinSpacing:false,
onEnter: () => {
document.querySelector(".third-page-content2 video").play();
},
onLeave: () =>{
document.querySelector('.third-page-content2 video').pause();
gsap.to(".third-page-content2", {
width: "60vw",
height: "50vh",
duration: 0.5,
})
},
onEnterBack: () =>{
document.querySelector(".third-page-content2 video").play();
},
onLeaveBack: () => {
document.querySelector('.third-page-content2 video').pause();
}
}
})
tl3.to(".third-page-content2", {width: "100vw", ease:"sine.inOut"})
let tl4 = gsap.timeline({
scrollTrigger:{
trigger:".Winter-page3",
start:"50% 50%",
end:"300% 50%",
scrub:1,
pin:true,
// markers:true
}
})
tl4.to(".winter-collection-bg-div",{
height:"65vh"
})
tl4.to(".winter-collection-heading",{
height:"65vh"
},0)
tl4.to("#winter", {
left: "30%",
fontSize: "3vw"
},0)
tl4.to("#collection", {
right:"0%",
fontSize: "3vw"
},0)
tl4.to(".winter-collection-img-div", {
marginTop:"-450%"
})
tl4.to(".winter-collection-bg-div",{
height:"0vh"
},'a')
tl4.to(".winter-collection-heading",{
height:"0vh"
},'a')
tl4.to("#winter", {
left: 0,
fontSize: "3.7vw"
},'a')
tl4.to("#collection", {
right: "45%",
fontSize: "3.7vw"
},'a')