Initial commit WIP

This commit is contained in:
Mike Conrad
2025-05-08 19:18:45 -04:00
commit 09cbc3f5a3
235 changed files with 25013 additions and 0 deletions

View File

@ -0,0 +1,35 @@
<script setup>
import PhotoSwipeLightbox from "photoswipe/lightbox";
import "photoswipe/style.css";
const gallery = ref(null);
const slots = useSlots();
const children = slots.default() ? slots.default()[0].children : false;
const childrenType = children ? children[0].type : false;
let lightbox;
onMounted(() => {
if (!lightbox && childrenType) {
lightbox = new PhotoSwipeLightbox({
gallery: gallery.value,
children: "a",
pswpModule: () => import("photoswipe"),
});
lightbox.init();
}
});
onUnmounted(() => {
if (lightbox) {
lightbox.destroy();
lightbox = null;
}
});
</script>
<template>
<div ref="gallery">
<slot />
</div>
</template>