Last active
October 3, 2018 13:24
-
-
Save dhindurthy/bfdc431a8921a1a65bf4018ddefbf1bb to your computer and use it in GitHub Desktop.
carousel-declarative
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
import Component from '@ember/component'; | |
export default Component.extend({ | |
classNames: 'carousel', | |
photos: null, // passed in | |
actions: { | |
moveLeft() { | |
let container = this.$('.carousel-viewport'); | |
let current = +container.css('transform').replace(/[^0-9\-.,]/g, '').split(',')[4]; | |
let shifted = current + 1056; | |
container.css('transform', `translate(${shifted}px)`); | |
}, | |
moveRight() { | |
let container = this.$('.carousel-viewport'); | |
let current = +container.css('transform').replace(/[^0-9\-.,]/g, '').split(',')[4]; | |
let shifted = current - 1056; | |
container.css('transform', `translate(${shifted}px)`); | |
} | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
photosList:[ "https://www.emberjs.com/images/tomsters/chicago-tomster-ccd89463.png","https://www.emberjs.com/images/tomsters/a11y-tomster-75779620.png"] | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Route.extend({ | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
margin: 12px 16px; | |
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; | |
font-size: 12pt; | |
} | |
.carousel-image { | |
height: 300px; | |
width: 400px; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.15.0", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js", | |
"ember": "3.2.2", | |
"ember-template-compiler": "3.2.2", | |
"ember-testing": "3.2.2", | |
"ember-font-awesome": "https://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" | |
}, | |
"addons": { | |
"ember-data": "3.2.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment