2023-06-10 14:49:15 -07:00
|
|
|
(async () => {
|
2023-06-14 22:10:06 -07:00
|
|
|
// menu style
|
2023-12-08 19:53:16 -08:00
|
|
|
const menuStyle = document.createElement('link')
|
|
|
|
menuStyle.rel = 'stylesheet'
|
|
|
|
menuStyle.href = '/style/menu.css'
|
|
|
|
document.head.append(menuStyle)
|
2023-06-10 15:01:28 -07:00
|
|
|
|
2023-06-14 22:10:06 -07:00
|
|
|
// build menu
|
2023-06-10 14:49:15 -07:00
|
|
|
const siteRoot = '/' + location.pathname.split('/')[1]
|
2023-06-14 22:10:06 -07:00
|
|
|
const {wayback} = await import(`${siteRoot}/config.js`)
|
2023-06-10 14:49:15 -07:00
|
|
|
|
|
|
|
let menu = document.createElement('div')
|
|
|
|
menu.id = 'archive-menu'
|
|
|
|
|
|
|
|
let span = document.createElement('span')
|
|
|
|
span.id = 'hrt'
|
|
|
|
span.innerText = '♥'
|
|
|
|
menu.append(span)
|
|
|
|
|
|
|
|
let archiveRoot = document.createElement('a')
|
|
|
|
archiveRoot.setAttribute('href', '/')
|
|
|
|
archiveRoot.setAttribute('target', '_top')
|
|
|
|
archiveRoot.innerText = 'Home'
|
|
|
|
menu.append(archiveRoot)
|
|
|
|
|
|
|
|
let changelog = document.createElement('a')
|
2023-06-10 15:03:24 -07:00
|
|
|
changelog.setAttribute('href', `${siteRoot}/CHANGELOG.txt`)
|
2023-06-10 14:49:15 -07:00
|
|
|
changelog.setAttribute('target', '_blank')
|
|
|
|
changelog.innerText = 'Changelog'
|
|
|
|
menu.append(changelog)
|
|
|
|
|
|
|
|
if (wayback) {
|
|
|
|
let waybackLink = document.createElement('a')
|
|
|
|
waybackLink.setAttribute('href', `https://web.archive.org/web/${wayback}`)
|
|
|
|
waybackLink.setAttribute('target', '_blank')
|
|
|
|
waybackLink.innerText = 'Wayback Capture'
|
|
|
|
menu.append(waybackLink)
|
|
|
|
}
|
|
|
|
|
|
|
|
document.body.prepend(menu)
|
2023-12-08 20:44:05 -08:00
|
|
|
})()
|