From 07f34c1b614f53c2b7e5bd8d9b48fc84cc574469 Mon Sep 17 00:00:00 2001 From: Xwite <1797350009@qq.com> Date: Tue, 9 May 2023 20:34:11 +0800 Subject: [PATCH] =?UTF-8?q?web:=20=E6=B7=BB=E5=8A=A0=E9=97=B4=E8=B7=9D?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/web/src/components/ReadSettings.vue | 96 ++++++++++++++++++--- 1 file changed, 86 insertions(+), 10 deletions(-) diff --git a/modules/web/src/components/ReadSettings.vue b/modules/web/src/components/ReadSettings.vue index 58ba9a56d..f2792808b 100644 --- a/modules/web/src/components/ReadSettings.vue +++ b/modules/web/src/components/ReadSettings.vue @@ -87,6 +87,45 @@ > +
  • + 字距 +
    + {{ spacing.letter.toFixed(2) }} + +
    +
  • +
  • + 行距 +
    + {{ spacing.line.toFixed(1) }} + +
    +
  • +
  • + 段距 +
    +
    + + {{ spacing.paragraph.toFixed(1) }} + +
    +
    +
  • 页面宽度
    @@ -176,6 +215,7 @@ onMounted(() => { const config = computed(() => { return store.config; }); + const popupTheme = computed(() => { return { background: settings.themes[config.value.theme].popup, @@ -187,15 +227,6 @@ const selectedTheme = computed(() => { const selectedFont = computed(() => { return store.config.font; }); -const fontSize = computed(() => { - return store.config.fontSize; -}); -const readWidth = computed(() => { - return store.config.readWidth; -}); -const infiniteLoading = computed(() => { - return store.config.infiniteLoading; -}); const setTheme = (theme) => { if (theme == 6) { @@ -219,6 +250,10 @@ const setCustomFont = () => { config.value.customFontName = customFontName.value; saveConfig(config.value); }; + +const fontSize = computed(() => { + return store.config.fontSize; +}); const moreFontSize = () => { if (config.value.fontSize < 48) config.value.fontSize += 2; saveConfig(config.value); @@ -227,6 +262,38 @@ const lessFontSize = () => { if (config.value.fontSize > 12) config.value.fontSize -= 2; saveConfig(config.value); }; + +const spacing = computed(() => { + return store.config.spacing; +}); +const lessLetterSpacing = () => { + store.config.spacing.letter -= 0.01; + saveConfig(config.value); +}; +const moreLetterSpacing = () => { + store.config.spacing.letter += 0.01; + saveConfig(config.value); +}; +const lessLineSpacing = () => { + store.config.spacing.line -= 0.1; + saveConfig(config.value); +}; +const moreLineSpacing = () => { + store.config.spacing.line += 0.1; + saveConfig(config.value); +}; +const lessParagraphSpacing = () => { + store.config.spacing.paragraph -= 0.1; + saveConfig(config.value); +}; +const moreParagraphSpacing = () => { + store.config.spacing.paragraph += 0.1; + saveConfig(config.value); +}; + +const readWidth = computed(() => { + return store.config.readWidth; +}); const moreReadWidth = () => { /*if (config.value.readWidth < 960)*/ config.value.readWidth += 160; @@ -236,6 +303,9 @@ const lessReadWidth = () => { if (config.value.readWidth > 640) config.value.readWidth -= 160; saveConfig(config.value); }; +const infiniteLoading = computed(() => { + return store.config.infiniteLoading; +}); const setInfiniteLoading = (loading) => { config.value.infiniteLoading = loading; saveConfig(config.value); @@ -279,6 +349,9 @@ const uploadConfig = (config) => { } .setting-list { + max-height: calc(70vh - 50px); + overflow: auto; + ul { list-style: none outside none; margin: 0; @@ -356,7 +429,10 @@ const uploadConfig = (config) => { } .font-size, - .read-width { + .read-width, + letter-spacing, + line-spacing, + paragraph-spacing { margin-top: 28px; .resize {