Fix cube transition direction on forward history navigation

popstate always passed back=true, so going forward after back still
rotated the cube backwards. Track an incrementing idx in history.state
and only mirror the transition when the target entry is actually behind;
replaceState calls now preserve the state object instead of wiping it.
This commit is contained in:
2026-08-28 19:35:07 +00:00
parent 7743639812
commit 8df6594432
3 changed files with 19 additions and 7 deletions
+1 -1
View File
@@ -126,7 +126,7 @@ const readStats = computed(() => calcReadStats(visits.value))
watch(range, (r) => {
const url = new URL(location.href)
url.hash = r
history.replaceState(null, '', url)
history.replaceState(history.state, '', url)
})
const clients = computed(() => data.value?.clients || {})