-
Notifications
You must be signed in to change notification settings - Fork 2
/
sliderConfig.js
68 lines (58 loc) · 1.13 KB
/
sliderConfig.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
import logo1 from '../media/images/logo-1.png'
import logo2 from '../media/images/logo-4.png'
import logo3 from '../media/images/logo-3.png'
import logo4 from '../media/images/logo-2.png'
const breakPoint = 1359
const touchBreakPoint = 1024
const covSettings = (width) => {
const stretch = width < breakPoint ? 10 : 0
return {
rotate: 30,
stretch: stretch,
depth: 50,
modifier: 1,
slideShadows: false,
}
}
const getLogo = (index) => {
const logos = {
0: logo1,
1: logo2,
2: logo3,
3: logo4,
}
return logos[index]
}
const sliderSettings = (width, numbOfSlides) => {
return {
loop: true,
spaceBetween: 30,
slidesPerView: 3,
effect: 'coverflow',
centeredSlides: true,
slideToClickedSlide: true,
initialSlide: numbOfSlides,
coverflowEffect: covSettings(width),
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
}
}
}
const tiltSettings = (width) => {
const max = width <= touchBreakPoint ? 0 : 35
return {
glare: true,
"max-glare": 0.7,
gyroscope: false,
scale: 1,
max: max
}
}
export {
covSettings,
tiltSettings,
sliderSettings,
getLogo,
breakPoint,
}