From d9c389812ac03cef602b837adaf428230bcfe4ab Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Sun, 23 Jun 2019 15:51:55 +0700 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D0=BD=D0=BE=D0=B2=D1=8B=D0=B9=20=D0=B2=D0=B0=D1=80?= =?UTF-8?q?=D0=B8=D0=B0=D0=BD=D1=82=20=D0=B0=D0=BD=D0=B8=D0=BC=D0=B0=D1=86?= =?UTF-8?q?=D0=B8=D0=B8=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BB=D0=B8=D1=81=D1=82?= =?UTF-8?q?=D1=8B=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20-=20=D0=BB=D0=B8=D1=81?= =?UTF-8?q?=D1=82=D0=B0=D0=BD=D0=B8=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Reader/SettingsPage/SettingsPage.vue | 5 ++++ .../components/Reader/TextPage/DrawHelper.js | 24 +++++++++++++++++++ .../components/Reader/TextPage/TextPage.vue | 8 +++++-- client/store/modules/reader.js | 4 ++-- 4 files changed, 37 insertions(+), 4 deletions(-) diff --git a/client/components/Reader/SettingsPage/SettingsPage.vue b/client/components/Reader/SettingsPage/SettingsPage.vue index 560112ec..ec20e6f8 100644 --- a/client/components/Reader/SettingsPage/SettingsPage.vue +++ b/client/components/Reader/SettingsPage/SettingsPage.vue @@ -382,6 +382,7 @@ + @@ -540,6 +541,10 @@ export default @Component({ const font = (newValue ? newValue : this.fontName); this.vertShift = this.fontShifts[font] || 0; }, + wallpaper: function(newValue) { + if (newValue != '' && this.pageChangeAnimation == 'flip') + this.pageChangeAnimation = ''; + }, }, }) class SettingsPage extends Vue { diff --git a/client/components/Reader/TextPage/DrawHelper.js b/client/components/Reader/TextPage/DrawHelper.js index 4d4f4f27..d6f08c74 100644 --- a/client/components/Reader/TextPage/DrawHelper.js +++ b/client/components/Reader/TextPage/DrawHelper.js @@ -346,5 +346,29 @@ export default class DrawHelper { } } + async doPageAnimationFlip(page1, page2, duration, isDown, animation1Finish, animation2Finish, backgroundColor) { + page2.style.background = backgroundColor; + + if (isDown) { + page2.style.transformOrigin = '10%'; + await sleep(30); + + page2.style.transformOrigin = '0%'; + page2.style.transition = `${duration}ms ease-in-out`; + page2.style.transform = `rotateY(-120deg)`; + await animation2Finish(duration); + } else { + page2.style.transformOrigin = '90%'; + await sleep(30); + + page2.style.transformOrigin = '100%'; + page2.style.transition = `${duration}ms ease-in-out`; + page2.style.transform = `rotateY(120deg)`; + await animation2Finish(duration); + } + + page2.style.transformOrigin = 'center'; + page2.style.background = ''; + } } \ No newline at end of file diff --git a/client/components/Reader/TextPage/TextPage.vue b/client/components/Reader/TextPage/TextPage.vue index 2d45c5a0..7f30365c 100644 --- a/client/components/Reader/TextPage/TextPage.vue +++ b/client/components/Reader/TextPage/TextPage.vue @@ -229,8 +229,8 @@ class TextPage extends Vue { let page1 = this.$refs.scrollBox1; let page2 = this.$refs.scrollBox2; - page1.style.perspective = '1200px'; - page2.style.perspective = '1200px'; + page1.style.perspective = '3072px'; + page2.style.perspective = '3072px'; page1.style.width = this.w + this.indentLR + 'px'; page2.style.width = this.w + this.indentLR + 'px'; @@ -665,6 +665,10 @@ class TextPage extends Vue { await this.drawHelper.doPageAnimationRotate(page1, page2, duration, this.pageChangeDirectionDown, transition1Finish, transition2Finish); break; + case 'flip': + await this.drawHelper.doPageAnimationFlip(page1, page2, + duration, this.pageChangeDirectionDown, transition1Finish, transition2Finish, this.backgroundColor); + break; } this.resolveAnimation1Finish = null; diff --git a/client/store/modules/reader.js b/client/store/modules/reader.js index 30be9bb2..40bf14f2 100644 --- a/client/store/modules/reader.js +++ b/client/store/modules/reader.js @@ -153,7 +153,7 @@ const settingDefaults = { indentLR: 15,// px, отступ всего текста слева и справа indentTB: 0,// px, отступ всего текста сверху и снизу wordWrap: true,//перенос по слогам - keepLastToFirst: true,// перенос последней строки в первую при листании + keepLastToFirst: false,// перенос последней строки в первую при листании showStatusBar: true, statusBarTop: false,// top, bottom @@ -163,7 +163,7 @@ const settingDefaults = { scrollingDelay: 3000,// замедление, ms scrollingType: 'ease-in-out', //linear, ease, ease-in, ease-out, ease-in-out - pageChangeAnimation: 'blink',// '' - нет, downShift, rightShift, thaw - протаивание, blink - мерцание, rotate - вращение, flip - перелистывание + pageChangeAnimation: 'flip',// '' - нет, downShift, rightShift, thaw - протаивание, blink - мерцание, rotate - вращение, flip - листание pageChangeAnimationSpeed: 80, //0-100% allowUrlParamBookPos: false,