Useful device orientation data for Framer prototypes. Find out what direction the user is facing and point them in the right direction. If you are interested in Virtual Reality you should check out the VRComponent.
- Compass (uses
compassHeading
, only works on mobile) - WaveReader (uses
heading
, only works on mobile)
heading
<number> readonly (0 to 360 degrees)elevation
<number> readonly (90 to -90 degrees)tilt
<number> readonly (180 to -180 degrees)compassHeading
<number> readonly (0 to 360 degrees)alpha
<number> readonly (0 to 360 degrees)beta
<number> readonly (180 to -180 degrees)gamma
<number> readonly (90 to -90 degrees)
# Include the DeviceOrientationManager
{DeviceOrientationManager} = require "DeviceOrientationManager"
orientationManager = new DeviceOrientationManager
- DeviceOrientationManager.
available()
returns <bool>
onOrientationChange
(data {heading, elevation, tilt, compassHeading, alpha, beta, gamma})
orientationManager.onOrientationChange (data) ->
heading = data.heading
elevation = data.elevation
tilt = data.tilt