Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0341cc1630 | ||
|
|
d307d233f0 | ||
|
|
5931b9625b | ||
|
|
fb837f5b97 | ||
|
|
8cfe95b3cf | ||
|
|
5fd73ac1e1 | ||
|
|
b51a574038 | ||
|
|
51b39f0775 | ||
|
|
17c4f96c94 |
@@ -2,9 +2,10 @@
|
|||||||
<div ref="main" class="main">
|
<div ref="main" class="main">
|
||||||
<div class="part">
|
<div class="part">
|
||||||
<span class="greeting bold-font">{{ title }}</span>
|
<span class="greeting bold-font">{{ title }}</span>
|
||||||
|
<div class="space"></div>
|
||||||
<span class="greeting">Добро пожаловать!</span>
|
<span class="greeting">Добро пожаловать!</span>
|
||||||
<span class="greeting">Поддерживаются форматы: <b>fb2, html, txt</b> и сжатие: <b>zip, bz2, gz</b></span>
|
<span class="greeting">Поддерживаются форматы: <b>fb2, html, txt</b> и сжатие: <b>zip, bz2, gz</b></span>
|
||||||
<span v-if="isExternalConverter" class="greeting">...а также: <b>rtf, doc, docx, pdf, epub, mobi</b></span>
|
<span v-if="isExternalConverter" class="greeting">...а также форматы: <b>rtf, doc, docx, pdf, epub, mobi</b></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="part center">
|
<div class="part center">
|
||||||
@@ -129,6 +130,7 @@ class LoaderPage extends Vue {
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
min-height: 340px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.part {
|
.part {
|
||||||
@@ -140,8 +142,8 @@ class LoaderPage extends Vue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.greeting {
|
.greeting {
|
||||||
font-size: 130%;
|
font-size: 120%;
|
||||||
line-height: 170%;
|
line-height: 160%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bold-font {
|
.bold-font {
|
||||||
|
|||||||
@@ -251,7 +251,7 @@
|
|||||||
<el-form :model="form" size="mini" label-width="120px" @submit.native.prevent>
|
<el-form :model="form" size="mini" label-width="120px" @submit.native.prevent>
|
||||||
<div class="partHeader">Анимация</div>
|
<div class="partHeader">Анимация</div>
|
||||||
|
|
||||||
<el-form-item label="Вид">
|
<el-form-item label="Тип">
|
||||||
<el-col :span="11">
|
<el-col :span="11">
|
||||||
<el-select v-model="pageChangeAnimation">
|
<el-select v-model="pageChangeAnimation">
|
||||||
<el-option label="Нет" value=""></el-option>
|
<el-option label="Нет" value=""></el-option>
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ export default class DrawHelper {
|
|||||||
|
|
||||||
let out = `<div style="width: ${this.w}px; height: ${this.h + (isScrolling ? this.lineHeight : 0)}px;` +
|
let out = `<div style="width: ${this.w}px; height: ${this.h + (isScrolling ? this.lineHeight : 0)}px;` +
|
||||||
` position: absolute; top: ${this.fontSize*this.textShift}px; color: ${this.textColor}; font: ${font}; ${justify}` +
|
` position: absolute; top: ${this.fontSize*this.textShift}px; color: ${this.textColor}; font: ${font}; ${justify}` +
|
||||||
` line-height: ${this.lineHeight}px; white-space: nowrap; overflow: hidden;">`;
|
` line-height: ${this.lineHeight}px; white-space: nowrap;">`;
|
||||||
|
|
||||||
let imageDrawn = new Set();
|
let imageDrawn = new Set();
|
||||||
let len = lines.length;
|
let len = lines.length;
|
||||||
|
|||||||
@@ -4,13 +4,13 @@
|
|||||||
<div v-html="background"></div>
|
<div v-html="background"></div>
|
||||||
<!-- img -->
|
<!-- img -->
|
||||||
</div>
|
</div>
|
||||||
<div ref="scrollBox1" class="layout" style="overflow: hidden" @wheel.prevent.stop="onMouseWheel">
|
<div ref="scrollBox1" class="layout over-hidden" @wheel.prevent.stop="onMouseWheel">
|
||||||
<div ref="scrollingPage1" class="layout" @transitionend="onPage1TransitionEnd" @animationend="onPage1AnimationEnd">
|
<div ref="scrollingPage1" class="layout over-hidden" @transitionend="onPage1TransitionEnd" @animationend="onPage1AnimationEnd">
|
||||||
<div v-html="page1"></div>
|
<div v-html="page1"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div ref="scrollBox2" class="layout" style="overflow: hidden" @wheel.prevent.stop="onMouseWheel">
|
<div ref="scrollBox2" class="layout over-hidden" @wheel.prevent.stop="onMouseWheel">
|
||||||
<div ref="scrollingPage2" class="layout" @transitionend="onPage2TransitionEnd" @animationend="onPage2AnimationEnd">
|
<div ref="scrollingPage2" class="layout over-hidden" @transitionend="onPage2TransitionEnd" @animationend="onPage2AnimationEnd">
|
||||||
<div v-html="page2"></div>
|
<div v-html="page2"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -157,9 +157,11 @@ class TextPage extends Vue {
|
|||||||
this.$refs.layoutEvents.style.height = this.realHeight + 'px';
|
this.$refs.layoutEvents.style.height = this.realHeight + 'px';
|
||||||
|
|
||||||
this.w = this.realWidth - 2*this.indentLR;
|
this.w = this.realWidth - 2*this.indentLR;
|
||||||
this.h = this.realHeight - (this.showStatusBar ? this.statusBarHeight : 0) - 2*this.indentTB;
|
this.scrollHeight = this.realHeight - (this.showStatusBar ? this.statusBarHeight : 0);
|
||||||
|
this.h = this.scrollHeight - 2*this.indentTB;
|
||||||
this.lineHeight = this.fontSize + this.lineInterval;
|
this.lineHeight = this.fontSize + this.lineInterval;
|
||||||
this.pageLineCount = 1 + Math.floor((this.h - this.fontSize)/this.lineHeight);
|
this.pageLineCount = 1 + Math.floor((this.h - this.lineHeight + this.lineInterval/2)/this.lineHeight);
|
||||||
|
this.pageSpace = this.scrollHeight - this.pageLineCount*this.lineHeight;
|
||||||
|
|
||||||
this.$refs.scrollingPage1.style.width = this.w + 'px';
|
this.$refs.scrollingPage1.style.width = this.w + 'px';
|
||||||
this.$refs.scrollingPage2.style.width = this.w + 'px';
|
this.$refs.scrollingPage2.style.width = this.w + 'px';
|
||||||
@@ -193,6 +195,7 @@ class TextPage extends Vue {
|
|||||||
this.drawHelper.indentLR = this.indentLR;
|
this.drawHelper.indentLR = this.indentLR;
|
||||||
this.drawHelper.textAlignJustify = this.textAlignJustify;
|
this.drawHelper.textAlignJustify = this.textAlignJustify;
|
||||||
this.drawHelper.lineHeight = this.lineHeight;
|
this.drawHelper.lineHeight = this.lineHeight;
|
||||||
|
this.drawHelper.pageSpace = this.pageSpace;
|
||||||
this.drawHelper.context = this.context;
|
this.drawHelper.context = this.context;
|
||||||
|
|
||||||
//сообщение "Загрузка шрифтов..."
|
//сообщение "Загрузка шрифтов..."
|
||||||
@@ -232,20 +235,26 @@ class TextPage extends Vue {
|
|||||||
this.statusBarClickable = this.drawHelper.statusBarClickable(this.statusBarTop, this.statusBarHeight);
|
this.statusBarClickable = this.drawHelper.statusBarClickable(this.statusBarTop, this.statusBarHeight);
|
||||||
|
|
||||||
//scrolling page
|
//scrolling page
|
||||||
const pageDelta = this.h - (this.pageLineCount*this.lineHeight - this.lineInterval);
|
let y = this.pageSpace/2;
|
||||||
let y = this.indentTB + pageDelta/2;
|
|
||||||
if (this.showStatusBar)
|
if (this.showStatusBar)
|
||||||
y += this.statusBarHeight*(this.statusBarTop ? 1 : 0);
|
y += this.statusBarHeight*(this.statusBarTop ? 1 : 0);
|
||||||
const page1 = this.$refs.scrollBox1;
|
let page1 = this.$refs.scrollBox1;
|
||||||
const page2 = this.$refs.scrollBox2;
|
let page2 = this.$refs.scrollBox2;
|
||||||
page1.style.width = this.w + 'px';
|
page1.style.width = this.w + this.indentLR + 'px';
|
||||||
page2.style.width = this.w + 'px';
|
page2.style.width = this.w + this.indentLR + 'px';
|
||||||
page1.style.height = (this.h - pageDelta) + 'px';
|
page1.style.height = this.scrollHeight - (this.pageSpace > 0 ? this.pageSpace : 0) + 'px';
|
||||||
page2.style.height = (this.h - pageDelta) + 'px';
|
page2.style.height = this.scrollHeight - (this.pageSpace > 0 ? this.pageSpace : 0) + 'px';
|
||||||
page1.style.top = y + 'px';
|
page1.style.top = y + 'px';
|
||||||
page2.style.top = y + 'px';
|
page2.style.top = y + 'px';
|
||||||
page1.style.left = this.indentLR + 'px';
|
page1.style.left = this.indentLR + 'px';
|
||||||
page2.style.left = this.indentLR + 'px';
|
page2.style.left = this.indentLR + 'px';
|
||||||
|
|
||||||
|
page1 = this.$refs.scrollingPage1;
|
||||||
|
page2 = this.$refs.scrollingPage2;
|
||||||
|
page1.style.width = this.w + this.indentLR + 'px';
|
||||||
|
page2.style.width = this.w + this.indentLR + 'px';
|
||||||
|
page1.style.height = this.scrollHeight + this.lineHeight + 'px';
|
||||||
|
page2.style.height = this.scrollHeight + this.lineHeight + 'px';
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkLoadedFonts() {
|
async checkLoadedFonts() {
|
||||||
@@ -633,8 +642,14 @@ class TextPage extends Vue {
|
|||||||
duration, this.pageChangeDirectionDown, transition1Finish);
|
duration, this.pageChangeDirectionDown, transition1Finish);
|
||||||
break;
|
break;
|
||||||
case 'downShift':
|
case 'downShift':
|
||||||
|
page1.style.height = this.scrollHeight + 'px';
|
||||||
|
page2.style.height = this.scrollHeight + 'px';
|
||||||
|
|
||||||
await this.drawHelper.doPageAnimationDownShift(page1, page2,
|
await this.drawHelper.doPageAnimationDownShift(page1, page2,
|
||||||
duration, this.pageChangeDirectionDown, transition1Finish);
|
duration, this.pageChangeDirectionDown, transition1Finish);
|
||||||
|
|
||||||
|
page1.style.height = this.scrollHeight + this.lineHeight + 'px';
|
||||||
|
page2.style.height = this.scrollHeight + this.lineHeight + 'px';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1098,6 +1113,10 @@ class TextPage extends Vue {
|
|||||||
z-index: 10;
|
z-index: 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.over-hidden {
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
.back {
|
.back {
|
||||||
z-index: 5;
|
z-index: 5;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "Liberama",
|
"name": "Liberama",
|
||||||
"version": "0.5.4",
|
"version": "0.5.6",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10.0.0"
|
"node": ">=10.0.0"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ class ConvertPdf extends ConvertHtml {
|
|||||||
let title = '';
|
let title = '';
|
||||||
let prevTop = 0;
|
let prevTop = 0;
|
||||||
let i = -1;
|
let i = -1;
|
||||||
|
let titleCount = 0;
|
||||||
|
|
||||||
const loadImage = async(image) => {
|
const loadImage = async(image) => {
|
||||||
const src = path.parse(image.src);
|
const src = path.parse(image.src);
|
||||||
@@ -76,8 +77,10 @@ class ConvertPdf extends ConvertHtml {
|
|||||||
tClose += (bold ? '</b>' : '');
|
tClose += (bold ? '</b>' : '');
|
||||||
|
|
||||||
lines[i].text += `${tOpen}${text}${tClose} `;
|
lines[i].text += `${tOpen}${text}${tClose} `;
|
||||||
if (i < 2)
|
if (titleCount < 2 && text.trim() != '') {
|
||||||
title += text + ' ';
|
title += text + (titleCount ? '' : ' - ');
|
||||||
|
titleCount++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user