Cover Image Credit:https://unsplash.com/photos/uCPHkM2bnaIhttps://trekhleb.dev/blog/2021/gyro-web/In Javascript you may access your device orientation data by listening to the deviceorientation event. It is as easy as the following:12345678window.addEventListener("deviceorientation", handleOrientation);functionhandleOrientation(event) {constalpha = event.alpha;constbeta = event.beta;constgamma = event.gamma;// Do stuff...}This Demo Can Be Visited In HereThe demo video was compressed byhttps://clideo.com/from 4.3MB to 93KB, that’s impressive.To achieve the effect above, we need to dis
...
继续阅读
(71)