|
1 // |
|
2 // Carousel |
|
3 // -------------------------------------------------- |
|
4 |
|
5 |
|
6 // Wrapper for the slide container and indicators |
|
7 .carousel { |
|
8 position: relative; |
|
9 } |
|
10 |
|
11 .carousel-inner { |
|
12 position: relative; |
|
13 overflow: hidden; |
|
14 width: 100%; |
|
15 |
|
16 > .item { |
|
17 display: none; |
|
18 position: relative; |
|
19 .transition(.6s ease-in-out left); |
|
20 |
|
21 // Account for jankitude on images |
|
22 > img, |
|
23 > a > img { |
|
24 &:extend(.img-responsive); |
|
25 line-height: 1; |
|
26 } |
|
27 |
|
28 // WebKit CSS3 transforms for supported devices |
|
29 @media all and (transform-3d), (-webkit-transform-3d) { |
|
30 transition: transform .6s ease-in-out; |
|
31 backface-visibility: hidden; |
|
32 perspective: 1000; |
|
33 |
|
34 &.next, |
|
35 &.active.right { |
|
36 transform: translate3d(100%, 0, 0); |
|
37 left: 0; |
|
38 } |
|
39 &.prev, |
|
40 &.active.left { |
|
41 transform: translate3d(-100%, 0, 0); |
|
42 left: 0; |
|
43 } |
|
44 &.next.left, |
|
45 &.prev.right, |
|
46 &.active { |
|
47 transform: translate3d(0, 0, 0); |
|
48 left: 0; |
|
49 } |
|
50 } |
|
51 } |
|
52 |
|
53 > .active, |
|
54 > .next, |
|
55 > .prev { |
|
56 display: block; |
|
57 } |
|
58 |
|
59 > .active { |
|
60 left: 0; |
|
61 } |
|
62 |
|
63 > .next, |
|
64 > .prev { |
|
65 position: absolute; |
|
66 top: 0; |
|
67 width: 100%; |
|
68 } |
|
69 |
|
70 > .next { |
|
71 left: 100%; |
|
72 } |
|
73 > .prev { |
|
74 left: -100%; |
|
75 } |
|
76 > .next.left, |
|
77 > .prev.right { |
|
78 left: 0; |
|
79 } |
|
80 |
|
81 > .active.left { |
|
82 left: -100%; |
|
83 } |
|
84 > .active.right { |
|
85 left: 100%; |
|
86 } |
|
87 |
|
88 } |
|
89 |
|
90 // Left/right controls for nav |
|
91 // --------------------------- |
|
92 |
|
93 .carousel-control { |
|
94 position: absolute; |
|
95 top: 0; |
|
96 left: 0; |
|
97 bottom: 0; |
|
98 width: @carousel-control-width; |
|
99 .opacity(@carousel-control-opacity); |
|
100 font-size: @carousel-control-font-size; |
|
101 color: @carousel-control-color; |
|
102 text-align: center; |
|
103 text-shadow: @carousel-text-shadow; |
|
104 // We can't have this transition here because WebKit cancels the carousel |
|
105 // animation if you trip this while in the middle of another animation. |
|
106 |
|
107 // Set gradients for backgrounds |
|
108 &.left { |
|
109 #gradient > .horizontal(@start-color: rgba(0,0,0,.5); @end-color: rgba(0,0,0,.0001)); |
|
110 } |
|
111 &.right { |
|
112 left: auto; |
|
113 right: 0; |
|
114 #gradient > .horizontal(@start-color: rgba(0,0,0,.0001); @end-color: rgba(0,0,0,.5)); |
|
115 } |
|
116 |
|
117 // Hover/focus state |
|
118 &:hover, |
|
119 &:focus { |
|
120 outline: 0; |
|
121 color: @carousel-control-color; |
|
122 text-decoration: none; |
|
123 .opacity(.9); |
|
124 } |
|
125 |
|
126 // Toggles |
|
127 .icon-prev, |
|
128 .icon-next, |
|
129 .glyphicon-chevron-left, |
|
130 .glyphicon-chevron-right { |
|
131 position: absolute; |
|
132 top: 50%; |
|
133 z-index: 5; |
|
134 display: inline-block; |
|
135 } |
|
136 .icon-prev, |
|
137 .glyphicon-chevron-left { |
|
138 left: 50%; |
|
139 margin-left: -10px; |
|
140 } |
|
141 .icon-next, |
|
142 .glyphicon-chevron-right { |
|
143 right: 50%; |
|
144 margin-right: -10px; |
|
145 } |
|
146 .icon-prev, |
|
147 .icon-next { |
|
148 width: 20px; |
|
149 height: 20px; |
|
150 margin-top: -10px; |
|
151 font-family: serif; |
|
152 } |
|
153 |
|
154 |
|
155 .icon-prev { |
|
156 &:before { |
|
157 content: '\2039';// SINGLE LEFT-POINTING ANGLE QUOTATION MARK (U+2039) |
|
158 } |
|
159 } |
|
160 .icon-next { |
|
161 &:before { |
|
162 content: '\203a';// SINGLE RIGHT-POINTING ANGLE QUOTATION MARK (U+203A) |
|
163 } |
|
164 } |
|
165 } |
|
166 |
|
167 // Optional indicator pips |
|
168 // |
|
169 // Add an unordered list with the following class and add a list item for each |
|
170 // slide your carousel holds. |
|
171 |
|
172 .carousel-indicators { |
|
173 position: absolute; |
|
174 bottom: 10px; |
|
175 left: 50%; |
|
176 z-index: 15; |
|
177 width: 60%; |
|
178 margin-left: -30%; |
|
179 padding-left: 0; |
|
180 list-style: none; |
|
181 text-align: center; |
|
182 |
|
183 li { |
|
184 display: inline-block; |
|
185 width: 10px; |
|
186 height: 10px; |
|
187 margin: 1px; |
|
188 text-indent: -999px; |
|
189 border: 1px solid @carousel-indicator-border-color; |
|
190 border-radius: 10px; |
|
191 cursor: pointer; |
|
192 |
|
193 // IE8-9 hack for event handling |
|
194 // |
|
195 // Internet Explorer 8-9 does not support clicks on elements without a set |
|
196 // `background-color`. We cannot use `filter` since that's not viewed as a |
|
197 // background color by the browser. Thus, a hack is needed. |
|
198 // |
|
199 // For IE8, we set solid black as it doesn't support `rgba()`. For IE9, we |
|
200 // set alpha transparency for the best results possible. |
|
201 background-color: #000 \9; // IE8 |
|
202 background-color: rgba(0,0,0,0); // IE9 |
|
203 } |
|
204 .active { |
|
205 margin: 0; |
|
206 width: 12px; |
|
207 height: 12px; |
|
208 background-color: @carousel-indicator-active-bg; |
|
209 } |
|
210 } |
|
211 |
|
212 // Optional captions |
|
213 // ----------------------------- |
|
214 // Hidden by default for smaller viewports |
|
215 .carousel-caption { |
|
216 position: absolute; |
|
217 left: 15%; |
|
218 right: 15%; |
|
219 bottom: 20px; |
|
220 z-index: 10; |
|
221 padding-top: 20px; |
|
222 padding-bottom: 20px; |
|
223 color: @carousel-caption-color; |
|
224 text-align: center; |
|
225 text-shadow: @carousel-text-shadow; |
|
226 & .btn { |
|
227 text-shadow: none; // No shadow for button elements in carousel-caption |
|
228 } |
|
229 } |
|
230 |
|
231 |
|
232 // Scale up controls for tablets and up |
|
233 @media screen and (min-width: @screen-sm-min) { |
|
234 |
|
235 // Scale up the controls a smidge |
|
236 .carousel-control { |
|
237 .glyphicon-chevron-left, |
|
238 .glyphicon-chevron-right, |
|
239 .icon-prev, |
|
240 .icon-next { |
|
241 width: 30px; |
|
242 height: 30px; |
|
243 margin-top: -15px; |
|
244 font-size: 30px; |
|
245 } |
|
246 .glyphicon-chevron-left, |
|
247 .icon-prev { |
|
248 margin-left: -15px; |
|
249 } |
|
250 .glyphicon-chevron-right, |
|
251 .icon-next { |
|
252 margin-right: -15px; |
|
253 } |
|
254 } |
|
255 |
|
256 // Show and left align the captions |
|
257 .carousel-caption { |
|
258 left: 20%; |
|
259 right: 20%; |
|
260 padding-bottom: 30px; |
|
261 } |
|
262 |
|
263 // Move up the indicators |
|
264 .carousel-indicators { |
|
265 bottom: 20px; |
|
266 } |
|
267 } |