master
grgr 3 years ago
commit 6c4186b6b7

@ -11,12 +11,21 @@ const printLib = document.getElementById("btn-print");
window.addEventListener("load", () => { window.addEventListener("load", () => {
fetchContents(); fetchContents();
atlasLink(); atlasLink();
//document.getElementsByTagName("head")[0].appendChild(pagedjs);
}); });
printLib.addEventListener("click", () => { printLib.addEventListener("click", () => {
printViewToggle(); document.getElementsByTagName("head")[0].appendChild(pagedjs);
console.log(btnPrint);
// pardon for this is really stupid but it works
setTimeout(() => {
let sections = [".libretto", ".container", ".content", ".contribution", ".contributions"];
for (const section of sections) {
for (const el of document.querySelectorAll(section)) {
el.classList.add("full-height");
}
}
}, 1000);
}); });
function fetchContents() { function fetchContents() {
@ -57,10 +66,11 @@ function atlasLink() {
} }
function createIndexSection(contribution) { function createIndexSection(contribution) {
let table = document.createElement("table"); if (contribution.audio) {
let title = document.createElement("h4"); let table = document.createElement("table");
title.innerHTML = contribution.title; let title = document.createElement("div");
if (contribution.audio){ title.classList.add("index-title");
title.innerHTML = contribution.title;
let tracks = contribution.audio; let tracks = contribution.audio;
tracks.forEach((track) => { tracks.forEach((track) => {
let row = document.createElement("tr"); let row = document.createElement("tr");

@ -2,10 +2,10 @@
@page { @page {
size: A5; size: A5;
margin-top: 10mm; margin-top: 5mm;
margin-right: 20mm; margin-right: 10mm;
margin-bottom: 25mm; margin-bottom: 20mm;
margin-left: 15mm; margin-left: 7.5mm;
} }
html, body { html, body {
@ -16,19 +16,26 @@
display: block; display: block;
width: auto; width: auto;
height: auto; height: auto;
} }
/* .container,
.libretto{
height: 100%;
} */
.atlas { .atlas {
border: none; border: none;
} }
.atlas svg {
height: 100%;
width: 100%;
}
.index-title {
font-weight: bold;
margin-top: 16px;
}
.contributions, .contributions,
.contribution { .contribution {
border-bottom: none; border-bottom: none;
@ -78,8 +85,8 @@
} }
.libretto { .libretto {
overflow-y: hidden; overflow: hidden;
overflow-x: hidden; /* height:100%; */
} }
.libretto > *{ .libretto > *{
@ -96,7 +103,8 @@
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
} }
/*Sorry Gi, the multicolumn layout is too painful */ /*Sorry Gi, the multicolumn layout is too painful */
/* .contribution .content{ /* .contribution .content{
@ -116,4 +124,9 @@
display: none; display: none;
} }
.full-height {
height: 100%;
}
} }
Loading…
Cancel
Save