diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2024-01-11 21:04:30 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2024-01-11 21:04:30 -0400 |
commit | 3eb50e4e16c7326342fd49b0a9fd3ea1b8cec46f (patch) | |
tree | ec21153e69a3669208a1178d872fb06a4136eecb /src | |
parent | 4ad0c3946a132f20742cc4de7f7dd31c79bb4653 (diff) |
content, css: fix bad rule for styling image-container w/ link
Diffstat (limited to 'src')
-rw-r--r-- | src/content/dependencies/image.js | 9 | ||||
-rw-r--r-- | src/static/client3.js | 6 | ||||
-rw-r--r-- | src/static/site6.css | 2 |
3 files changed, 12 insertions, 5 deletions
diff --git a/src/content/dependencies/image.js b/src/content/dependencies/image.js index 5ea89a57..4dc1100c 100644 --- a/src/content/dependencies/image.js +++ b/src/content/dependencies/image.js @@ -140,9 +140,6 @@ export default { (customLink ? {href: slots.link} : {href: originalSrc}), - - customLink && - {class: 'no-image-preview'}, ]); const containerAttributes = html.attributes(); @@ -353,6 +350,12 @@ export default { html.tag('div', {class: 'image-container'}, containerAttributes, + willLink && + {class: 'has-link'}, + + customLink && + {class: 'no-image-preview'}, + !originalSrc && {class: 'placeholder-image'}, diff --git a/src/static/client3.js b/src/static/client3.js index 595bf612..865aa78a 100644 --- a/src/static/client3.js +++ b/src/static/client3.js @@ -1679,7 +1679,11 @@ function addImageOverlayClickHandlers() { return; } - for (const link of document.querySelectorAll('.image-link:not(.no-image-preview)')) { + for (const link of document.querySelectorAll('.image-link')) { + if (link.closest('.no-image-preview')) { + continue; + } + link.addEventListener('click', handleImageLinkClicked); } diff --git a/src/static/site6.css b/src/static/site6.css index 2ffb209d..44634f1c 100644 --- a/src/static/site6.css +++ b/src/static/site6.css @@ -1228,7 +1228,7 @@ img.pixelate { text-decoration-style: solid; } -.image-link:not(.no-image-preview) .image-container { +.image-container.has-link:not(.no-image-preview) { background: var(--deep-color); box-shadow: none; border-radius: 0 0 4px 4px; |