Re:WebGL2 Fundamentals
by bruce343434 on Sunday February 26, 2023 @07:45AM
(#34945100)
<iframe>? Other than that, nothing is stopping you from writing css and scripts and html in one file.
Flash games and animations often had a lot of static assets, like sound, bitmap images, or fonts. You could data-uri all that in your html file, too, but with all the base64 overhead it might be a good idea to compress everything afterwards (e.g. SingleFileZ, see my other comment). Of course only if file shipment is an issue for you, otherwise relying on your server's gzip compression might be enough.
Re:WebGL2 Fundamentals
by throwaway12245 on Sunday February 26, 2023 @10:54AM
(#34946438)
Try xz compression and put in a blob and then and put in wasm (C or rust for best performance). You can inline the wasm in single html file along with js and css. At load time, in wasm, you can decompress and instantiate the elements/objects/records from parsing the blob. You can keep in wasm or copy/move to js land. Sounds like a lot but it's pretty easy.
Although there is no agreed upon standard for encapsulated single-file web content, you can try to run your finished product through SingleFileZ or single-filez-cli, and ship that around, or embed it with an Iframe. I'm just not sure if it's suitable for games or application that load static assets upon certain interaction.
So it was all obvious and encapsulated.
I would like a generally agreed upon encapsulated html standard. Single-file sites that can be served as simply as media.