Skip to content

Commit 6b40b12

Browse files
Image sticks while prompt+metadata scrolls in portrait mode (#1340)
* Image sticks while prompt+metadata scrolls in portrait mode * don't shift down * that does nothing --------- Co-authored-by: Alex "mcmonkey" Goodwin <git_commits@alexgoodwin.dev>
1 parent 7acba99 commit 6b40b12

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/wwwroot/css/genpage.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,10 @@ body {
208208
object-fit: contain;
209209
object-position: top left;
210210
}
211+
.current_image_sideblock > .current-image-img {
212+
position: sticky;
213+
top: 0px;
214+
}
211215
.current_image_batch {
212216
display: inline-block;
213217
overflow-x: hidden;

src/wwwroot/js/genpage/gentab/currentimagehandler.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,7 @@ function alignImageDataFormat() {
709709
let curImg = getRequiredElementById('current_image');
710710
let img = currentImageHelper.getCurrentImage();
711711
if (!img) {
712+
curImg.classList.remove('current_image_sideblock');
712713
return;
713714
}
714715
let curImgContainer = currentImageHelper.getCurrentImageContainer();
@@ -724,6 +725,7 @@ function alignImageDataFormat() {
724725
curImgContainer.style.maxWidth = `calc(min(100%, ${width}px))`;
725726
if ((remainingWidth > 30 * 16 && format == 'auto') || format == 'side') {
726727
curImg.classList.remove('current_image_small');
728+
curImg.classList.add('current_image_sideblock');
727729
extrasWrapper.style.display = 'inline-block';
728730
extrasWrapper.classList.add('extras-wrapper-sideblock');
729731
curImgContainer.style.maxHeight = `calc(max(15rem, 100%))`;
@@ -739,6 +741,7 @@ function alignImageDataFormat() {
739741
}
740742
else {
741743
curImg.classList.add('current_image_small');
744+
curImg.classList.remove('current_image_sideblock');
742745
extrasWrapper.style.width = '100%';
743746
extrasWrapper.style.maxWidth = `100%`;
744747
extrasWrapper.style.display = 'block';

0 commit comments

Comments
 (0)