This is possible trough HTML5 with things like WebGL. This is basically OpenGL for browser scripting languages like JavaScript.
If you don't want to get into nitty gritty of web programing you can make use of Raylib:
https://www.raylib.com/examples.htmlIts a simple C language wrapper for OpenGL that makes it easy to write hardware accelerated applications for lots of platforms and can be compiled into web assembly and WebGL. The examples on his website will work fine offline if you get all of the required files.