ac99310ea1d062c014ee1303c75509e358eedb23b0bdc73ab2ae47bf0ca42a68235b2bc3b63acb1b7eabbad45af2080f5dcad14268afbbc172837e64b5106a 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. @import "mixins/mixins";
  2. @import "common/var";
  3. @include b(carousel) {
  4. position: relative;
  5. @include m(horizontal) {
  6. overflow-x: hidden;
  7. }
  8. @include m(vertical) {
  9. overflow-y: hidden;
  10. }
  11. @include e(container) {
  12. position: relative;
  13. height: 300px;
  14. }
  15. @include e(arrow) {
  16. border: none;
  17. outline: none;
  18. padding: 0;
  19. margin: 0;
  20. height: $--carousel-arrow-size;
  21. width: $--carousel-arrow-size;
  22. cursor: pointer;
  23. transition: .3s;
  24. border-radius: 50%;
  25. background-color: $--carousel-arrow-background;
  26. color: $--color-white;
  27. position: absolute;
  28. top: 50%;
  29. z-index: 10;
  30. transform: translateY(-50%);
  31. text-align: center;
  32. font-size: $--carousel-arrow-font-size;
  33. @include m(left) {
  34. left: 16px;
  35. }
  36. @include m(right) {
  37. right: 16px;
  38. }
  39. &:hover {
  40. background-color: $--carousel-arrow-hover-background;
  41. }
  42. & i {
  43. cursor: pointer;
  44. }
  45. }
  46. @include e(indicators) {
  47. position: absolute;
  48. list-style: none;
  49. margin: 0;
  50. padding: 0;
  51. z-index: #{$--index-normal + 1};
  52. @include m(horizontal) {
  53. bottom: 0;
  54. left: 50%;
  55. transform: translateX(-50%);
  56. }
  57. @include m(vertical) {
  58. right: 0;
  59. top: 50%;
  60. transform: translateY(-50%);
  61. }
  62. @include m(outside) {
  63. bottom: #{$--carousel-indicator-height + $--carousel-indicator-padding-vertical * 2};
  64. text-align: center;
  65. position: static;
  66. transform: none;
  67. .el-carousel__indicator:hover button {
  68. opacity: 0.64;
  69. }
  70. button {
  71. background-color: $--carousel-indicator-out-color;
  72. opacity: 0.24;
  73. }
  74. }
  75. @include m(labels) {
  76. left: 0;
  77. right: 0;
  78. transform: none;
  79. text-align: center;
  80. .el-carousel__button {
  81. height: auto;
  82. width: auto;
  83. padding: 2px 18px;
  84. font-size: 12px;
  85. }
  86. .el-carousel__indicator {
  87. padding: 6px 4px;
  88. }
  89. }
  90. }
  91. @include e(indicator) {
  92. background-color: transparent;
  93. cursor: pointer;
  94. &:hover button {
  95. opacity: 0.72;
  96. }
  97. @include m(horizontal) {
  98. display: inline-block;
  99. padding: $--carousel-indicator-padding-vertical $--carousel-indicator-padding-horizontal;
  100. }
  101. @include m(vertical) {
  102. padding: $--carousel-indicator-padding-horizontal $--carousel-indicator-padding-vertical;
  103. .el-carousel__button {
  104. width: $--carousel-indicator-height;
  105. height: #{$--carousel-indicator-width / 2};
  106. }
  107. }
  108. @include when(active) {
  109. button {
  110. opacity: 1;
  111. }
  112. }
  113. }
  114. @include e(button) {
  115. display: block;
  116. opacity: 0.48;
  117. width: $--carousel-indicator-width;
  118. height: $--carousel-indicator-height;
  119. background-color: $--color-white;
  120. border: none;
  121. outline: none;
  122. padding: 0;
  123. margin: 0;
  124. cursor: pointer;
  125. transition: .3s;
  126. }
  127. }
  128. .carousel-arrow-left-enter,
  129. .carousel-arrow-left-leave-active {
  130. transform: translateY(-50%) translateX(-10px);
  131. opacity: 0;
  132. }
  133. .carousel-arrow-right-enter,
  134. .carousel-arrow-right-leave-active {
  135. transform: translateY(-50%) translateX(10px);
  136. opacity: 0;
  137. }