pagination.scss 4.3 KB

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