/** * @copyright 2010-2013, The Titon Project * @license http://opensource.org/licenses/bsd-license.php * @link http://titon.io */ @import "../common"; .#{$vendor-prefix}carousel { margin: 0 auto; text-align: left; position: relative; } .#{$vendor-prefix}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; } } } } .#{$vendor-prefix}carousel-caption { position: absolute; bottom: 0; left: 0; width: 100%; padding: $padding; color: #fff; background: black(.7); @include in-small { @include size-small; } } .#{$vendor-prefix}carousel-prev, .#{$vendor-prefix}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; } } .#{$vendor-prefix}carousel-prev { left: 0; } .#{$vendor-prefix}carousel-next { right: 0; } .#{$vendor-prefix}carousel-tabs { position: absolute; top: $padding; left: 50%; z-index: 5; @include transform(translateX(-50%)); // move left 50% of their width } //-------------------- Animations --------------------// .#{$vendor-prefix}carousel.slide { .#{$vendor-prefix}carousel-items ul { @include clear-fix; > li { float: left; } } } .#{$vendor-prefix}carousel.fade { .#{$vendor-prefix}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: 5; } } } } //-------------------- Modifiers --------------------// .#{$vendor-prefix}carousel--wide { @extend .#{$vendor-prefix}carousel; .#{$vendor-prefix}carousel-items { /* 16:9 ratio */ padding-bottom: 56.25%; } } .#{$vendor-prefix}carousel--square { @extend .#{$vendor-prefix}carousel; .#{$vendor-prefix}carousel-items { /* 1:1 ratio */ padding-bottom: 100%; } }