P5JS coding using PORTRAIT

I’m trying to create a mobile game (one accessible on the internet), and am trying to code in a portrait orientation lock, so one can turn a device on its side and the screen remains the same instead of trying to awkwardly flip.

I can redefine the window using deviceOrientation but I don’t know how I can lock the portrait orientation.

Any ideas?

Thank you

Hello and welcome, could you be more specific? If, as you say, you can redefine the window is it not just redefine it with the wanted aspect ratio? Maybe, if you can, show your attempt, may be easier to understand.