UNPKG

2.76 kBSCSSView Raw
1$react-slidy-c-background: transparent !default;
2$react-slidy-c-nav-background: rgba(255, 255, 255, 0.8) !default;
3$react-slidy-c-nav-color: #aaaaaa !default;
4$react-slidy-c-transparent: rgba(0, 0, 0, 0) !default;
5$react-slidy-h-image: auto !default;
6$react-slidy-mh: 50px !default;
7
8@mixin arrow($direction) {
9 @if $direction == 'right' {
10 margin-right: 6px;
11 transform: rotate(45deg);
12 } @else if $direction == 'left' {
13 margin-left: 6px;
14 transform: rotate(-135deg);
15 }
16
17 border-right: 3px solid $react-slidy-c-nav-color;
18 border-top: 3px solid $react-slidy-c-nav-color;
19 content: '';
20 display: inline-block;
21 height: 24px;
22 width: 24px;
23}
24
25.react-Slidy {
26 -webkit-tap-highlight-color: $react-slidy-c-transparent;
27 backface-visibility: hidden;
28 background: $react-slidy-c-background;
29 min-height: $react-slidy-mh;
30 position: relative;
31 user-select: none;
32
33 &-arrow {
34 align-items: center;
35 bottom: 0;
36 display: flex;
37 margin: auto 0;
38 opacity: 0;
39 position: absolute;
40 top: 0;
41 transition: opacity 0.3s ease;
42 width: auto;
43 z-index: 1;
44
45 &Left {
46 left: 0;
47 }
48
49 &Right {
50 right: 0;
51 }
52
53 @media screen and (max-width: 850px) {
54 display: none;
55 }
56 }
57
58 &-prev,
59 &-next {
60 background: $react-slidy-c-nav-background;
61 cursor: pointer;
62 height: 20%;
63 justify-content: center;
64 min-height: 56px;
65 width: 40px;
66 }
67
68 &-next {
69 border-radius: 10px 0 0 10px;
70
71 &::after {
72 @include arrow('right');
73 }
74 }
75
76 &-prev {
77 border-radius: 0 10px 10px 0;
78
79 &::after {
80 @include arrow('left');
81 }
82 }
83
84 &--fullHeight {
85 height: 100%;
86 & > div li img {
87 height: 100%;
88 }
89 }
90
91 &--fullWidth > div li img {
92 width: 100%;
93 }
94
95 &--contain li img {
96 object-fit: contain;
97 }
98
99 &--cover li img {
100 object-fit: cover;
101 }
102
103 &:hover > &-arrow {
104 opacity: 1;
105 }
106
107 &:hover > &-arrow[disabled] {
108 opacity: 0.2;
109 }
110
111 > div {
112 font-size: 0;
113 max-height: 100%;
114 overflow: hidden;
115 position: relative;
116 white-space: nowrap;
117 width: 100%;
118
119 > ul {
120 display: block;
121 list-style: none;
122 padding: 0;
123 transition-property: transform;
124 width: 100%;
125 will-change: transform, transition-timing, transition-duration;
126
127 & > li {
128 display: inline-block;
129 position: relative;
130 user-select: none;
131 vertical-align: middle;
132 width: 100%;
133 }
134 }
135
136 img {
137 -webkit-backface-visibility: hidden;
138 -webkit-perspective: 1000;
139
140 display: block;
141 height: $react-slidy-h-image;
142 margin: 0 auto;
143 max-width: 100%;
144 pointer-events: none;
145 touch-action: none;
146 user-select: none;
147 }
148 }
149}