feat: add ?scroll query param to set scroll sensitivity on load (#681)

Follows the same pattern as the existing ?volume param. Lets users
bake a preferred scroll sensitivity into the URL (useful for cast/embed
setups where the settings panel isn't reachable), and it's persisted
to localStorage afterwards so it sticks on future visits.

Fixes #607
This commit is contained in:
Sadok Barbouche
2026-08-05 22:09:53 +01:00
committed by GitHub
parent 613647c72c
commit 30d8e1c595
2 changed files with 13 additions and 0 deletions
+12
View File
@@ -206,6 +206,11 @@
return Math.max(0.0, Math.min(!isNaN(numberParam) ? numberParam * 100 : 100, 100))
}
get scroll() {
const numberParam = parseInt(new URL(location.href).searchParams.get('scroll') || '', 10)
return Math.max(1, Math.min(!isNaN(numberParam) ? numberParam : 10, 100))
}
get isCastMode() {
return !!new URL(location.href).searchParams.get('cast')
}
@@ -229,6 +234,13 @@
}
}
@Watch('scroll', { immediate: true })
onScroll(scroll: number) {
if (new URL(location.href).searchParams.has('scroll')) {
this.$accessor.settings.setScroll(scroll)
}
}
@Watch('hideControls', { immediate: true })
onHideControls(enabled: boolean) {
if (enabled) {