Add example

This commit is contained in:
Manav Rathi
2025-02-13 11:56:39 +05:30
parent bd00c27dc6
commit 1980cb035e
2 changed files with 13 additions and 0 deletions

View File

@@ -124,3 +124,7 @@ body {
width: 100%;
height: 100%;
}
.pswp-ente .pswp__preloader--active .pswp__icn {
opacity: 0.4;
}

View File

@@ -342,6 +342,15 @@ export class FileViewerPhotoSwipe {
});
});
// Modify the default UI elements.
pswp.addFilter("uiElement", (element, data) => {
if (element.name == "preloader") {
// TODO(PS): Left as an example. For now, this is customized in
// the CSS.
}
return element;
});
// Initializing PhotoSwipe adds it to the DOM as a dialog-like div with
// the class "pswp".
pswp.init();