better image viewer
Ted Unangst tedu@tedunangst.com
Tue, 30 Jan 2024 22:30:00 -0500
3 files changed,
15 insertions(+),
2 deletions(-)
M
views/honk.html
→
views/honk.html
@@ -72,7 +72,7 @@ {{ else }}
{{ if $omitimages }} <p><a href="/d/{{ .XID }}">Image: {{ .Name }}</a>{{ if not (eq .Desc .Name) }} {{ .Desc }}{{ end }} {{ else }} -<a href="/d/{{.XID}}"><img class="donk" src="/d/{{ .XID }}" loading=lazy title="{{ .Desc }}" alt="{{ .Desc }}"></a> +<a class="donklink" href="/d/{{.XID}}"><img class="donk" src="/d/{{ .XID }}" loading=lazy title="{{ .Desc }}" alt="{{ .Desc }}"></a> {{ end }} {{ end }} {{ else }}
M
views/honkpage.js
→
views/honkpage.js
@@ -273,6 +273,16 @@ var xid = el.getAttribute("data-xid")
el.onclick = pageswitcher("honker", xid) el.classList.remove("honkerlink") } + els = document.getElementsByClassName("donklink") + while (els.length) { + let el = els[0] + el.onclick = function() { + el.children[0].classList.remove("donk") + el.onclick = null + return false + } + el.classList.remove("donklink") + } els = document.querySelectorAll("#honksonpage article button") els.forEach(function(el) {
M
views/style.css
→
views/style.css
@@ -335,10 +335,13 @@ background: var(--bg-page);
} img, video { max-width: 100%; - max-height: 600px; } .noise img:not(.emu) { display: block; +} +.noise img.donk { + max-height: 400px; + display: inline; } img.emu { height: 2em;