modif des notes

This commit is contained in:
Valentin
2024-03-21 21:45:49 +01:00
parent 20540db49c
commit f9d6d916b5
18 changed files with 141 additions and 173 deletions
@@ -87,21 +87,10 @@ if (debug) console.log('start colors');
if (bibliographie) {
bibliographie.style.color = atelierColor;
// set bg et sprays
let bibliographiePage = bibliographie.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement; // désolé
let bibliographiePage = bibliographie.closest('.pagedjs_page');
bibliographiePage.style.backgroundColor = bgColor;
let nextPage;
if (bibliographiePage.parentElement.classList.contains('pagedjs_sheet')) {
nextPage = bibliographiePage.parentElement?.parentElement?.nextElementSibling?.firstElementChild;
} else {
nextPage = bibliographiePage.parentElement?.nextElementSibling?.firstElementChild;
}
if (!bibliographie.closest('.pagedjs_page').previousElementSibling.querySelector('.bibliographie')) {
if (nextPage) {
nextPage.style.backgroundColor = bgColor;
}
if (bibliographiePage.classList.contains('pagedjs_left_page')) {
let sprayImg = document.createElement('img');
sprayImg.setAttribute('src', sprays[atelierIndex - 1]);
sprayImg.style.height = "242mm";
@@ -110,13 +99,12 @@ if (debug) console.log('start colors');
sprayImg.style.top = "-22mm";
sprayImg.style.right = "-20mm";
sprayImg.style.mixBlendMode = "multiply";
sprayImg.style.opacity = "0.75";
let nextBiblioPageEl = bibliographiePage.parentElement.nextElementSibling?.querySelector('.bibliographie');
if (nextBiblioPageEl) {
bibliographiePage.parentElement.nextElementSibling?.querySelector('.bibliographie').insertAdjacentElement("afterend", sprayImg);
} else {
bibliographiePage.parentElement.parentElement.nextElementSibling?.querySelector('.pagedjs_page_content').appendChild(sprayImg);
if (!bibliographiePage.nextElementSibling.querySelector('.bibliographie')) {
bibliographiePage.nextElementSibling.style.backgroundColor = bgColor;
}
bibliographiePage.nextElementSibling.querySelector('.pagedjs_page_content').appendChild(sprayImg);
}
}
@@ -48,8 +48,8 @@ if (debug) console.log('start imgsFullspread');
}
if (fullspreadEl.classList.contains('doublepage_bigleft')
|| fullspreadEl.classList.contains('doublepage_bigright')) {
let smallImgSrc = fullspreadEl.lastElementChild?.getAttribute('src');
fullspreadEl.lastElementChild?.remove();
let smallImgSrc = fullspreadEl.querySelector('img:last-of-type')?.getAttribute('src');
fullspreadEl.querySelector('img:last-of-type')?.remove();
let smallImg = document.createElement('img');
smallImg.setAttribute('src', smallImgSrc);
let smallImgEl = document.createElement('div');
@@ -32,6 +32,10 @@ if (debug) console.log('start inserts');
plainColor.style.top = "-22mm";
encart.parentNode.prepend(plainColor);
}
if (encart.previousElementSibling?.classList.contains('breakbefore')) {
encart.style.marginTop = "0mm";
}
}
})();