web阅读增加翻页速度的设置项

This commit is contained in:
StanHustler 2023-09-23 21:05:10 +08:00 committed by Strato69
parent 8349fda250
commit c1facb5f72
3 changed files with 34 additions and 2 deletions

View File

@ -138,6 +138,21 @@
> >
</div> </div>
</li> </li>
<li class="paragraph-spacing">
<i>翻页速度</i>
<div class="resize">
<div class="resize">
<span class="less" @click="lessJumpDuration">
<em class="iconfont">&#xe625;</em>
</span>
<b></b> <span class="lang">{{ jumpDuration }}</span
><b></b>
<span class="more" @click="moreJumpDuration"
><em class="iconfont">&#xe626;</em></span
>
</div>
</div>
</li>
<li class="infinite-loading"> <li class="infinite-loading">
<i>无限加载</i> <i>无限加载</i>
<span <span
@ -304,6 +319,18 @@ const lessReadWidth = () => {
if (config.value.readWidth > 640) config.value.readWidth -= 160; if (config.value.readWidth > 640) config.value.readWidth -= 160;
saveConfig(config.value); saveConfig(config.value);
}; };
const jumpDuration = computed(() => {
return store.config.jumpDuration;
});
const moreJumpDuration = () => {
store.config.jumpDuration += 100;
saveConfig(config.value);
};
const lessJumpDuration = () => {
if (store.config.jumpDuration === 0) return;
store.config.jumpDuration -= 100;
saveConfig(config.value);
};
const infiniteLoading = computed(() => { const infiniteLoading = computed(() => {
return store.config.infiniteLoading; return store.config.infiniteLoading;
}); });

View File

@ -22,6 +22,7 @@ export const useBookStore = defineStore("book", {
readWidth: 800, readWidth: 800,
infiniteLoading: false, infiniteLoading: false,
customFontName: "", customFontName: "",
jumpDuration: 1000,
spacing: { spacing: {
paragraph: 1, paragraph: 1,
line: 0.8, line: 0.8,

View File

@ -425,7 +425,9 @@ const handleKeyPress = (event) => {
type: "warn", type: "warn",
}); });
} else { } else {
jump(0 - document.documentElement.clientHeight + 100); jump(0 - document.documentElement.clientHeight + 100, {
duration: store.config.jumpDuration,
});
} }
break; break;
case "ArrowDown": case "ArrowDown":
@ -441,7 +443,9 @@ const handleKeyPress = (event) => {
type: "warn", type: "warn",
}); });
} else { } else {
jump(document.documentElement.clientHeight - 100); jump(document.documentElement.clientHeight - 100, {
duration: store.config.jumpDuration,
});
} }
break; break;
} }