blob: b0862c391cb053bcfd4d5fbd061d85903a3b2f82 (
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
|
import "@fontsource/overpass"
import "@fontsource/overpass/700.css"
import "@fontsource/overpass/500.css"
import "./style.css"
import Page from "./pages.js"
import "./icons.js"
import initSlides from "./slides.js"
import initAlbums from "./albums.js"
const slideshow = new Page(document.querySelector("#slideshow"), ["", "/slideshow"], initSlides)
const albums = new Page(document.querySelector("#albums"), ["/albums"], initAlbums)
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 !== null && a.tagName !== "A")
a = a.parentElement
if (a === null) return
Page.softRedirect(a.href)
}
document.querySelector("#menu").addEventListener("click", softRedirect)
|