|
|
|
|
@ -31,6 +31,29 @@ if (hrs.length > 2) {
|
|
|
|
|
// Remove the footnote links
|
|
|
|
|
u(document.getElementsByClassName('footnote-backref')).remove()
|
|
|
|
|
|
|
|
|
|
// space to full pages and add kirby background on every page
|
|
|
|
|
window.addEventListener('load', function () {
|
|
|
|
|
const pageHeightInPx = 869
|
|
|
|
|
const docHeight = document.children[0].offsetHeight
|
|
|
|
|
const pages = Math.ceil(docHeight/pageHeightInPx)
|
|
|
|
|
if((docHeight/pageHeightInPx)%1 != 0) {
|
|
|
|
|
// need spacing
|
|
|
|
|
const spacer = document.evaluate('//*[@id="spacer"]', document).iterateNext()
|
|
|
|
|
// spacer.style.border = "5px solid red"
|
|
|
|
|
spacer.style.height = `${(pages*pageHeightInPx) - docHeight}px`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const imageString = 'url("../../recipeskirby.svg")'
|
|
|
|
|
imageArray = [imageString]
|
|
|
|
|
let positionString = "background-position: 10mm 55mm"
|
|
|
|
|
for(let i = 1 ; i < pages ; i+=1) {
|
|
|
|
|
positionString += `, 10mm ${230*i+55}mm`
|
|
|
|
|
imageArray.push(imageString)
|
|
|
|
|
}
|
|
|
|
|
const styleString = `body { background-image: ${imageArray.join(', ')}; ${positionString}; background-blend-mode: luminosity; background-repeat: no-repeat; }`
|
|
|
|
|
window.document.styleSheets[2].insertRule(styleString, 0)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// Break ingredients into column-able blocks
|
|
|
|
|
window.addEventListener('load', function () {
|
|
|
|
|
const zutatenNode = document.evaluate('//*[@id="zutaten"]', document).iterateNext()
|
|
|
|
|
@ -64,5 +87,4 @@ window.addEventListener('load', function () {
|
|
|
|
|
nodeBlockIndex += 1
|
|
|
|
|
})
|
|
|
|
|
zutatenNode.parentNode.insertBefore(allIngredientsDiv, zutatenNode.nextSibling)
|
|
|
|
|
console.log("Finished fiddling")
|
|
|
|
|
})
|
|
|
|
|
|