-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
43 lines (36 loc) · 929 Bytes
/
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
// Re-scroll more information to top once hover is left
const moreInfo = document.getElementsByClassName("projects__text-group");
for (let i = 0; i < moreInfo.length; i++) {
moreInfo[i].addEventListener("mouseleave", (e) => {
e.target.scrollTo(0, 0);
});
}
// Image slider
const swiper = new Swiper(".swiper", {
// Optional parameters
direction: "horizontal",
loop: true,
effect: "creative",
creativeEffect: {
prev: {
// will set `translateZ(-400px)` on previous slides
translate: [0, 0, -400],
},
next: {
// will set `translateX(100%)` on next slides
translate: ["100%", 0, 0],
},
},
keyboard: {
enabled: true,
onlyInViewport: false,
},
// Navigation arrows
pagination: {
el: ".swiper-pagination",
},
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev",
},
});