blob: e6a4dc3ba94a43644657171cb12c75996be01374 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
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()
/* 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
window.history.pushState({}, "", a.href);
Page.pathnameCallback()
}
document.querySelector("#menu").addEventListener("click", softRedirect)
|