-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
52 lines (47 loc) · 1.2 KB
/
script.js
File metadata and controls
52 lines (47 loc) · 1.2 KB
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
const navbarLinks = document.querySelectorAll('.nav-item');
navbarLinks.forEach(link => {
link.addEventListener('mouseover',() =>{
navbarLinks.forEach(otherlink => {
if (otherlink !=link) {
otherlink.style.opacity = '0.3'
}
});
})
link.addEventListener('mouseout',() =>{
navbarLinks.forEach(otherlink =>{
otherlink.style.opacity = '1'
})
})
});
// Website Full Animations
const timeline = gsap.timeline({repeat:0 , repeatDelay:0.5});
timeline.from(".sentence .first-line" , {
opacity:0,
duration:1,
filter:"blur(10px)"
});
timeline.from(".sentence .second-line" ,{
opacity:0,
duration:1,
filter:"blur(10px)"
});
timeline.from(".box",{
transform:"scale(0)",
duration:2,
onUpdate:function (){
if(this.progress() >= 0.5 && !this.hasUpdated){
console.log("50reaced");
}
gsap.from('.box',{borderRadius:"0px",duration:50});
this.hasUpdated = true;
},
onComplete:function(){
this.hasUpdated = false;
}
})
timeline.to(".move .morque",{
transform:'translateX(-100%)',
ease:"none",
duration:15,
repeat:-1
})