Help me make this ball not roll off page

hi, read the title
project here:

Hey @sqasker welcome to the forums

Nothing happens when I open the webpage. Can you please include a link to the cover page?

Hi @sqasker, @not-ethan

The link to the Repl is ball tilt - HTML, CSS, JS Repl - Replit

do you have an anwser now?

This is a bit tricky to comment on as it uses the accelerometer which means users might have to use their phones to investigate the functionality issues you are having.

A quick glance at the code shows that you have set a max X and Y but these appear to be a bit high for a mobile device screen size. Have you experimented changing these to e.g. 50 and 50?

If you are able to record your mobile screen to show what happens and post a link here it might allow others to suggest ideas.