智慧水务管理系统 - 精河县供水工程综合管理平台

carousel.scss 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. @use 'mixins/mixins' as *;
  2. @use 'mixins/var' as *;
  3. @use 'mixins/utils' as *;
  4. @use 'common/var' as *;
  5. @include b(carousel) {
  6. @include set-component-css-var('carousel', $carousel);
  7. position: relative;
  8. @include m(horizontal) {
  9. overflow: hidden;
  10. }
  11. @include m(vertical) {
  12. overflow: hidden;
  13. }
  14. // When vertical with outside indicators, use flex layout for horizontal arrangement
  15. @include when(vertical-outside) {
  16. display: flex;
  17. flex-direction: row;
  18. align-items: center;
  19. @include e(container) {
  20. flex: 1;
  21. }
  22. }
  23. @include e(container) {
  24. position: relative;
  25. height: 300px;
  26. }
  27. @include e(arrow) {
  28. border: none;
  29. outline: none;
  30. padding: 0;
  31. margin: 0;
  32. height: getCssVar('carousel', 'arrow-size');
  33. width: getCssVar('carousel', 'arrow-size');
  34. cursor: pointer;
  35. transition: getCssVar('transition', 'duration');
  36. border-radius: 50%;
  37. background-color: getCssVar('carousel', 'arrow-background');
  38. color: $color-white;
  39. position: absolute;
  40. top: 50%;
  41. z-index: 10;
  42. transform: translateY(-50%);
  43. text-align: center;
  44. font-size: getCssVar('carousel', 'arrow-font-size');
  45. @include utils-inline-flex-center;
  46. @include m(left) {
  47. left: 16px;
  48. }
  49. @include m(right) {
  50. right: 16px;
  51. }
  52. &:hover {
  53. background-color: getCssVar('carousel', 'arrow-hover-background');
  54. }
  55. & i {
  56. cursor: pointer;
  57. }
  58. }
  59. @include e(indicators) {
  60. position: absolute;
  61. list-style: none;
  62. margin: 0;
  63. padding: 0;
  64. z-index: calc(#{getCssVar('index-normal')} + 1);
  65. @include m(horizontal) {
  66. bottom: 0;
  67. left: 50%;
  68. transform: translateX(-50%);
  69. }
  70. @include m(vertical) {
  71. right: 0;
  72. top: 50%;
  73. transform: translateY(-50%);
  74. }
  75. @include m(outside) {
  76. text-align: center;
  77. position: static;
  78. transform: none;
  79. .#{$namespace}-carousel__indicator:hover button {
  80. opacity: 0.64;
  81. }
  82. button {
  83. background-color: getCssVar('carousel', 'indicator-out-color');
  84. opacity: 0.24;
  85. }
  86. }
  87. @include m(right) {
  88. right: 0;
  89. }
  90. @include m(labels) {
  91. .#{$namespace}-carousel__button {
  92. padding: 2px 18px;
  93. font-size: 12px;
  94. color: $color-black;
  95. }
  96. .#{$namespace}-carousel__indicator {
  97. padding: 6px 4px;
  98. }
  99. }
  100. }
  101. @include e(indicator) {
  102. background-color: transparent;
  103. cursor: pointer;
  104. &:hover button {
  105. opacity: 0.72;
  106. }
  107. @include m(horizontal) {
  108. display: inline-block;
  109. padding: getCssVar('carousel-indicator-padding-vertical')
  110. getCssVar('carousel-indicator-padding-horizontal');
  111. }
  112. @include m(vertical) {
  113. padding: getCssVar('carousel-indicator-padding-horizontal')
  114. getCssVar('carousel-indicator-padding-vertical');
  115. .#{$namespace}-carousel__button {
  116. width: getCssVar('carousel-indicator-height');
  117. height: calc(#{getCssVar('carousel-indicator-width')} / 2);
  118. }
  119. }
  120. @include when(active) {
  121. button {
  122. opacity: 1;
  123. }
  124. }
  125. }
  126. @include e(button) {
  127. display: block;
  128. opacity: 0.48;
  129. width: getCssVar('carousel-indicator-width');
  130. height: getCssVar('carousel-indicator-height');
  131. background-color: $color-white;
  132. border: none;
  133. outline: none;
  134. padding: 0;
  135. margin: 0;
  136. cursor: pointer;
  137. transition: getCssVar('transition-duration');
  138. // To prevent styles from being overridden
  139. // When labels exist, use auto size so button content can center correctly
  140. .#{$namespace}-carousel__indicators--labels & {
  141. height: auto;
  142. width: auto;
  143. }
  144. }
  145. }
  146. .carousel-arrow-left-enter-from,
  147. .carousel-arrow-left-leave-active {
  148. transform: translateY(-50%) translateX(-10px);
  149. opacity: 0;
  150. }
  151. .carousel-arrow-right-enter-from,
  152. .carousel-arrow-right-leave-active {
  153. transform: translateY(-50%) translateX(10px);
  154. opacity: 0;
  155. }
  156. .#{$namespace}-transitioning {
  157. filter: url('#elCarouselHorizontal');
  158. }
  159. .#{$namespace}-transitioning-vertical {
  160. filter: url('#elCarouselVertical');
  161. }