Update home page a bit

This commit is contained in:
2026-07-30 23:15:00 +02:00
parent 1536b8bd1b
commit 5b25f21f72
4 changed files with 19 additions and 81 deletions

View File

@@ -110,7 +110,7 @@ const load_page = async (pathname: string, history: boolean): Promise<boolean> =
window.document.title = current_page.title+" / Nova"
if(history) {
if (history) {
window.history.pushState({}, window.document.title, pathname)
}
@@ -129,7 +129,7 @@ const load_page = async (pathname: string, history: boolean): Promise<boolean> =
return true
}
const click = (e: MouseEvent) => {
const click = async (e: MouseEvent) => {
const origin = (e.target as Element).closest("a");
if (origin === null) {
@@ -145,7 +145,7 @@ const click = (e: MouseEvent) => {
// Try to load the page, if the page was found we cancel the browser
// navigation event so we can handle it ourselves
if (load_page(url.pathname, true)) {
if (await load_page(url.pathname, true) === true) {
e.preventDefault()
}
}
@@ -165,7 +165,7 @@ const popstate = (e: PopStateEvent) => {
{#if current_page !== null}
<current_page.component />
{#if current_page.footer === undefined || current_page.footer === true}
{#if current_page.footer !== false}
<Footer/>
{/if}
{/if}