Share Posted November 13, 2015 Hi All, Starting from 0 here. My boss has asked if a GSAP HTML5 Banner that use Smartphone Accelerometer is possible. The idea would be that i multilayered image with a foreground, mid-ground and background would 'move' with the tilt on a smartphone. Can anyone point me in the right direction? Thanks for any help, Phil Link to comment Share on other sites More sharing options...
Author Share Posted November 13, 2015 Replying to my own topic! Is something like this the smartest way to do it? http://matthew.wagerfield.com/parallax/ Link to comment Share on other sites More sharing options...
Share Posted November 13, 2015 I've never done it personally, but it seems totally doable. It's unrelated to GSAP, though. A quick Google search resulted in: http://stackoverflow.com/questions/4378435/how-to-access-accelerometer-gyroscope-data-from-javascript With the right hooks in place, you should be able to create the effect you're after. Let us know how it goes. We'd love to see the final result (and hear about any tips and tricks you discover along the way) 1 Link to comment Share on other sites More sharing options...
Share Posted November 13, 2015 Here are some other useful links that might help. It's just setting up the right events to detect and have your animation with GSAP do different stuff depending on the orientation and rotation. Detecting Device Orientation: https://developer.mozilla.org/en-US/docs/Web/API/Detecting_device_orientation Google HTML5 Rocks - This End Up: Using Device Orientation: http://www.html5rocks.com/en/tutorials/device/orientation/ Device Motion Demo (test on mobile): http://www.html5rocks.com/en/tutorials/device/orientation/devicemotionsample.html 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now