diff --git a/client/components/Reader/SettingsPage/include/ViewTab/Mode.inc b/client/components/Reader/SettingsPage/include/ViewTab/Mode.inc index 453e77c3..2d75bc0e 100644 --- a/client/components/Reader/SettingsPage/include/ViewTab/Mode.inc +++ b/client/components/Reader/SettingsPage/include/ViewTab/Mode.inc @@ -8,13 +8,86 @@ +
Страницы
-
Отступ
+
Отступ границ
- + + + Слева/справа от края экрана + + +
+ + + Сверху/снизу от края экрана + + +
+
+ +
+
Отступ внутри
+
+ Слева/справа внутри страницы
+
+ +
+
Разделитель
+
+
Ширина (px)
+
+ + + Ширина разделителя + + +
+
+ +
+
Высота (%)
+
+ + + Высота разделителя + + +
+
+ +
+
Прозрачность
+
+ +
+
+ +
+
Заполнение (px)
+
+ + + Заполнение пунктира + + +
+
+ +
+
Промежуток (px)
+
+ + + Промежуток пунктира + + +
+
+
\ No newline at end of file diff --git a/client/components/Reader/SettingsPage/include/ViewTab/Text.inc b/client/components/Reader/SettingsPage/include/ViewTab/Text.inc index 43b0c4c9..3df77486 100644 --- a/client/components/Reader/SettingsPage/include/ViewTab/Text.inc +++ b/client/components/Reader/SettingsPage/include/ViewTab/Text.inc @@ -15,23 +15,6 @@
-
-
Отступ
-
- - - Слева/справа - - -
- - - Сверху/снизу - - -
-
-
Сдвиг
diff --git a/client/components/Reader/TextPage/DrawHelper.js b/client/components/Reader/TextPage/DrawHelper.js index b65dd83d..4ba93cdf 100644 --- a/client/components/Reader/TextPage/DrawHelper.js +++ b/client/components/Reader/TextPage/DrawHelper.js @@ -130,9 +130,9 @@ export default class DrawHelper { const justify = (this.textAlignJustify ? 'text-align: justify; text-align-last: justify;' : ''); const boxH = this.h + (isScrolling ? this.lineHeight : 0); - let out = `
`; + let out = `
`; let imageDrawn1 = new Set(); let imageDrawn2 = new Set(); @@ -165,18 +165,34 @@ export default class DrawHelper { //отрисовка строк if (!this.dualPageMode) { + out += `
`; for (let i = 0; i < len; i++) { out += this.drawLine(lines[i], i, 0, sel, imageDrawn1); } + out += `
`; } else { - out += `
`; - const l2 = parseInt(Math.ceil(len/2), 10); + //левая страница + out += `
`; + const l2 = (this.pageRowsCount > len ? len : this.pageRowsCount); for (let i = 0; i < l2; i++) { out += this.drawLine(lines[i], i, 0, sel, imageDrawn1); } out += '
'; - out += `
`; + //разделитель + out += `
` + + `
` + + `
` + + `
` + + `
` + + `
`; + + //правая страница + out += `
`; for (let i = l2; i < len; i++) { out += this.drawLine(lines[i], i, l2, sel, imageDrawn2); } diff --git a/client/components/Reader/TextPage/TextPage.vue b/client/components/Reader/TextPage/TextPage.vue index 56998bdc..45d2921f 100644 --- a/client/components/Reader/TextPage/TextPage.vue +++ b/client/components/Reader/TextPage/TextPage.vue @@ -169,8 +169,8 @@ class TextPage extends Vue { this.h = this.scrollHeight - 2*this.indentTB; this.lineHeight = this.fontSize + this.lineInterval; - const pageRowsCount = 1 + Math.floor((this.h - this.lineHeight + this.lineInterval/2)/this.lineHeight); - this.pageLineCount = (this.dualPageMode ? pageRowsCount*2 : pageRowsCount) + this.pageRowsCount = 1 + Math.floor((this.h - this.lineHeight + this.lineInterval/2)/this.lineHeight); + this.pageLineCount = (this.dualPageMode ? this.pageRowsCount*2 : this.pageRowsCount) //stuff this.currentAnimation = ''; @@ -190,8 +190,16 @@ class TextPage extends Vue { this.drawHelper.lastBook = this.lastBook; this.drawHelper.book = this.book; this.drawHelper.parsed = this.parsed; + this.drawHelper.pageRowsCount = this.pageRowsCount; this.drawHelper.pageLineCount = this.pageLineCount; + this.drawHelper.dualPageMode = this.dualPageMode; + this.drawHelper.dualIndentLR = this.dualIndentLR; + this.drawHelper.dualDivWidth = this.dualDivWidth; + this.drawHelper.dualDivHeight = this.dualDivHeight; + this.drawHelper.dualDivColor = this.hex2rgba(this.textColor || '#000000', this.dualDivColorAlpha); + this.drawHelper.dualDivStrokeFill = this.dualDivStrokeFill; + this.drawHelper.dualDivStrokeGap = this.dualDivStrokeGap; this.drawHelper.backgroundColor = this.backgroundColor; this.drawHelper.statusBarColor = this.statusBarColor; @@ -207,7 +215,6 @@ class TextPage extends Vue { this.drawHelper.w = this.w; this.drawHelper.h = this.h; this.drawHelper.indentLR = this.indentLR; - this.drawHelper.dualIndentLR = this.dualIndentLR; this.drawHelper.textAlignJustify = this.textAlignJustify; this.drawHelper.lineHeight = this.lineHeight; this.drawHelper.context = this.context; @@ -259,7 +266,7 @@ class TextPage extends Vue { } //scrolling page - const pageSpace = this.scrollHeight - pageRowsCount*this.lineHeight; + const pageSpace = this.scrollHeight - this.pageRowsCount*this.lineHeight; let top = pageSpace/2; if (this.showStatusBar) top += this.statusBarHeight*(this.statusBarTop ? 1 : 0); diff --git a/client/store/modules/reader.js b/client/store/modules/reader.js index dafa04ec..ec81a923 100644 --- a/client/store/modules/reader.js +++ b/client/store/modules/reader.js @@ -225,8 +225,14 @@ const settingDefaults = { indentTB: 0,// px, отступ всего текста сверху и снизу wordWrap: true,//перенос по слогам keepLastToFirst: false,// перенос последней строки в первую при листании + dualPageMode: false, dualIndentLR: 10,// px, отступ слева и справа внутри страницы в двухстраничном режиме + dualDivWidth: 4,// px, ширина разделителя + dualDivHeight: 96,// процент, высота разделителя + dualDivColorAlpha: 1,// прозрачность разделителя + dualDivStrokeFill: 1,// px, заполнение пунктира + dualDivStrokeGap: 1,// px, промежуток пунктира showStatusBar: true, statusBarTop: false,// top, bottom