Three.js on website not appearing on GitHub pages, but working fine on localhost? How to fix?

I finished my first three.js project, and it runs fine and works on my local device (it’s just a page of a black background and a ball that changed colour when you spin it).

However, when I uploaded it to GitHub to try and host it on GitHub pages it didn’t render the Three.js animations and instead replaced the whole scene with a white background.

I tried changing the source of the stylesheets and scripts, varying from “/styles.css” to “./styles” to even “url.com/repo/myproject/styles.css” but nothing seemed to work.

If you’d like to look at my code, here is the public repositiory.