I’m not totally sure what you’re going for here but I thought I’d chip in with a method of enlarging an image on-click with CSS only bc I think it’s neat:
We put each image in an invisible button. When the button containing an image is “focussed”, (i.e it’s the last thing the user clicked) we increase the height. If the user clicks the page background or another button, it goes back to normal.
I’m suggesting you a way to do so, not the actual code.
You can cover the whole webpage with a .overlay div, when clicked on the image, and pass the image in it, then display: block it.
Make the image take full width / height, by max-height or max-width css property.
And, when the div is clicked (note that, initially the image was clicked, and div was display: none), hide the div again, and thus enlarged image will disappear.
They’re hidden behind a GUID for each project, so you can only really find the assets for your projects.
Btw nothing wrong with a little bit of inline JS if it’s only a little bit Reduces number of requests and download time… I use a little bit on https://stegriff.co.uk/