view image inline while browsing community

This commit is contained in:
rimu 2024-01-06 17:36:30 +13:00
parent 3b9cf6bd18
commit 88702bb9f2
3 changed files with 41 additions and 0 deletions

View file

@ -75,6 +75,12 @@ function setupImageExpander() {
image.alt = 'Image'; // Set the alt attribute for accessibility image.alt = 'Image'; // Set the alt attribute for accessibility
image.className = 'preview_image_shown'; image.className = 'preview_image_shown';
// Add click event listener to the inserted image
image.addEventListener('click', function() {
// Replace location.href with the URL of the clicked image
window.location.href = image.src;
});
// Insert the image after the anchor link // Insert the image after the anchor link
this.parentNode.insertBefore(image, this.nextSibling); this.parentNode.insertBefore(image, this.nextSibling);
} }

View file

@ -749,6 +749,27 @@ fieldset legend {
position: relative; position: relative;
max-width: 92vw; max-width: 92vw;
height: auto; height: auto;
cursor: pointer;
}
@media (min-width: 992px) {
.preview_image_shown {
max-width: 760px;
}
}
@media (min-width: 1280px) {
.preview_image_shown {
max-width: 800px;
}
}
@media (min-width: 1600px) {
.preview_image_shown {
max-width: 850px;
}
}
@media (min-width: 2000px) {
.preview_image_shown {
max-width: 1180px;
}
} }
/*# sourceMappingURL=structure.css.map */ /*# sourceMappingURL=structure.css.map */

View file

@ -443,4 +443,18 @@ fieldset {
position: relative; position: relative;
max-width: 92vw; max-width: 92vw;
height: auto; height: auto;
cursor: pointer;
@include breakpoint(tablet) {
max-width: 760px;
}
@include breakpoint(laptop) {
max-width: 800px;
}
@include breakpoint(desktop) {
max-width: 850px;
}
@include breakpoint(bigbig) {
max-width: 1180px;
}
} }