A Flight component for device orientation.
bower install --save flight-orientation
define(['flight-orientation'], function(Orientation) {
Orientation.attachTo(document);
// Listen for device orientation updates
$(document).on('orientation-update', function(e, orientation) {
console.log(e, orientation);
});
// Listen for device support
$(document).on('orientation-supported', function() {
console.log('Device supports orientation!');
});
// Listen for unsupported devices
$(document).on('orientation-unsupported', function() {
console.log('Device doesn't support orientation :(');
});
});
Development of this component needs Bower, and ideally Karma to be globally installed:
npm install -g bower karma
Then install the Node.js and client-side dependencies by running the following commands in the repo's root directory.
npm install
bower install
To continuously run the tests in Chrome and Firefox during development, just run:
karma start
Anyone and everyone is welcome to contribute. Please take a moment to review the guidelines for contributing.