Not TestedTesting not done, may not work properly
Device & Sensors

Device Orientation

Detect physical orientation tilt angles (alpha, beta, gamma).

Checking support...
Advertisement

Interactive Input Workspace

Ready for input

Web API Execution Output

Result output will be displayed here after processing...

Native JavaScript Code Example (Zero Libraries)

window.addEventListener('deviceorientation', (e) => {
  console.log(e.alpha, e.beta, e.gamma);
});

About the Device Orientation Web API

DeviceOrientationEvent provides information about the physical orientation of the device.

Specification:W3C & WHATWG Web API Standard
Sponsored Content