mirror of
https://github.com/reonokiy/blog.nokiy.net.git
synced 2025-06-15 19:22:52 +02:00
update: back button position and fallback logic
This commit is contained in:
parent
cac96eca8c
commit
eb49f1def1
2 changed files with 5 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue