This information cannot be obtained from a website.
The resolution on a smartphone when browsing a website will in many cases be that of the screen itself, as such there is no change to the value between portrait and landscape mode. In some cases, it will be based on the resolution of the browser that's being used. When this is the case, there is a change to the resolution that can be detected, except the data is corrupted by resolutions based on screen size.
However, in an app, information about switching between portrait and landscape mode can be natively obtained and passed in a site custom variable to display the data in our interfaces.