Different pages for mobile and desktop

Hey guys! I’d like to create two versions of a certain page, one for mobile and one for tablet / desktop, as some of the pages designed for phones looks really bad on the big screen. Is there any option to display a tab only if user agent is or is not desktop?

This thread might be worth looking at.

3 Likes

Hello,
as it is not the first time that I see this type of request, I made a YC with just the detection of the desktop mode.

EDIT
Note that this detection only works on a real mobile, the rest of the time (editor or application simulation) the value will be true: Is Desktop!

image

YC link
https://IsDesktop.manun2.repl.co

Source

8 Likes

@Manu.n can you also detect whether the screen is landscape or portrait?
And the detection is live - eg if the users rotates the screen then it is detected

Hello @Krivo
I don’t think so, because to my knowledge it is not yet possible to detect when the orientation changes.

1 Like

I would suggest, to do % and max-width in px, and left-right margins and padding in %, also eliminate CSS rich texts components, by putting them out of the screen or hidden, so they don’t overlap elements

That’s great! It’s like the script is locally loaded for each user right? It doesn’t affect other users because it’s a column.

yes exact, it’s like the other calculated columns, the script is executed on the client side, so for each device