Skip to content

jonastreub/DeviceOrientationManager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

DeviceOrientationManager

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.

Example

  • Compass (uses compassHeading, only works on mobile)
  • WaveReader (uses heading, only works on mobile)

Properties

  • 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

Functions

  • DeviceOrientationManager.available() returns <bool>

Events

  • onOrientationChange (data {heading, elevation, tilt, compassHeading, alpha, beta, gamma})
orientationManager.onOrientationChange (data) ->
	heading = data.heading
	elevation = data.elevation
	tilt = data.tilt

Releases

No releases published

Packages

No packages published