Skip to content

Commit

Permalink
попытка зафиксить вертикальные размеры изображений
Browse files Browse the repository at this point in the history
  • Loading branch information
maxcom committed Jan 3, 2025
1 parent f602b22 commit 8acc6be
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/main/webapp/WEB-INF/tags/image.tag
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<c:if test="${showImage!=null and showImage and image!=null}">
<div class="medium-image-container" style="max-width: <%= Math.min(image.getFullInfo().getWidth(), Image.MaxScaledSize()) %>px">
<figure class="medium-image"
style="position: relative; padding-bottom: ${ 100.0 * image.mediumInfo.height / image.mediumInfo.width }%; margin: 0"
style="position: relative; padding-bottom: min(${ 100.0 * image.mediumInfo.height / image.mediumInfo.width }%, 90vh); margin: 0"
<c:if test="${enableSchema}">itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject"</c:if>>
<c:if test="${preparedMessage.section.imagepost || image.fullInfo.width >= 1920 || image.fullInfo.height >= 1080}">
<a href="${image.fullName}" itemprop="contentURL">
Expand Down
14 changes: 9 additions & 5 deletions src/main/webapp/sass/_common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -798,18 +798,22 @@ pre code .container:before, pre code .container:after {
}

img.medium-image {
width: 100%;
width: auto;
max-width: 100%;
max-height: 90vh;
height: auto;
image-orientation: none;
}

figure.medium-image {
width: 100%;
left: 50%;
transform: translateX(-50%);
}

.medium-image-container {
margin: 1em auto;
max-height: 90vh;
}

figure.medium-image {
width: 100%;
}

.slider-parent {
Expand Down

0 comments on commit 8acc6be

Please sign in to comment.