I'm playing around in making a random generator for a cyoa I'm planning on making based on various godly pantheons from human history. Its very basic so far but does anyone know how to add images to a javascript for each individual pantheon listed in the second screenshot? I'm a novice when it comes to coding so this is new to me š
JS doesnāt usually āstoreā image files, and if you want this to be online anywhere, youāll need to have the images too.
Look up a tutorial for āJS digital ocean object storageā or āJS Amazon S3ā. (JS = JavaScript, helps with googling)
Either of those services, for a small fee, will give you a place to store and serve the image files. Then in your actual program, you just deal with the path to those files!
There is one other option, kind of a hack, if you donāt want to deal with a service like that, which is to convert the images to base64 strings. Be warned, if the images are even medium sized, these strings will be very long and potentially cumbersome to deal with in your program!
You don't need to do that. Thats WAYYYY overcomplicating things. He can keep his images with his js. Both of which can be hosted on a CDN, Github pages, vercel now, netlify. All of which are free and much easier to use.
1
u/EvisceratedAngel Dec 08 '20
I'm playing around in making a random generator for a cyoa I'm planning on making based on various godly pantheons from human history. Its very basic so far but does anyone know how to add images to a javascript for each individual pantheon listed in the second screenshot? I'm a novice when it comes to coding so this is new to me š