Add:Epub reader setting to force single page #1018

This commit is contained in:
advplyr 2024-01-01 11:31:45 -06:00
parent 86096df1a4
commit b849be6f5e
19 changed files with 82 additions and 7 deletions

View file

@ -1,5 +1,5 @@
<template> <template>
<div ref="wrapper" class="modal modal-bg w-screen fixed bottom-0 left-0 flex items-center justify-center z-50" :class="halfScreen ? 'h-[50vh]' : 'h-screen'" @click.stop @touchstart.stop @touchend.stop> <div ref="wrapper" class="modal modal-bg w-screen fixed bottom-0 left-0 flex items-center justify-center z-50" :class="halfScreen ? 'h-[50vh] min-h-[400px]' : 'h-screen'" @click.stop @touchstart.stop @touchend.stop>
<div ref="content" class="relative text-fg h-full w-full bg-bg"> <div ref="content" class="relative text-fg h-full w-full bg-bg">
<slot /> <slot />
</div> </div>

View file

@ -56,7 +56,7 @@
<!-- ereader settings modal --> <!-- ereader settings modal -->
<modals-fullscreen-modal v-model="showSettingsModal" :theme="ereaderTheme" half-screen> <modals-fullscreen-modal v-model="showSettingsModal" :theme="ereaderTheme" half-screen>
<div style="box-shadow: 0px -8px 8px #11111155"> <div style="box-shadow: 0px -8px 8px #11111155">
<div class="flex items-end justify-between h-20 px-4 pb-2 mb-8"> <div class="flex items-end justify-between h-20 px-4 pb-2 mb-6">
<h1 class="text-lg">{{ $strings.HeaderEreaderSettings }}</h1> <h1 class="text-lg">{{ $strings.HeaderEreaderSettings }}</h1>
<button class="flex" @click="showSettingsModal = false"> <button class="flex" @click="showSettingsModal = false">
<span class="material-icons">close</span> <span class="material-icons">close</span>
@ -64,24 +64,30 @@
</div> </div>
<div class="w-full overflow-y-auto overflow-x-hidden h-full max-h-[calc(100vh-85px)]"> <div class="w-full overflow-y-auto overflow-x-hidden h-full max-h-[calc(100vh-85px)]">
<div class="w-full h-full px-4"> <div class="w-full h-full px-4">
<div class="flex items-center mb-8"> <div class="flex items-center mb-6">
<div class="w-32"> <div class="w-32">
<p class="text-base">{{ $strings.LabelTheme }}:</p> <p class="text-base">{{ $strings.LabelTheme }}:</p>
</div> </div>
<ui-toggle-btns v-model="ereaderSettings.theme" :items="themeItems" @input="settingsUpdated" /> <ui-toggle-btns v-model="ereaderSettings.theme" :items="themeItems" @input="settingsUpdated" />
</div> </div>
<div class="flex items-center mb-8"> <div class="flex items-center mb-6">
<div class="w-32"> <div class="w-32">
<p class="text-base">{{ $strings.LabelFontScale }}:</p> <p class="text-base">{{ $strings.LabelFontScale }}:</p>
</div> </div>
<ui-range-input v-model="ereaderSettings.fontScale" :min="5" :max="300" :step="5" input-width="180px" @input="settingsUpdated" /> <ui-range-input v-model="ereaderSettings.fontScale" :min="5" :max="300" :step="5" input-width="180px" @input="settingsUpdated" />
</div> </div>
<div class="flex items-center mb-8"> <div class="flex items-center mb-6">
<div class="w-32"> <div class="w-32">
<p class="text-base">{{ $strings.LabelLineSpacing }}:</p> <p class="text-base">{{ $strings.LabelLineSpacing }}:</p>
</div> </div>
<ui-range-input v-model="ereaderSettings.lineSpacing" :min="100" :max="300" :step="5" input-width="180px" @input="settingsUpdated" /> <ui-range-input v-model="ereaderSettings.lineSpacing" :min="100" :max="300" :step="5" input-width="180px" @input="settingsUpdated" />
</div> </div>
<div class="flex items-center">
<div class="w-32">
<p class="text-base">{{ $strings.LabelLayout }}:</p>
</div>
<ui-toggle-btns v-model="ereaderSettings.spread" :items="spreadItems" @input="settingsUpdated" />
</div>
</div> </div>
</div> </div>
</div> </div>
@ -109,7 +115,8 @@ export default {
ereaderSettings: { ereaderSettings: {
theme: 'dark', theme: 'dark',
fontScale: 100, fontScale: 100,
lineSpacing: 115 lineSpacing: 115,
spread: 'auto'
} }
} }
}, },
@ -154,6 +161,18 @@ export default {
if (this.isEpub) return this.ereaderSettings.theme if (this.isEpub) return this.ereaderSettings.theme
return document.documentElement.dataset.theme || 'dark' return document.documentElement.dataset.theme || 'dark'
}, },
spreadItems() {
return [
{
text: this.$strings.LabelLayoutSinglePage,
value: 'none'
},
{
text: this.$strings.LabelLayoutAuto,
value: 'auto'
}
]
},
themeItems() { themeItems() {
return [ return [
{ {
@ -350,7 +369,12 @@ export default {
try { try {
const settings = localStorage.getItem('ereaderSettings') const settings = localStorage.getItem('ereaderSettings')
if (settings) { if (settings) {
this.ereaderSettings = JSON.parse(settings) const ereaderSettings = JSON.parse(settings)
if (!ereaderSettings.spread) {
// Added in 0.9.71
ereaderSettings.spread = 'auto'
}
this.ereaderSettings = ereaderSettings
this.settingsUpdated() this.settingsUpdated()
} }
} catch (error) { } catch (error) {

View file

@ -150,6 +150,9 @@
"LabelJumpBackwardsTime": "Jump backwards time", "LabelJumpBackwardsTime": "Jump backwards time",
"LabelJumpForwardsTime": "Jump forwards time", "LabelJumpForwardsTime": "Jump forwards time",
"LabelLanguage": "Jazyk", "LabelLanguage": "Jazyk",
"LabelLayout": "Layout",
"LabelLayoutAuto": "Auto",
"LabelLayoutSinglePage": "Single page",
"LabelLight": "Light", "LabelLight": "Light",
"LabelLineSpacing": "Řádkování", "LabelLineSpacing": "Řádkování",
"LabelListenAgain": "Listen Again", "LabelListenAgain": "Listen Again",

View file

@ -150,6 +150,9 @@
"LabelJumpBackwardsTime": "Jump backwards time", "LabelJumpBackwardsTime": "Jump backwards time",
"LabelJumpForwardsTime": "Jump forwards time", "LabelJumpForwardsTime": "Jump forwards time",
"LabelLanguage": "Sprog", "LabelLanguage": "Sprog",
"LabelLayout": "Layout",
"LabelLayoutAuto": "Auto",
"LabelLayoutSinglePage": "Single page",
"LabelLight": "Light", "LabelLight": "Light",
"LabelLineSpacing": "Linjeafstand", "LabelLineSpacing": "Linjeafstand",
"LabelListenAgain": "Listen Again", "LabelListenAgain": "Listen Again",

View file

@ -150,6 +150,9 @@
"LabelJumpBackwardsTime": "Rückspulzeit", "LabelJumpBackwardsTime": "Rückspulzeit",
"LabelJumpForwardsTime": "Vorwärtsspulzeit", "LabelJumpForwardsTime": "Vorwärtsspulzeit",
"LabelLanguage": "Sprache", "LabelLanguage": "Sprache",
"LabelLayout": "Layout",
"LabelLayoutAuto": "Auto",
"LabelLayoutSinglePage": "Single page",
"LabelLight": "Leicht", "LabelLight": "Leicht",
"LabelLineSpacing": "Zeilenabstand", "LabelLineSpacing": "Zeilenabstand",
"LabelListenAgain": "Erneut anhören", "LabelListenAgain": "Erneut anhören",

View file

@ -150,6 +150,9 @@
"LabelJumpBackwardsTime": "Jump backwards time", "LabelJumpBackwardsTime": "Jump backwards time",
"LabelJumpForwardsTime": "Jump forwards time", "LabelJumpForwardsTime": "Jump forwards time",
"LabelLanguage": "Language", "LabelLanguage": "Language",
"LabelLayout": "Layout",
"LabelLayoutAuto": "Auto",
"LabelLayoutSinglePage": "Single page",
"LabelLight": "Light", "LabelLight": "Light",
"LabelLineSpacing": "Line spacing", "LabelLineSpacing": "Line spacing",
"LabelListenAgain": "Listen Again", "LabelListenAgain": "Listen Again",

View file

@ -150,6 +150,9 @@
"LabelJumpBackwardsTime": "Jump backwards time", "LabelJumpBackwardsTime": "Jump backwards time",
"LabelJumpForwardsTime": "Jump forwards time", "LabelJumpForwardsTime": "Jump forwards time",
"LabelLanguage": "Lenguaje", "LabelLanguage": "Lenguaje",
"LabelLayout": "Layout",
"LabelLayoutAuto": "Auto",
"LabelLayoutSinglePage": "Single page",
"LabelLight": "Light", "LabelLight": "Light",
"LabelLineSpacing": "Interlineado", "LabelLineSpacing": "Interlineado",
"LabelListenAgain": "Listen Again", "LabelListenAgain": "Listen Again",

View file

@ -150,6 +150,9 @@
"LabelJumpBackwardsTime": "Jump backwards time", "LabelJumpBackwardsTime": "Jump backwards time",
"LabelJumpForwardsTime": "Jump forwards time", "LabelJumpForwardsTime": "Jump forwards time",
"LabelLanguage": "Langue", "LabelLanguage": "Langue",
"LabelLayout": "Layout",
"LabelLayoutAuto": "Auto",
"LabelLayoutSinglePage": "Single page",
"LabelLight": "Light", "LabelLight": "Light",
"LabelLineSpacing": "Interligne", "LabelLineSpacing": "Interligne",
"LabelListenAgain": "Listen Again", "LabelListenAgain": "Listen Again",

View file

@ -150,6 +150,9 @@
"LabelJumpBackwardsTime": "Jump backwards time", "LabelJumpBackwardsTime": "Jump backwards time",
"LabelJumpForwardsTime": "Jump forwards time", "LabelJumpForwardsTime": "Jump forwards time",
"LabelLanguage": "Language", "LabelLanguage": "Language",
"LabelLayout": "Layout",
"LabelLayoutAuto": "Auto",
"LabelLayoutSinglePage": "Single page",
"LabelLight": "Light", "LabelLight": "Light",
"LabelLineSpacing": "Line spacing", "LabelLineSpacing": "Line spacing",
"LabelListenAgain": "Listen Again", "LabelListenAgain": "Listen Again",

View file

@ -150,6 +150,9 @@
"LabelJumpBackwardsTime": "Jump backwards time", "LabelJumpBackwardsTime": "Jump backwards time",
"LabelJumpForwardsTime": "Jump forwards time", "LabelJumpForwardsTime": "Jump forwards time",
"LabelLanguage": "Language", "LabelLanguage": "Language",
"LabelLayout": "Layout",
"LabelLayoutAuto": "Auto",
"LabelLayoutSinglePage": "Single page",
"LabelLight": "Light", "LabelLight": "Light",
"LabelLineSpacing": "Line spacing", "LabelLineSpacing": "Line spacing",
"LabelListenAgain": "Listen Again", "LabelListenAgain": "Listen Again",

View file

@ -150,6 +150,9 @@
"LabelJumpBackwardsTime": "Jump backwards time", "LabelJumpBackwardsTime": "Jump backwards time",
"LabelJumpForwardsTime": "Jump forwards time", "LabelJumpForwardsTime": "Jump forwards time",
"LabelLanguage": "Jezik", "LabelLanguage": "Jezik",
"LabelLayout": "Layout",
"LabelLayoutAuto": "Auto",
"LabelLayoutSinglePage": "Single page",
"LabelLight": "Light", "LabelLight": "Light",
"LabelLineSpacing": "Line spacing", "LabelLineSpacing": "Line spacing",
"LabelListenAgain": "Listen Again", "LabelListenAgain": "Listen Again",

View file

@ -150,6 +150,9 @@
"LabelJumpBackwardsTime": "Jump backwards time", "LabelJumpBackwardsTime": "Jump backwards time",
"LabelJumpForwardsTime": "Jump forwards time", "LabelJumpForwardsTime": "Jump forwards time",
"LabelLanguage": "Lingua", "LabelLanguage": "Lingua",
"LabelLayout": "Layout",
"LabelLayoutAuto": "Auto",
"LabelLayoutSinglePage": "Single page",
"LabelLight": "Light", "LabelLight": "Light",
"LabelLineSpacing": "Interlinea", "LabelLineSpacing": "Interlinea",
"LabelListenAgain": "Listen Again", "LabelListenAgain": "Listen Again",

View file

@ -150,6 +150,9 @@
"LabelJumpBackwardsTime": "Jump backwards time", "LabelJumpBackwardsTime": "Jump backwards time",
"LabelJumpForwardsTime": "Jump forwards time", "LabelJumpForwardsTime": "Jump forwards time",
"LabelLanguage": "Kalba", "LabelLanguage": "Kalba",
"LabelLayout": "Layout",
"LabelLayoutAuto": "Auto",
"LabelLayoutSinglePage": "Single page",
"LabelLight": "Light", "LabelLight": "Light",
"LabelLineSpacing": "Tarpas tarp eilučių", "LabelLineSpacing": "Tarpas tarp eilučių",
"LabelListenAgain": "Listen Again", "LabelListenAgain": "Listen Again",

View file

@ -150,6 +150,9 @@
"LabelJumpBackwardsTime": "Jump backwards time", "LabelJumpBackwardsTime": "Jump backwards time",
"LabelJumpForwardsTime": "Jump forwards time", "LabelJumpForwardsTime": "Jump forwards time",
"LabelLanguage": "Taal", "LabelLanguage": "Taal",
"LabelLayout": "Layout",
"LabelLayoutAuto": "Auto",
"LabelLayoutSinglePage": "Single page",
"LabelLight": "Light", "LabelLight": "Light",
"LabelLineSpacing": "Regelruimte", "LabelLineSpacing": "Regelruimte",
"LabelListenAgain": "Listen Again", "LabelListenAgain": "Listen Again",

View file

@ -150,6 +150,9 @@
"LabelJumpBackwardsTime": "Jump backwards time", "LabelJumpBackwardsTime": "Jump backwards time",
"LabelJumpForwardsTime": "Jump forwards time", "LabelJumpForwardsTime": "Jump forwards time",
"LabelLanguage": "Språk", "LabelLanguage": "Språk",
"LabelLayout": "Layout",
"LabelLayoutAuto": "Auto",
"LabelLayoutSinglePage": "Single page",
"LabelLight": "Light", "LabelLight": "Light",
"LabelLineSpacing": "Linjemellomrom", "LabelLineSpacing": "Linjemellomrom",
"LabelListenAgain": "Listen Again", "LabelListenAgain": "Listen Again",

View file

@ -150,6 +150,9 @@
"LabelJumpBackwardsTime": "Jump backwards time", "LabelJumpBackwardsTime": "Jump backwards time",
"LabelJumpForwardsTime": "Jump forwards time", "LabelJumpForwardsTime": "Jump forwards time",
"LabelLanguage": "Język", "LabelLanguage": "Język",
"LabelLayout": "Layout",
"LabelLayoutAuto": "Auto",
"LabelLayoutSinglePage": "Single page",
"LabelLight": "Light", "LabelLight": "Light",
"LabelLineSpacing": "Line spacing", "LabelLineSpacing": "Line spacing",
"LabelListenAgain": "Listen Again", "LabelListenAgain": "Listen Again",

View file

@ -150,6 +150,9 @@
"LabelJumpBackwardsTime": "Перемотка назад", "LabelJumpBackwardsTime": "Перемотка назад",
"LabelJumpForwardsTime": "Перемотка вперед", "LabelJumpForwardsTime": "Перемотка вперед",
"LabelLanguage": "Язык", "LabelLanguage": "Язык",
"LabelLayout": "Layout",
"LabelLayoutAuto": "Auto",
"LabelLayoutSinglePage": "Single page",
"LabelLight": "Подсветка", "LabelLight": "Подсветка",
"LabelLineSpacing": "Межстрочный интервал", "LabelLineSpacing": "Межстрочный интервал",
"LabelListenAgain": "Слушать снова", "LabelListenAgain": "Слушать снова",

View file

@ -150,6 +150,9 @@
"LabelJumpBackwardsTime": "Jump backwards time", "LabelJumpBackwardsTime": "Jump backwards time",
"LabelJumpForwardsTime": "Jump forwards time", "LabelJumpForwardsTime": "Jump forwards time",
"LabelLanguage": "Språk", "LabelLanguage": "Språk",
"LabelLayout": "Layout",
"LabelLayoutAuto": "Auto",
"LabelLayoutSinglePage": "Single page",
"LabelLight": "Light", "LabelLight": "Light",
"LabelLineSpacing": "Radavstånd", "LabelLineSpacing": "Radavstånd",
"LabelListenAgain": "Listen Again", "LabelListenAgain": "Listen Again",

View file

@ -150,6 +150,9 @@
"LabelJumpBackwardsTime": "快退时间", "LabelJumpBackwardsTime": "快退时间",
"LabelJumpForwardsTime": "快进时间", "LabelJumpForwardsTime": "快进时间",
"LabelLanguage": "语言", "LabelLanguage": "语言",
"LabelLayout": "Layout",
"LabelLayoutAuto": "Auto",
"LabelLayoutSinglePage": "Single page",
"LabelLight": "轻", "LabelLight": "轻",
"LabelLineSpacing": "行间距", "LabelLineSpacing": "行间距",
"LabelListenAgain": "再次收听", "LabelListenAgain": "再次收听",