update: back button position and fallback logic

This commit is contained in:
radishzzz 2025-03-18 05:55:02 +00:00
parent cac96eca8c
commit eb49f1def1
2 changed files with 5 additions and 2 deletions

View file

@ -1,7 +1,7 @@
<button
id="back-button"
class="hidden"
lg="block absolute left--8 top-1/2 aspect-square w-4.5 translate-y--1/2 c-secondary active:scale-90 hover:c-primary"
lg="block absolute left--10 top-1/2 aspect-square w-4.5 translate-y--1/2 c-secondary active:scale-90 hover:c-primary"
aria-label="Back to home"
>
<svg

View file

@ -158,7 +158,10 @@ const mobileFooterMargin = isPost && themeConfig.comment?.waline?.serverURL
window.history.back()
}
else {
window.location.href = localizedHome
const siteTitle = document.querySelector(`h1 a[href="${localizedHome}"]`)
if (siteTitle) {
siteTitle.click()
}
}
})
}