Files
home/Projects/pivoine.art/_js/src/lightbox.js
2025-10-10 16:43:21 +02:00

32 lines
712 B
JavaScript

import { fromEvent } from "rxjs";
import { webComponentsReady, stylesheetReady } from "./common.js";
(async () => {
await Promise.all([
...("customElements" in window
? []
: [
import(
/* webpackChunkName: "webcomponents" */ "./polyfills/webcomponents.js"
).then(
() =>
import(
/* webpackChunkName: "shadydom" */ "./polyfills/shadydom.js"
),
),
]),
]);
await webComponentsReady;
await stylesheetReady;
await import(/* webpackMode: "eager" */ "fslightbox");
const pushStateEl = document.querySelector("hy-push-state");
const after$ = fromEvent(pushStateEl, "hy-push-state-after");
after$.subscribe(() => {
refreshFsLightbox();
});
})();