1
0
Fork 0
mirror of https://github.com/twbs/bootstrap.git synced 2022-11-09 12:25:43 -05:00
twbs--bootstrap/less/carousel.less
2012-09-26 11:20:27 -07:00

142 lines
2.2 KiB
Text

//
// Carousel
// --------------------------------------------------
.carousel {
position: relative;
margin-bottom: @baseLineHeight;
line-height: 1;
}
.carousel-inner {
position: relative;
overflow: hidden;
width: 100%;
}
.carousel {
.item {
display: none;
position: relative;
.transition(.6s ease-in-out left);
}
// Account for jankitude on images
.item > 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: 100px;
.opacity(50);
&.left {
#gradient > .horizontal(rgba(0,0,0,.75), rgba(0,0,0,.001));
background-color: transparent;
}
// 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);
// Reposition the right one
&.right {
left: auto;
right: 0;
#gradient > .horizontal(rgba(0,0,0,.001), rgba(0,0,0,.75));
background-color: transparent;
}
// Hover state
&:hover {
color: @white;
text-decoration: none;
.opacity(90);
}
}
.carousel-control .control {
position: absolute;
top: 50%;
z-index: 5;
display: block;
margin-top: -35px;
margin-left: 35px;
font-size: 80px;
font-weight: 100;
color: #fff;
text-shadow: 0 1px 2px rgba(0,0,0,.6);
}
// Caption for text below images
// -----------------------------
.carousel-caption {
position: absolute;
left: 0;
right: 0;
bottom: 0;
z-index: 10;
padding: 40px;
text-shadow: 0 1px 2px rgba(0,0,0,.6);
max-width: 60%;
}
.carousel-caption h3,
.carousel-caption p {
color: @white;
line-height: @baseLineHeight;
}
.carousel-caption h3 {
margin: 0 0 5px;
}
.carousel-caption p {
margin-bottom: 0;
}