Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | Ultima modificación | Ver Log |

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