-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
35 lines (30 loc) 路 738 Bytes
/
Copy pathmain.js
File metadata and controls
35 lines (30 loc) 路 738 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
function waitingForHover() {
gsap.set(".eye", { backgroundPosition: "0" });
}
function eyeOpen(e) {
console.log(e.target);
gsap.set(e.target, { backgroundPosition: "0" });
gsap.to(e.target, 0.3, {
backgroundPosition: "-450px",
ease: SteppedEase.config(3)
});
}
function eyeClose(e) {
gsap.set(e.target, { backgroundPosition: "-450px" });
gsap.to(e.target, 0.3, {
backgroundPosition: "0",
ease: SteppedEase.config(3)
});
}
document.addEventListener(
"DOMContentLoaded",
() => {
waitingForHover();
for (let elem of document.getElementsByClassName("eye")) {
elem.addEventListener("mouseover", eyeOpen);
elem.addEventListener("mouseout", eyeClose);
}
},
false
);
// PAGE 1