import "./style.css" import ImmichConnector from "./immich.js" import Page from "./pages.js" import "./icons.js" import initSlides from "./slides.js" const immichConnector = new ImmichConnector("http://192.168.1.13", "m5nqOoBc4uhAba21gZdCP3z8D3JT4GPxDXL2psd52EA") document.immichConnector = immichConnector // FIXME TEMP const slideshow = new Page(document.querySelector("#slideshow"), "/slideshow", initSlides) const albums = new Page(document.querySelector("#albums"), "/albums") const settings = new Page(document.querySelector("#settings"), "/settings") window.addEventListener("popstate", Page.pathnameCallback) Page.pathnameCallback() /* run after all pages are registered */ /* add event listeners for anchor elements in footer */ function softRedirect(e) { e.preventDefault() let a = e.target if (a === null) return while (a.tagName !== "A" && a !== null) a = a.parentElement if (a === null) return Page.softRedirect(a.href) } document.querySelector("#menu").addEventListener("click", softRedirect)