/** * @copyright 2010-2013, The Titon Project * @license http://opensource.org/licenses/bsd-license.php * @link http://titon.io */ @import "../common"; .carousel { margin: 0 auto; text-align: left; position: relative; } .carousel-items { /* 4:3 ratio */ padding-bottom: 75%; width: 100%; max-width: 100%; overflow: hidden; position: relative; ul { position: absolute; list-style: none; margin: 0; padding: 0; top: 0; left: 0; @include transition(left $carousel-transition, top $carousel-transition); > li { width: 100%; height: auto; position: relative; > img { display: block; width: 100%; max-width: 100%; height: auto; } } } } .carousel-caption { position: absolute; bottom: 0; left: 0; width: 100%; padding: $padding; color: #fff; background: black(.7); @include in-small { @include size-small; } } .carousel-prev, .carousel-next { display: block; position: absolute; padding: $padding; width: auto; height: auto; z-index: 5; top: 50%; @include transform(translateY(-50%)); // move up 50% of their height &:focus { outline: none; } } .carousel-prev { left: 0; } .carousel-next { right: 0; } .carousel-tabs { position: absolute; top: $padding; left: 50%; z-index: 5; @include transform(translateX(-50%)); // move left 50% of their width } //-------------------- Animations --------------------// .carousel.slide { .carousel-items ul { @include clear-fix; > li { float: left; } } } .carousel.fade { .carousel-items ul { position: relative; > li { position: absolute; top: 0; left: 0; opacity: 0; z-index: 1; @include transition(opacity $carousel-transition); &.show { z-index: 2; } } } } //-------------------- Modifiers --------------------// .carousel--wide { @extend .carousel; .carousel-items { /* 16:9 ratio */ padding-bottom: 56.25%; } } .carousel--square { @extend .carousel; .carousel-items { /* 1:1 ratio */ padding-bottom: 100%; } }