Files
brk/website_next/explore/index.js
T
2026-07-03 11:29:13 +02:00

21 lines
544 B
JavaScript

import { createChain } from "./chain/index.js";
export function createExplorePage() {
const main = document.createElement("main");
const chain = createChain();
main.className = "explore";
main.append(chain.element);
const syncChain = () => chain.setActive(!main.hidden && !document.hidden);
main.addEventListener("pageactive", syncChain);
document.addEventListener("visibilitychange", syncChain);
new MutationObserver(syncChain).observe(main, {
attributes: true,
attributeFilter: ["hidden"],
});
return main;
}