Gyrollax
Add depth to your pages using device sensors and the parallax effect.
Installation
npm install gyrollax --save
Usage
Add data-z and data-back-z attributes to the elements you want to transform in space. The former will translate the actual element itself, whereas the later will translate its background. Therefore, elements need an actual background for data-back-z to work.
Screen level Floating above Almost touching you... I'm behind the screen! Even further behind!
// Augment all elements on the page with the 'data-z' and 'data-back-z' attributes setgyrollaxify();// Or instantiate a tilt provider and listen to its events directlySmoothTiltProvider().start(function(tiltX, tiltY) {});
License
MIT