Compare commits

...

2 Commits

Author SHA1 Message Date
ba3785df0c Merge pull request 'Add access keys and dark theme' (#3) from dark-mode into main
Reviewed-on: #3
2024-02-10 20:46:33 +00:00
05077cb19a
Add access keys and dark theme 2024-02-10 21:39:54 +01:00

View File

@ -3,24 +3,28 @@ function displayHeader() {
{ {
href: "/", href: "/",
name: "Home", name: "Home",
accessKey: "h",
}, },
{ {
href: "/register/", href: "/register/",
name: "Register", name: "Register",
accessKey: "r",
}, },
{ {
href: "/login/", href: "/login/",
name: "Login", name: "Login",
accessKey: "l",
}, },
{ {
href: "/upload/", href: "/upload/",
name: "Upload", name: "Upload",
accessKey: "u",
}, },
].map(({name, href}) => { ].map(({name, href, accessKey}) => {
if (href === window.location.pathname) { if (href === window.location.pathname) {
return `<a href="${href}"><b>${name}</b></a>` return `<a href="${href}" accesskey="${accessKey}"><b>${name}</b></a>`
} else { } else {
return `<a href="${href}">${name}</a>` return `<a href="${href}" accesskey="${accessKey}">${name}</a>`
} }
}).join(" - "); }).join(" - ");