Add masonry

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2025-08-08 23:41:28 +02:00
parent 9d160b6890
commit 30f4d8d1e8
34 changed files with 328 additions and 9933 deletions

20
assets/js/main.js Normal file
View File

@@ -0,0 +1,20 @@
import PhotoSwipeLightbox from "photoswipe/lightbox";
import Masonry from "masonry-layout";
new PhotoSwipeLightbox({
gallery: ".lightbox",
children: "a",
showAnimationDuration: 300,
hideAnimationDuration: 300,
initialZoomLevel: "fit",
pswpModule: () => import("photoswipe"),
}).init();
const masonryContainers = document.querySelectorAll(".masonry");
masonryContainers.forEach((container) => {
new Masonry(container, {
itemSelector: ".grid-item",
columnWidth: ".grid-sizer",
percentPosition: true,
});
});

View File

@@ -1,10 +0,0 @@
import PhotoSwipeLightbox from "js/photoswipe/photoswipe-lightbox.esm.js";
new PhotoSwipeLightbox({
gallery: ".gallery",
children: "a",
showAnimationDuration: 300,
hideAnimationDuration: 300,
initialZoomLevel: "fit",
pswpModule: () => import("js/photoswipe/photoswipe.esm.js"),
}).init();

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff