pagination.scss 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. .swiper-pagination {
  2. position: absolute;
  3. text-align: center;
  4. transition: 300ms opacity;
  5. transform: translate3d(0, 0, 0);
  6. z-index: 10;
  7. font-size: 24rpx;
  8. &.swiper-pagination-hidden {
  9. opacity: 0;
  10. }
  11. }
  12. /* Common Styles */
  13. .swiper-pagination-fraction,
  14. .swiper-pagination-custom,
  15. .swiper-horizontal > .swiper-pagination-bullets,
  16. .swiper-pagination-bullets.swiper-pagination-horizontal {
  17. bottom: 10px;
  18. left: 0;
  19. width: 100%;
  20. }
  21. /* Bullets */
  22. .swiper-pagination-bullets-dynamic {
  23. overflow: hidden;
  24. font-size: 0;
  25. .swiper-pagination-bullet {
  26. transform: scale(0.33);
  27. position: relative;
  28. }
  29. .swiper-pagination-bullet-active {
  30. transform: scale(1);
  31. }
  32. .swiper-pagination-bullet-active-main {
  33. transform: scale(1);
  34. }
  35. .swiper-pagination-bullet-active-prev {
  36. transform: scale(0.66);
  37. }
  38. .swiper-pagination-bullet-active-prev-prev {
  39. transform: scale(0.33);
  40. }
  41. .swiper-pagination-bullet-active-next {
  42. transform: scale(0.66);
  43. }
  44. .swiper-pagination-bullet-active-next-next {
  45. transform: scale(0.33);
  46. }
  47. }
  48. .swiper-pagination-bullet {
  49. width: var(--swiper-pagination-bullet-width, var(--swiper-pagination-bullet-size, 8px));
  50. height: var(--swiper-pagination-bullet-height, var(--swiper-pagination-bullet-size, 8px));
  51. display: inline-block;
  52. border-radius: 50%;
  53. background: var(--swiper-pagination-bullet-inactive-color, #000);
  54. opacity: var(--swiper-pagination-bullet-inactive-opacity, 0.2);
  55. @at-root button#{&} {
  56. border: none;
  57. margin: 0;
  58. padding: 0;
  59. box-shadow: none;
  60. appearance: none;
  61. }
  62. .swiper-pagination-clickable & {
  63. cursor: pointer;
  64. }
  65. &:only-child {
  66. display: none !important;
  67. }
  68. }
  69. .swiper-pagination-bullet-active {
  70. opacity: var(--swiper-pagination-bullet-opacity, 1);
  71. background: var(--swiper-pagination-color, #007aff);
  72. }
  73. .swiper-vertical > .swiper-pagination-bullets,
  74. .swiper-pagination-vertical.swiper-pagination-bullets {
  75. right: 10px;
  76. top: 50%;
  77. transform: translate3d(0px, -50%, 0);
  78. .swiper-pagination-bullet {
  79. margin: var(--swiper-pagination-bullet-vertical-gap, 6px) 0;
  80. display: block;
  81. }
  82. &.swiper-pagination-bullets-dynamic {
  83. top: 50%;
  84. transform: translateY(-50%);
  85. width: 8px;
  86. .swiper-pagination-bullet {
  87. display: inline-block;
  88. transition: 200ms transform, 200ms top;
  89. }
  90. }
  91. }
  92. .swiper-horizontal > .swiper-pagination-bullets,
  93. .swiper-pagination-horizontal.swiper-pagination-bullets {
  94. .swiper-pagination-bullet {
  95. margin: 0 var(--swiper-pagination-bullet-horizontal-gap, 4px);
  96. }
  97. &.swiper-pagination-bullets-dynamic {
  98. left: 50%;
  99. transform: translateX(-50%);
  100. white-space: nowrap;
  101. .swiper-pagination-bullet {
  102. transition: 200ms transform, 200ms left;
  103. }
  104. }
  105. }
  106. .swiper-horizontal.swiper-rtl > .swiper-pagination-bullets-dynamic .swiper-pagination-bullet {
  107. transition: 200ms transform, 200ms right;
  108. }
  109. /* Progress */
  110. .swiper-pagination-progressbar {
  111. background: rgba(0, 0, 0, 0.25);
  112. position: absolute;
  113. .swiper-pagination-progressbar-fill {
  114. background: var(--swiper-pagination-color, #007aff);
  115. position: absolute;
  116. left: 0;
  117. top: 0;
  118. width: 100%;
  119. height: 100%;
  120. transform: scale(0);
  121. transform-origin: left top;
  122. }
  123. .swiper-rtl & .swiper-pagination-progressbar-fill {
  124. transform-origin: right top;
  125. }
  126. .swiper-horizontal > &,
  127. &.swiper-pagination-horizontal,
  128. .swiper-vertical > &.swiper-pagination-progressbar-opposite,
  129. &.swiper-pagination-vertical.swiper-pagination-progressbar-opposite {
  130. width: 100%;
  131. height: 4px;
  132. left: 0;
  133. top: 0;
  134. }
  135. .swiper-vertical > &,
  136. &.swiper-pagination-vertical,
  137. .swiper-horizontal > &.swiper-pagination-progressbar-opposite,
  138. &.swiper-pagination-horizontal.swiper-pagination-progressbar-opposite {
  139. width: 4px;
  140. height: 100%;
  141. left: 0;
  142. top: 0;
  143. }
  144. }
  145. .swiper-pagination-lock {
  146. display: none;
  147. }