This commit is contained in:
Manav Rathi
2025-03-03 13:42:57 +05:30
parent 8ac9751891
commit a9def0ccc1
2 changed files with 27 additions and 0 deletions

View File

@@ -170,3 +170,18 @@ body {
/* default is a horizontal flip, transform: scale(-1, 1); */
transform: scale(-0.8, 0.8);
}
.pswp-ente .pswp__caption {
color: white;
position: absolute;
bottom: 8px;
right: 8px;
padding: 6px 16px;
border-radius: 2px;
background-color: rgba(0 0 0 / 0.2);
backdrop-filter: blur(10px);
word-break: break-word;
text-align: right;
max-width: 375px;
max-height: 200px;
}

View File

@@ -617,6 +617,18 @@ export class FileViewerPhotoSwipe {
},
});
}
pswp.ui.registerElement({
name: "caption",
order: 50,
appendTo: "root",
html: "<p/>",
onInit: (captionElement, pswp) =>
pswp.on("change", () => {
const { file } = pswp.currSlide.content.data;
captionElement.innerText = `${file}`;
}),
});
});
// Modify the default UI elements.