1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
|
//
// Carousel
// --------------------------------------------------
// Wrapper for the slide container and indicators
.carousel {
position: relative;
}
// Wrap all slides, but only show the active one
.carousel-inner {
position: relative;
overflow: hidden;
width: 100%;
}
// Immediate parent of all slides
.carousel-inner {
> .item {
display: none;
position: relative;
.transition(.6s ease-in-out left);
// Account for jankitude on images
> img,
> a > img {
display: block;
line-height: 1;
}
}
> .active,
> .next,
> .prev { display: block; }
> .active {
left: 0;
}
> .next,
> .prev {
position: absolute;
top: 0;
width: 100%;
}
> .next {
left: 100%;
}
> .prev {
left: -100%;
}
> .next.left,
> .prev.right {
left: 0;
}
> .active.left {
left: -100%;
}
> .active.right {
left: 100%;
}
}
// Left/right controls for nav
// ---------------------------
.carousel-control {
position: absolute;
top: 0;
left: 0;
bottom: 0;
width: 15%;
.opacity(.5);
font-size: 20px;
color: #fff;
text-align: center;
text-shadow: 0 1px 2px rgba(0,0,0,.6);
// we can't have this transition here
// because webkit cancels the carousel
// animation if you trip this while
// in the middle of another animation
// ;_;
// .transition(opacity .2s linear);
// Set gradients for backgrounds
&.left {
#gradient > .horizontal(rgba(0,0,0,.5), rgba(0,0,0,.0001));
background-color: transparent;
}
&.right {
left: auto;
right: 0;
#gradient > .horizontal(rgba(0,0,0,.0001), rgba(0,0,0,.5));
background-color: transparent;
}
// Hover/focus state
&:hover,
&:focus {
color: #fff;
text-decoration: none;
.opacity(.9);
}
// Toggles
.glyphicon {
position: absolute;
top: 50%;
left: 50%;
z-index: 5;
display: inline-block;
width: 20px;
height: 20px;
margin-top: -10px;
margin-left: -10px;
}
}
// Optional indicator pips
// -----------------------------
.carousel-indicators {
position: absolute;
bottom: 20px;
left: 50%;
z-index: 5;
width: 100px;
margin: 0 0 0 -50px;
list-style: none;
text-align: center;
li {
display: inline-block;
width: 8px;
height: 8px;
margin-left: 0;
margin-right: 0;
text-indent: -999px;
border: 1px solid #fff;
border-radius: 5px;
cursor: pointer;
}
.active {
background-color: #fff;
}
}
// Optional captions
// -----------------------------
// Hidden by default for smaller viewports
.carousel-caption {
position: absolute;
left: 20%;
right: 20%;
bottom: 20px;
display: none;
padding-top: 20px;
padding-bottom: 20px;
color: #fff;
text-shadow: 0 1px 2px rgba(0,0,0,.6);
}
// Scale up controls for >768px
@media screen and (min-width: 768px) {
// Scale up the controls a smidge
.carousel-control .glyphicon {
width: 30px;
height: 30px;
margin-top: -15px;
margin-left: -15px;
font-size: 30px;
}
// Show and left align the captions
.carousel-caption {
left: 0;
right: 0;
z-index: 10;
display: block;
max-width: 60%;
padding: 30px;
margin-left: 0;
margin-right: 0;
}
}
|