// // Carousel // -------------------------------------------------- // Wrapper for the slide container and indicators .carousel { position: relative; line-height: 1; } // 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: 120px; .opacity(50); // 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,.001)); background-color: transparent; } &.right { left: auto; right: 0; #gradient > .horizontal(rgba(0,0,0,.001), rgba(0,0,0,.5)); background-color: transparent; } // Hover/focus state &:hover, &:focus { color: #fff; text-decoration: none; .opacity(90); } // Toggles .carousel-control .glyphicon-chevron-left, .carousel-control .glyphicon-chevron-right { position: absolute; top: 50%; z-index: 5; display: inline-block; width: 20px; height: 20px; margin-top: -10px; margin-left: 20px; font-size: 20px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); } .carousel-control .glyphicon-chevron-right { margin-left: 80px; } } // Carousel indicator pips // ----------------------------- .carousel-indicators { position: absolute; bottom: 15px; 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; } } // Scale up controls for >768px @media screen and (min-width: 768px) { .carousel-control .glyphicon-chevron-left, .carousel-control .glyphicon-chevron-right { width: 30px; height: 30px; margin-top: -15px; margin-left: 30px; font-size: 30px; } .carousel-control .glyphicon-chevron-right { margin-left: 70px; } }