You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

226 lines
5.4 KiB

3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. // Notes on the classes:
  2. //
  3. // 1. .carousel.pointer-event should ideally be pan-y (to allow for users to scroll vertically)
  4. // even when their scroll action started on a carousel, but for compatibility (with Firefox)
  5. // we're preventing all actions instead
  6. // 2. The .carousel-item-start and .carousel-item-end is used to indicate where
  7. // the active slide is heading.
  8. // 3. .active.carousel-item is the current slide.
  9. // 4. .active.carousel-item-start and .active.carousel-item-end is the current
  10. // slide in its in-transition state. Only one of these occurs at a time.
  11. // 5. .carousel-item-next.carousel-item-start and .carousel-item-prev.carousel-item-end
  12. // is the upcoming slide in transition.
  13. .carousel {
  14. position: relative;
  15. }
  16. .carousel.pointer-event {
  17. touch-action: pan-y;
  18. }
  19. .carousel-inner {
  20. position: relative;
  21. width: 100%;
  22. overflow: hidden;
  23. @include clearfix();
  24. }
  25. .carousel-item {
  26. position: relative;
  27. display: none;
  28. float: left;
  29. width: 100%;
  30. margin-right: -100%;
  31. backface-visibility: hidden;
  32. @include transition($carousel-transition);
  33. }
  34. .carousel-item.active,
  35. .carousel-item-next,
  36. .carousel-item-prev {
  37. display: block;
  38. }
  39. .carousel-item-next:not(.carousel-item-start),
  40. .active.carousel-item-end {
  41. transform: translateX(100%);
  42. }
  43. .carousel-item-prev:not(.carousel-item-end),
  44. .active.carousel-item-start {
  45. transform: translateX(-100%);
  46. }
  47. //
  48. // Alternate transitions
  49. //
  50. .carousel-fade {
  51. .carousel-item {
  52. opacity: 0;
  53. transition-property: opacity;
  54. transform: none;
  55. }
  56. .carousel-item.active,
  57. .carousel-item-next.carousel-item-start,
  58. .carousel-item-prev.carousel-item-end {
  59. z-index: 1;
  60. opacity: 1;
  61. }
  62. .active.carousel-item-start,
  63. .active.carousel-item-end {
  64. z-index: 0;
  65. opacity: 0;
  66. @include transition(opacity 0s $carousel-transition-duration);
  67. }
  68. }
  69. //
  70. // Left/right controls for nav
  71. //
  72. .carousel-control-prev,
  73. .carousel-control-next {
  74. position: absolute;
  75. top: 0;
  76. bottom: 0;
  77. z-index: 1;
  78. // Use flex for alignment (1-3)
  79. display: flex; // 1. allow flex styles
  80. align-items: center; // 2. vertically center contents
  81. justify-content: center; // 3. horizontally center contents
  82. width: $carousel-control-width;
  83. padding: 0;
  84. color: $carousel-control-color;
  85. text-align: center;
  86. background: none;
  87. border: 0;
  88. opacity: $carousel-control-opacity;
  89. @include transition($carousel-control-transition);
  90. // Hover/focus state
  91. &:hover,
  92. &:focus {
  93. color: $carousel-control-color;
  94. text-decoration: none;
  95. outline: 0;
  96. opacity: $carousel-control-hover-opacity;
  97. }
  98. }
  99. .carousel-control-prev {
  100. left: 0;
  101. background-image: if($enable-gradients, linear-gradient(90deg, rgba($black, .25), rgba($black, .001)), null);
  102. }
  103. .carousel-control-next {
  104. right: 0;
  105. background-image: if($enable-gradients, linear-gradient(270deg, rgba($black, .25), rgba($black, .001)), null);
  106. }
  107. // Icons for within
  108. .carousel-control-prev-icon,
  109. .carousel-control-next-icon {
  110. display: inline-block;
  111. width: $carousel-control-icon-width;
  112. height: $carousel-control-icon-width;
  113. background-repeat: no-repeat;
  114. background-position: 50%;
  115. background-size: 100% 100%;
  116. }
  117. /* rtl:options: {
  118. "autoRename": true,
  119. "stringMap":[ {
  120. "name" : "prev-next",
  121. "search" : "prev",
  122. "replace" : "next"
  123. } ]
  124. } */
  125. .carousel-control-prev-icon {
  126. background-image: escape-svg($carousel-control-prev-icon-bg);
  127. }
  128. .carousel-control-next-icon {
  129. background-image: escape-svg($carousel-control-next-icon-bg);
  130. }
  131. // Optional indicator pips/controls
  132. //
  133. // Add a container (such as a list) with the following class and add an item (ideally a focusable control,
  134. // like a button) with data-bs-target for each slide your carousel holds.
  135. .carousel-indicators {
  136. position: absolute;
  137. right: 0;
  138. bottom: 0;
  139. left: 0;
  140. z-index: 2;
  141. display: flex;
  142. justify-content: center;
  143. padding: 0;
  144. // Use the .carousel-control's width as margin so we don't overlay those
  145. margin-right: $carousel-control-width;
  146. margin-bottom: 1rem;
  147. margin-left: $carousel-control-width;
  148. list-style: none;
  149. [data-bs-target] {
  150. box-sizing: content-box;
  151. flex: 0 1 auto;
  152. width: $carousel-indicator-width;
  153. height: $carousel-indicator-height;
  154. padding: 0;
  155. margin-right: $carousel-indicator-spacer;
  156. margin-left: $carousel-indicator-spacer;
  157. text-indent: -999px;
  158. cursor: pointer;
  159. background-color: $carousel-indicator-active-bg;
  160. background-clip: padding-box;
  161. border: 0;
  162. // Use transparent borders to increase the hit area by 10px on top and bottom.
  163. border-top: $carousel-indicator-hit-area-height solid transparent;
  164. border-bottom: $carousel-indicator-hit-area-height solid transparent;
  165. opacity: $carousel-indicator-opacity;
  166. @include transition($carousel-indicator-transition);
  167. }
  168. .active {
  169. opacity: $carousel-indicator-active-opacity;
  170. }
  171. }
  172. // Optional captions
  173. //
  174. //
  175. .carousel-caption {
  176. position: absolute;
  177. right: (100% - $carousel-caption-width) * .5;
  178. bottom: $carousel-caption-spacer;
  179. left: (100% - $carousel-caption-width) * .5;
  180. padding-top: $carousel-caption-padding-y;
  181. padding-bottom: $carousel-caption-padding-y;
  182. color: $carousel-caption-color;
  183. text-align: center;
  184. }
  185. // Dark mode carousel
  186. .carousel-dark {
  187. .carousel-control-prev-icon,
  188. .carousel-control-next-icon {
  189. filter: $carousel-dark-control-icon-filter;
  190. }
  191. .carousel-indicators [data-bs-target] {
  192. background-color: $carousel-dark-indicator-active-bg;
  193. }
  194. .carousel-caption {
  195. color: $carousel-dark-caption-color;
  196. }
  197. }