kthoom icon indicating copy to clipboard operation
kthoom copied to clipboard

Use Sensor API to automatically detect orientation

Open codedread opened this issue 3 years ago • 3 comments

... or equivalent. Research to do:

https://web.dev/generic-sensor/ https://w3c.github.io/gyroscope/#gyroscope-interface https://developer.mozilla.org/en-US/docs/Web/API/AbsoluteOrientationSensor#permissions_example https://caniuse.com/?search=sensor%20api

codedread avatar Aug 13 '22 16:08 codedread

A quick test shows that AbsoluteOrientationSensor does not exist on a Macbook Pro. I may be the only human on the planet that reads comics on a laptop in portrait mode, but I'd still want to support this feature on desktop, if possible.

https://stackoverflow.com/questions/73346042/is-it-possible-to-get-the-orientation-of-a-macbook-pro

codedread avatar Aug 13 '22 16:08 codedread

More research:

  • https://sensor-js.xyz/demo.html
  • https://developer.mozilla.org/en-US/docs/Web/API/Window/deviceorientation_event

codedread avatar Aug 13 '22 16:08 codedread

Chrome doesn't surface this on a Macbook Pro. I have one question out there so far:

https://stackoverflow.com/questions/73346042/is-it-possible-to-get-the-orientation-of-a-macbook-pro?noredirect=1#comment129528992_73346042

codedread avatar Aug 24 '22 20:08 codedread