mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
view image inline while browsing community
This commit is contained in:
parent
3b9cf6bd18
commit
88702bb9f2
3 changed files with 41 additions and 0 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 */
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue