carousel.scss 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. @use '../helpers/baseMixin.scss';
  2. .vxe-carousel {
  3. position: relative;
  4. font-size: var(--vxe-ui-font-size-default);
  5. color: var(--vxe-ui-font-color);
  6. font-family: var(--vxe-ui-font-family);
  7. background-color: var(--vxe-ui-layout-background-color);
  8. overflow: hidden;
  9. &:hover {
  10. .vxe-carousel--indicators {
  11. opacity: 1;
  12. }
  13. .vxe-carousel--previous-btn,
  14. .vxe-carousel--next-btn {
  15. opacity: 1;
  16. }
  17. &.is--horizontal {
  18. .vxe-carousel--previous-btn,
  19. .vxe-carousel--next-btn {
  20. transform: translate(0, -50%);
  21. }
  22. }
  23. &.is--vertical {
  24. .vxe-carousel--previous-btn,
  25. .vxe-carousel--next-btn {
  26. transform: translate(-50%, 0);
  27. }
  28. }
  29. }
  30. &.is--horizontal {
  31. .vxe-carousel--list {
  32. height: 100%;
  33. flex-direction: row;
  34. }
  35. .vxe-carousel--indicators {
  36. flex-direction: row;
  37. bottom: 0.3em;
  38. left: 50%;
  39. padding: 0.15em 0.3em;
  40. transform: translateX(-50%);
  41. &:hover {
  42. transform: translateX(-50%) scale(1.1);
  43. }
  44. }
  45. .vxe-carousel--indicators-item {
  46. margin: 0.2em 0.25em;
  47. }
  48. .vxe-carousel--previous-btn,
  49. .vxe-carousel--next-btn {
  50. top: 50%;
  51. transform: translate(0, -50%);
  52. &:hover {
  53. transform: translate(0, -50%) scale(1.1);
  54. }
  55. &:active {
  56. transform: translate(0, -50%) scale(0.8);
  57. }
  58. }
  59. .vxe-carousel--previous-btn {
  60. left: 0.3em;
  61. transform: translate(-0.8em, -50%);
  62. }
  63. .vxe-carousel--next-btn {
  64. right: 0.3em;
  65. transform: translate(0.8em, -50%);
  66. }
  67. }
  68. &.is--vertical {
  69. .vxe-carousel--list {
  70. width: 100%;
  71. flex-direction: column;
  72. }
  73. .vxe-carousel--indicators {
  74. display: flex;
  75. flex-direction: column;
  76. padding: 0.3em 0.15em;
  77. top: 50%;
  78. right: 0.3em;
  79. transform: translateY(-50%);
  80. &:hover {
  81. transform: translateY(-50%) scale(1.1);
  82. }
  83. }
  84. .vxe-carousel--indicators-item {
  85. margin: 0.25em 0.2em;
  86. }
  87. .vxe-carousel--previous-btn,
  88. .vxe-carousel--next-btn {
  89. left: 50%;
  90. &:hover {
  91. transform: translate(-50%, 0) scale(1.1);
  92. }
  93. &:active {
  94. transform: translate(-50%, 0) scale(0.8);
  95. }
  96. }
  97. .vxe-carousel--previous-btn {
  98. top: 0.3em;
  99. transform: translate(-50%, -0.8em);
  100. }
  101. .vxe-carousel--next-btn {
  102. bottom: 0.3em;
  103. transform: translate(-50%, 0.8em);
  104. }
  105. }
  106. }
  107. .vxe-carousel--slots {
  108. display: none;
  109. }
  110. .vxe-carousel--item-wrapper {
  111. position: relative;
  112. width: 100%;
  113. overflow: hidden;
  114. }
  115. .vxe-carousel--list {
  116. position: absolute;
  117. left: 0;
  118. top: 0;
  119. display: flex;
  120. outline: 0;
  121. @include baseMixin.createAnimationTransition(transform, .2s);
  122. }
  123. .vxe-carousel--item-inner {
  124. width: 100%;
  125. height: 100%;
  126. text-align: center;
  127. flex-grow: 1;
  128. }
  129. .vxe-carousel--item-img {
  130. max-width: 100%;
  131. max-height: 100%;
  132. }
  133. .vxe-carousel--indicators {
  134. position: absolute;
  135. display: inline-flex;
  136. background-color: rgba(0, 0, 0, 0.6);
  137. border-radius: 0.6em;
  138. opacity: 0;
  139. @include baseMixin.createAnimationTransition(all, .3s);
  140. }
  141. .vxe-carousel--indicators-item {
  142. width: 0.8em;
  143. height: 0.8em;
  144. border-radius: 50%;
  145. background-color: rgba(255, 255, 255, 0.8);
  146. cursor: pointer;
  147. @include baseMixin.createAnimationTransition(all, .2s);
  148. &.is--active {
  149. background-color: rgba(255, 255, 255, 1);
  150. }
  151. &:hover {
  152. background-color: rgba(255, 255, 255, 0.9);
  153. }
  154. &:active {
  155. background-color: var(--vxe-ui-font-primary-color);
  156. transform: scale(0.8);
  157. }
  158. }
  159. .vxe-carousel--previous-btn,
  160. .vxe-carousel--next-btn {
  161. display: flex;
  162. flex-direction: row;
  163. align-items: center;
  164. justify-content: center;
  165. position: absolute;
  166. width: 1.8em;
  167. height: 1.8em;
  168. border-radius: 50%;
  169. font-size: 1.4em;
  170. background-color: rgba(0, 0, 0, 0.8);
  171. opacity: 0;
  172. color: rgba(255, 255, 255, 0.6);
  173. cursor: pointer;
  174. @include baseMixin.createAnimationTransition(all, .2s);
  175. &:hover {
  176. color: rgba(255, 255, 255, 1);
  177. }
  178. &:active {
  179. color: var(--vxe-ui-font-primary-color);
  180. background-color: rgba(0, 0, 0, 0.6);
  181. }
  182. }