vanilla-tilt.js
vanilla-tilt.js copied to clipboard
Provide scroll as alternative to gyro
Because browser vendors now expose the device's orientation only when the user has granted permission (and I'm not sure but I think - like with other APIs - you can only ask permissions based on a user-initiated action, like a click listener?) then could we maybe have the option to tilt based on a scroll position?
I'd imagine this to be useful for marketing/landing pages, where you'd want a tilt effect on mobile devices, but can't presume a user to click anything before (so we'd have access to the rotation events) 🤔
Related: https://github.com/w3c/deviceorientation/issues/57
I've just refresh this on my Android in Chrome and it worked ok. I didn't have time to document on the subject lately.