-
Notifications
You must be signed in to change notification settings - Fork 0
/
ImgSlider.js
114 lines (92 loc) · 2.16 KB
/
ImgSlider.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
import styled from "styled-components";
import "slick-carousel/slick/slick.css";
import "slick-carousel/slick/slick-theme.css";
import Slider from "react-slick";
const ImgSlider = (props) => {
let settings = {
dots: true,
infinite: true,
speed: 500,
slidesToShow: 1,
slidesToScroll: 1,
autoplay: true,
}
return (
<Carousel {...settings}>
<Wrap>
<a>
<img src="/images/slider-badging.jpg" alt="" />
</a>
</Wrap>
<Wrap>
<a>
<img src="/images/slider-scale.jpg" alt="" />
</a>
</Wrap>
<Wrap>
<a>
<img src="/images/slider-badag.jpg" alt="" />
</a>
</Wrap>
<Wrap>
<a>
<img src="/images/slider-scales.jpg" alt="" />
</a>
</Wrap>
</Carousel>
)
}
const Carousel = styled(Slider)`
margin-top: 20px;
& > button {
opacity: 0;
height: 100%;
width: 5vw;
z-index: 1;
&:hover {
opacity: 1;
tansition: opacity 0.2s ease 0s;
}
}
ul li button {
&:before {
font-size: 10px;
color: rgb(150, 158, 171);
}
}
li.slick-active button:before {
color: white;
}
.slick-list {
overflow: initial;
}
.slick-prev {
left: -75px;
}
.slick-next{
right: -75px;
}
`
const Wrap = styled.div`
border-radius: 4px;
cursor: pointer;
position: relative;
a {
border-radius: 4px;
box-shadow: rgb(0 0 0 /69%) 0px 26px 30px -10px, rgb(0 0 0 / 73%) 0px 16px 10px -10px;
cursor: pointer;
display: block;
position: relative;
padding: 4px;
img {
width: 100%;
height: 100%;
}
&:hover {
padding: 0;
border: 4px solid rgba(249, 249, 249, 0.8);
transition-duration: 300ms;
}
}
`
export default ImgSlider;