From dbba815cd91bc275dc019cd2f55d443ed68f97a1 Mon Sep 17 00:00:00 2001 From: "selvaganesh.b" Date: Wed, 29 Jul 2015 01:05:10 +0530 Subject: [PATCH] Make it a rich demo --- addon/services/carousel.js | 6 ++- addon/styles/carousel.css | 1 + tests/dummy/app/styles/app.css | 53 +++++++++++++++++++++++ tests/dummy/app/templates/application.hbs | 43 ++++++++++-------- 4 files changed, 82 insertions(+), 21 deletions(-) diff --git a/addon/services/carousel.js b/addon/services/carousel.js index 3f5c9f5..611f02f 100644 --- a/addon/services/carousel.js +++ b/addon/services/carousel.js @@ -21,8 +21,10 @@ export default Ember.Service.extend({ var activeCarouselItem = this.get('activeCarouselItem'); var newActiveCarouselItem = carouselItems[newActiveIndex]; - activeCarouselItem.set('from', direction); - newActiveCarouselItem.set('from', direction); + run(function() { + activeCarouselItem.set('from', direction); + newActiveCarouselItem.set('from', direction); + }); run.later(function() { activeCarouselItem.set('slidingOut', true); diff --git a/addon/styles/carousel.css b/addon/styles/carousel.css index b39e0eb..759f037 100644 --- a/addon/styles/carousel.css +++ b/addon/styles/carousel.css @@ -1,4 +1,5 @@ .carousel-container { + position: relative; overflow: hidden; display: block; } diff --git a/tests/dummy/app/styles/app.css b/tests/dummy/app/styles/app.css index 4b74639..9e45c70 100644 --- a/tests/dummy/app/styles/app.css +++ b/tests/dummy/app/styles/app.css @@ -4,6 +4,9 @@ body { margin: 0; + font-family: "Helvetica Neue",Helvetica,Arial,sans-serifsans-serif; + color: #fff; + font-weight: 300; } html, body { @@ -21,6 +24,24 @@ html, body { margin-top: 50px; } +.image-credits { + margin-top: 10px; + text-align: center; +} + +h2 { + font-weight: 300; +} + +a { + color: #8FBECC; + text-decoration: none; +} + +.text-center { + text-align: center; +} + /* For Carousel Component */ .carousel-body { @@ -71,3 +92,35 @@ html, body { position: relative; left: 0; } + +/* Arrows */ +/* Taken from http://codepen.io/trongthanh/pen/uvzxa */ +.line-arrow { + position: absolute; + overflow: hidden; + display: inline-block; + font-size: 12px; + width: 40px; + height: 40px; + margin-top: -20px; + top: 50%; + cursor: pointer; +} + +.line-arrow.left { + border-top: 2px solid #a9a9a9; + border-left: 2px solid #a9a9a9; + transform: rotate(-54deg) skew(-20deg); + left: 20px; +} + +.line-arrow.right { + border-top: 2px solid #a9a9a9; + border-right: 2px solid #a9a9a9; + transform: rotate(54deg) skew(20deg); + right: 20px; +} + +.line-arrow.left:hover, .line-arrow.right:hover { + border-color: #444; +} diff --git a/tests/dummy/app/templates/application.hbs b/tests/dummy/app/templates/application.hbs index 10b673e..3289051 100644 --- a/tests/dummy/app/templates/application.hbs +++ b/tests/dummy/app/templates/application.hbs @@ -1,21 +1,26 @@ -{{#carousel-container classNames="demo-carousel"}} - {{#carousel-body}} - {{#carousel-item}} - - {{/carousel-item}} - {{#carousel-item}} - - {{/carousel-item}} - {{#carousel-item}} - - {{/carousel-item}} - {{/carousel-body}} +