From dc2deb9a1b1995bbabee91bfd579d9b466fe78f2 Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Thu, 26 Jan 2012 21:48:46 -0800 Subject: moving structure around + more work on builder... --- less/carousel.less | 114 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 less/carousel.less (limited to 'less/carousel.less') diff --git a/less/carousel.less b/less/carousel.less new file mode 100644 index 000000000..254a9f60c --- /dev/null +++ b/less/carousel.less @@ -0,0 +1,114 @@ +// CAROUSEL +// -------- + +.carousel { + position: relative; + line-height: 1; +} + +.carousel-inner { + overflow: hidden; + width: 100%; + position: relative; +} + +.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: 40%; + left: 15px; + width: 40px; + height: 40px; + margin-top: -20px; + font-size: 60px; + font-weight: 100; + line-height: 30px; + color: @white; + text-align: center; + background: @grayDarker; + border: 3px solid @white; + .border-radius(23px); + .opacity(50); + .transition(all .2s linear); + + // Reposition the right one + &.right { + left: auto; + right: 15px; + } + + // Hover state + &:hover { + color: @white; + text-decoration: none; + .opacity(90); + } +} + +// Caption for text below images +// ----------------------------- + +.carousel-caption { + position: absolute; + left: 0; + right: 0; + bottom: 0; + padding: 10px 15px 5px; + background: @grayDark; + background: rgba(0,0,0,.75); +} +.carousel-caption h4, +.carousel-caption p { + color: @white; +} -- cgit v1.2.3 From 6493cd22c0c72c60354ebbd6d7887bcbbf4e263a Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Sat, 28 Jan 2012 15:14:57 -0800 Subject: blah --- less/carousel.less | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'less/carousel.less') diff --git a/less/carousel.less b/less/carousel.less index 254a9f60c..4163b069f 100644 --- a/less/carousel.less +++ b/less/carousel.less @@ -26,15 +26,15 @@ line-height: 1; } - .active, - .next, + .active, + .next, .prev { display: block; } .active { left: 0; } - .next, + .next, .prev { position: absolute; top: 0; @@ -47,7 +47,7 @@ .prev { left: -100%; } - .next.left, + .next.left, .prev.right { left: 0; } @@ -80,7 +80,13 @@ border: 3px solid @white; .border-radius(23px); .opacity(50); - .transition(all .2s linear); + + // 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 { -- cgit v1.2.3 From ac581eebac209ce20591bac2f726f35a9b22d750 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Mon, 30 Jan 2012 09:19:25 -0800 Subject: large carousel images and margin bottom added --- less/carousel.less | 1 + 1 file changed, 1 insertion(+) (limited to 'less/carousel.less') diff --git a/less/carousel.less b/less/carousel.less index 4163b069f..8fbd30315 100644 --- a/less/carousel.less +++ b/less/carousel.less @@ -3,6 +3,7 @@ .carousel { position: relative; + margin-bottom: @baseLineHeight; line-height: 1; } -- cgit v1.2.3