Something went wrong. Try again.
doll.systems community website
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859import { PageScope } from './page-scope';import { mountEffects } from './effects';import { mountNavigation } from './navigation';import { mountPixelGrid } from './pixel-grid';import { syncMotion } from './motion';
const enhancements = [ { selector: '[data-palette-tool]', name: 'palette tool', load: () => import('./palette-tool').then(({ mountPaletteTool }) => mountPaletteTool), failed: () => { const status = document.querySelector<HTMLElement>('[data-palette-tool] [data-status]'); if (status) { status.textContent = 'The palette tool could not load. Reload this page in a current browser.'; status.dataset.error = 'true'; } }, }, { selector: '.link-graph', name: 'link graph', load: () => import('./graph').then(({ mountGraphs }) => mountGraphs), failed: () => document.querySelectorAll<HTMLElement>('.graph-fallback').forEach((list) => { list.hidden = false; }), },];
let page: PageScope | undefined;document.addEventListener('astro:before-swap', () => { page?.dispose(); page = undefined;});function mountPage() { if (page) return; page = new PageScope(); const scope = page; syncMotion(); mountPixelGrid(page); for (const { selector, name, load, failed } of enhancements) if (document.querySelector(selector)) void load() .then((mount) => { if (!scope.signal.aborted) mount(scope); }) .catch((error) => { if (scope.signal.aborted) return; console.error(`Could not load the ${name}.`, error); failed(); }); mountNavigation(page); mountEffects(page);}document.addEventListener('astro:after-swap', mountPage);document.addEventListener('astro:page-load', mountPage);