fix: 优化滚动进度计算逻辑并更新文本引号样式

Co-authored-by: Sylvanysc <Sylvanysc@users.noreply.github.com>
This commit is contained in:
2025-06-03 00:33:36 +08:00
parent 3cbbdba6a4
commit ced2e13205
2 changed files with 12 additions and 11 deletions
+6 -5
View File
@@ -31,11 +31,15 @@ const handleScrollOrResize = () => {
const scrollTop = (scrollPanel.value as unknown as { lastScrollTop: number })
.lastScrollTop;
const clientHeight = scrollPanel.value?.$el.clientHeight;
if (path.value === "/") {
sProgress.value =
1 -
range(0, 1, scrollTop / clientHeight) +
1 -
Math.abs(range(-0.5, 0.5, scrollTop / clientHeight - 6) * 2);
Math.abs(range(-1, 1, scrollTop / clientHeight - 6));
return;
}
sProgress.value = 1 - range(0, 1, scrollTop / clientHeight);
};
onMounted(() => {
@@ -53,10 +57,7 @@ onMounted(() => {
style="width: 100vw; height: 100vh"
:pt="{
content: {
class: 'snap-y snap-mandatory scroll-smooth',
style: {
scrollDuration: '2s',
},
class: 'snap-y snap-mandatory scroll-smooth overflow-x-hidden!',
},
}"
>