i would like to expand this theme just a little, and say something not only about compression, but also other things realted to the gallery, if that's ok!
i'm not sure if it's for everyone, but the system i use myself is:
1. make a structure. my sorting is nsfw and sfw folders > folders by year. pretty simple, but it makes my coding process more painless. for example, if i code the sfw page, i don't need to make sure twice if i put there only sfw, as it's already sorted. the same with the years.
2. compress drawings that i upload to website. i use
tinypng for it. before this, i've been uploading uncompressed images, but then my website became too big (everything beyond 60Mb is "too big" for me lol). plus, it made loading of the gallery page veeery slow, and not suitable for people with poor internet connection, even with lazy loading
3. loading="lazy" attribute in img tag. for everything that is too far away from the top of the gallery. i'm not using scripts to calculate how EXACTLY many images will be visible on the top: i check my gallery from laptop and mobile, and then just put the attribute to the rest that i don't see immediately
4. make a link (putting image tag inside of link tag) to uncompressed version that i host on
filegarden. so if someone reaaally wants to see the full image in details, they can just click on the image. taget="_blank" is optional (opens a link in the new tab). it looks like this:
<a href="filegarden link.png" target="_blank" title="click to see uncompressed version"><img src="year/img.png" loading="lazy" alt="alt text"></a>
some details:
i really,
really don't like using scripts if it's for something important (like navbar or gallery). scripts are not EVIL or something, i just decided to myself to be a HTML person, so i would painlessly migrate + my pages would be available to users with no-script. but it's just my personal preference. like, who knows if old scripts will work in the future, eh?
though i think lightbox script is pretty cool, even if i don't use it.
this one by kaylee especially.
also, images in my gallery are square and have a limit in 200px (as a thumbnail, not the actual size), so they fit in a column/row structure. hovering image will show its true proportions. i know it's kinda SMALL, but for me it's enough. in desktop view, my gallery has 3 columns; in mobile - 1.
CSS i used as a base is by solaria. square images previews are not for everyone though.
also i sometimes use
img src generator if i need to add many images at once, since i'm lazy lol.
due to ehh life circumstances, i really want to make sure my page will last, even if i will not be able to maintain it anymore. so, if filegarden will go down, at least i still will have a compressed versions to show. or if neocities images will go corrupted for some reason (unlikely, but...), my gallery will still have a links to filegarden. (i back up my full private gallery files for myself in cloud and flash drive anyway).
i'm not a pro in this at all, but i figured maybe it could be helpful for some!