 Hey everyone, Sam here. This is a quick web series about solving web problems with standards. These tips are part of the platform and work with any framework or library. These are quick tips. Let's go. Mobile devices, like the ones I have here, have physical sensors that might be useful if you're building HTML games or more integrated experiences. Let's find out how to use them the standard way. The most simple use case is for us to check the device's discrete orientation. The browser will emit events when the device's screen is rotated. This is the orientation change event, and it will fire when the display rotates from landscape to portrait. To find out what orientation you're in, there's actually not really a standard API. It's actually best to just compare the width to the height. If it's greater, then your user's browser is in landscape mode. But what if you want finer information on the device's position? Recently, I built a game, and I wanted finer detail about the current orientation. For that, you can listen to the device orientation event. It gives just three values, alpha, beta, and gamma. For this game, we care about the gamma property as it represents side-to-side motion. Check out my article to find out more about the different axes. We can also measure acceleration. This might be useful for gestures. For example, imagine shaking your phone to clear a form. You can get this information with the device motion event, which has properties like acceleration and rotation. The gyroscope is very powerful. It can give you orientation and acceleration, and can even give you the compass direction. I go deeper in my article, so you should check it out. So remember, use orientation change to listen to the screen's orientation and the device events to listen for fine detail on the device's orientation and acceleration. That was the gyroscope, the standard way. See you on the next tip. Yeah, I know. I'm trying to force myself not to have any selection.