Add convenience scripts for pictures
This commit is contained in:
parent
3dbac61e65
commit
1e8c7c74e5
|
@ -29,6 +29,17 @@
|
||||||
<footer class="lock-bottom">
|
<footer class="lock-bottom">
|
||||||
<p><a href="../">Return</a></p>
|
<p><a href="../">Return</a></p>
|
||||||
</footer>
|
</footer>
|
||||||
|
<script>
|
||||||
|
// Convenience to open images when clicked :)
|
||||||
|
// Also deletes images if they don't load
|
||||||
|
// Everything still works without JS ofc
|
||||||
|
const imgs = document.getElementsByTagName('img');
|
||||||
|
for (let img of imgs) {
|
||||||
|
img.onclick = () => window.open(img.src);
|
||||||
|
img.onerror = () => {img.remove();
|
||||||
|
console.error(`Failed to load ${img.src}`);}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in New Issue