DEV Community

Cover image for Screen Orientantation API Byte Challenge
Satyadev Moolagani
Satyadev Moolagani

Posted on

Screen Orientantation API Byte Challenge

This is a submission for DEV Challenge v24.03.20, One Byte Explainer: Browser API or Feature.

Explainer

Screen Orientation API helps webpages adapt to your device's tilt! It detects the tilt of the screen in degrees (0, 90, 180, or 270) and lets the site adjust its layout accordingly.

Additional Context

Imagine building a mobile game. You want the playing field to stretch across the width of the screen in landscape mode, but stack vertically in portrait mode. The Screen Orientation API lets you detect the switch and automatically adjust the layout for an optimal experience on any tilt!

Top comments (0)