diff --git a/public/js/reader.js b/public/js/reader.js index 79943af..575d3ba 100644 --- a/public/js/reader.js +++ b/public/js/reader.js @@ -6,6 +6,7 @@ const readerComponent = () => { alertClass: 'uk-alert-primary', items: [], curItem: {}, + enableFlipAnimation: true, flipAnimation: null, longPages: false, lastSavedPage: page, @@ -60,6 +61,9 @@ const readerComponent = () => { for (let idx = page + 1; idx <= limit; idx++) { this.preloadImage(this.items[idx - 1].url); } + + const savedFlipAnimation = localStorage.getItem('enableFlipAnimation'); + this.enableFlipAnimation = savedFlipAnimation === null || savedFlipAnimation === 'true'; }) .catch(e => { const errMsg = `Failed to get the page dimensions. ${e}`; @@ -131,10 +135,12 @@ const readerComponent = () => { this.toPage(newIdx); - if (isNext) - this.flipAnimation = 'right'; - else - this.flipAnimation = 'left'; + if (this.enableFlipAnimation) { + if (isNext) + this.flipAnimation = 'right'; + else + this.flipAnimation = 'left'; + } setTimeout(() => { this.flipAnimation = null; @@ -309,6 +315,10 @@ const readerComponent = () => { preloadLookaheadChanged() { localStorage.setItem('preloadLookahead', this.preloadLookahead); - } + }, + + enableFlipAnimationChanged() { + localStorage.setItem('enableFlipAnimation', this.enableFlipAnimation); + }, }; } diff --git a/src/views/reader.html.ecr b/src/views/reader.html.ecr index 3d90a10..0e46ed2 100644 --- a/src/views/reader.html.ecr +++ b/src/views/reader.html.ecr @@ -101,7 +101,13 @@ -
+
+ +
+ +
+
+