-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
55 lines (42 loc) · 1022 Bytes
/
script.js
File metadata and controls
55 lines (42 loc) · 1022 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
const scroll = new LocomotiveScroll({
el: document.querySelector('main'),
smooth: true
});
document.querySelector('.footer h2').addEventListener('click',()=>{
scroll.scrollTo(0)
})
function loading(){
let tl = gsap.timeline()
tl.to('#yellow1',{
top:"-100%",
delay:0.5,
duration:0.5,
ease:"expo.out"
})
tl.from('#yellow2',{
top:"100%",
delay:0.5,
duration:0.5,
ease:"expo.out"
},"anime")
tl.to("#loader h1",{
delay:0.6,
duration:0.5,
color:"black"
},"anime")
tl.to("#loader",{
opacity:0
},"hide")
tl.to("#loader",{
display:"none"
},"hide")
}
loading();
let elems = document.querySelectorAll('.elem');
let page2 = document.querySelector('#page2');
elems.forEach((ele)=>{
ele.addEventListener('mouseenter',()=>{
let dataimg = ele.getAttribute('data-img');
page2.style.backgroundImage = `url(${dataimg})`;
});
})