Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
language: node_js
node_js:
- 4.2.6
- 4.8.0
24 changes: 20 additions & 4 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,29 @@
<body>

<header>
<div class="[ c-example__tilt ] js-tilt" data-tilt-axis="x" data-tilt-glare="true" data-tilt-perspective="1000" data-tilt-scale="1" data-tilt-speed="400" data-tilt-max="10">
<h1 id="data-report" style="position:absolute; top:0; left:0;"></h1>
<div class="[ c-example__tilt ] js-tilt" data-tilt-glare="true" data-tilt-perspective="1000" data-tilt-scale="1" data-tilt-speed="400" data-tilt-max="10">
<div class="c-example__tilt-inner"></div>
</div>
<script src="./../node_modules/jquery/dist/jquery.slim.min.js"></script>
<script src="./../dest/tilt.jquery.js"></script>
</header>

<script src="../node_modules/jquery/dist/jquery.slim.min.js"></script>
<script src="../dest/tilt.jquery.js"></script>
<script>
const tilt = $('.js-tilt').tilt();

//show accelerometer readings
const deviceMotionHandler = function(event) {
var accX = Math.round(event.accelerationIncludingGravity.x * 10) / 10;
var accY = Math.round(event.accelerationIncludingGravity.y * 10) / 10;
var newX = (accX / 10);
var newY = (accY / 10);

$("#data-report").html(`x: ${newX.toFixed(2)} y: ${newY.toFixed(2)}`);
this.phonePositions = {x: newX, y: newY};
};
window.addEventListener('devicemotion', deviceMotionHandler, false);

$('.js-destroy').on('click', function () {
const element = $(this).closest('.js-parent').find('.js-tilt');
element.tilt.destroy.call(element);
Expand Down Expand Up @@ -47,4 +62,5 @@
});*/
</script>
</body>
</html>
</html>

60 changes: 51 additions & 9 deletions dest/tilt.jquery.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dest/tilt.jquery.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dest/tilt.jquery.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"postcss-reporter": "1.3.3",
"postcss-scss": "0.1.8",
"qunitjs": "^2.0.1",
"require-dir": "0.3.0"
"require-dir": "0.3.2"
},
"dependencies": {
"jquery": "^3.1.1"
Expand Down
Loading