This question is in the context of a previous one but I think deserves another thread on its own.
Being able to detect user agent and serve mobile or desktop version is good, but is there also a way to detect orientation to serve website version when orientation changes? For example on large mobile devices in landscape orientation and width 1024px or more, I want to show the desktop version, but if put on portrait orientation, I want to serve the mobile version.
In summary
- desktop: landscape website layout
- mobile-large-landscape: landscape
- website layout mobile-large-portrait: portrait website layout
- mobile-small-landscape: portrait website layout
- mobile-large-landscape: portrait website layout
Conventionally, this can be solved by using media queries and responsive design. However, the landscape and portrait websites have very little similarities, so it is easier to create both sites from scratch.