Skip to content

Comment on Show HN: An HTML endless runner under 900 lines without frameworks or libraries

Comments

A few people have asked via Discord why I chose to use `DeviceOrientationEvent`. As far as I can tell, it's the most supported accelerometer API. A cursory [Can I Use](https://caniuse.com/?search=DeviceOrientation) search is misleading because a few search entries combine `DeviceOrientation` and `DeviceMotion` APIs and because earlier versions of the API also have entries. If you search for [DeviceOrientationEvent](https://caniuse.com/?search=DeviceOrientationEvent) itself, you will see it's quite well supported. Mobile Firefox doesn't work, but I haven't been able to get any accelerometer API working on Firefox. The only issues I've really run into is that many Androids you'd expect to have accelerometers don't and that there isn't a canonical "up" for Android landscape like there is on iPhone (lock button is up). I was able to get the top negative reviewer up and running after realizing that he just had to turn his phone the other way around.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.