Device orientation --> Change element position


(Martin C.) #1

Hi there,
I would like to make sort of parallax (not scrolling parallax, but more like parallax.js). Based on the script given by @DBear (Mousemove / screen tilt --> change opacity), I did the project position.hype.zip (622.3 KB)
Which is near what I want to have for the X axis of the picture. I still need to add the Y.
But before going on, I need to solve an issue: when I tilt the phone (tilting around gamma), it works fine. But when I turn the phone to landscape (rotating around alpha), the values need to switch so the gamma would become Beta, to get the same experience… Would you have some clues to help me ? THANK YOU !


Device orientation