Commit 68ab6700 authored by Fred Chasen's avatar Fred Chasen

Add blank page

parent eb258e73
......@@ -24,11 +24,6 @@
}
}
let pages = document.querySelector(".pages");
let scale = ((window.innerWidth * .9 ) / pages.offsetWidth);
pages.style.transform = `scale(${scale}) translate(${(window.innerWidth / 2) - ((pages.offsetWidth * scale / 2) ) }px, 0)`;
let inputElement = document.getElementById("input");
inputElement.addEventListener('change', function (e) {
......@@ -106,6 +101,16 @@
console.log("Rendering " + flow.total + " pages took " + (t1 - t0) + " milliseconds.");
});
let resizer = () => {
let pages = document.querySelector(".pages");
let scale = ((window.innerWidth * .9 ) / pages.offsetWidth);
pages.style.transform = `scale(${scale}) translate(${(window.innerWidth / 2) - ((pages.offsetWidth * scale / 2) ) }px, 0)`;
};
resizer();
window.addEventListener("resize", resizer, false);
epub = undefined;
});
}
......
......@@ -6,10 +6,11 @@ import Renderer from "./renderer";
* @class
*/
class Page {
constructor(pagesArea, pageTemplate, name) {
constructor(pagesArea, pageTemplate, name, blank) {
this.pagesArea = pagesArea;
this.pageTemplate = pageTemplate;
this.name = name;
this.blank = blank;
// this.mapper = new Mapping(undefined, undefined, undefined, true);
......@@ -40,7 +41,11 @@ class Page {
if (this.name) {
page.classList.add(this.name + "_page");
}
if (this.blank) {
page.classList.add("blank_page");
}
if (pgnum === 0) {
page.classList.add("first_page");
}
......
......@@ -52,11 +52,11 @@ class Section {
}
if (this.breaks.before === "right" && this.startPage % 2 > 0) {
this.addPage();
this.addPage(true);
}
if (this.breaks.before === "left" && this.startPage % 2 === 0) {
this.addPage();
this.addPage(true);
}
while (!done) {
......@@ -99,9 +99,9 @@ class Section {
}
addPage() {
addPage(blank) {
// Create a new page from the template
let page = new Page(this.pagesArea, this.pageTemplate, this.name);
let page = new Page(this.pagesArea, this.pageTemplate, this.name, blank);
let total = this.pages.push(page);
// Create the pages
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment