page titre et loader

This commit is contained in:
Valentin
2023-07-07 06:19:13 +02:00
parent 24c2cfc2f9
commit 0c1f3d9e91
11 changed files with 153 additions and 203 deletions
@@ -125,6 +125,59 @@ class setMarginTexts extends Paged.Handler {
encarts[i].parentNode.prepend(plainColor);
}
}
// TITRES
let h3s = document.querySelectorAll('h3');
for (let h3 of h3s) {
if (h3.nextSibling.firstChild.tagName == "IMG") {
h3.style.position = "absolute";
h3.style.top = "40%";
h3.nextSibling.style.position = "absolute";
h3.nextSibling.style.top = "5%";
}
if (h3.closest('.pagedjs_page').nextElementSibling.querySelector('.has-children ')?.firstChild.firstChild.firstChild.tagName == "IMG") {
let coverImg = h3.closest('.pagedjs_page').nextElementSibling.querySelector('.has-children ').firstChild.childNodes[0];
coverImg.style.position = "absolute";
coverImg.style.top = "-22mm";
coverImg.style.left = "96mm";
coverImg.style.height = "220mm";
coverImg.style.width = "53mm";
coverImg.style.overflow = "hidden";
coverImg.firstChild.style.height = "100%";
coverImg.firstChild.style.width = "auto";
console.log(coverImg);
h3.parentElement.append(coverImg);
let nextImg = document.createElement('img');
nextImg.setAttribute('src', coverImg.firstChild.getAttribute('src'));
h3.closest('.pagedjs_page').nextElementSibling.querySelector('.has-children ').append(nextImg);
nextImg.parentElement.style.position = "absolute";
nextImg.parentElement.style.top = "-22mm";
nextImg.parentElement.style.left = "-8mm";
nextImg.parentElement.style.height = "220mm";
nextImg.parentElement.style.width = "171mm";
nextImg.parentElement.style.overflow = "hidden";
nextImg.style.height = "100%";
nextImg.style.width = "auto";
nextImg.style.marginLeft = "-53mm";
}
h3.closest('.pagedjs_pagebox').querySelector('.pagedjs_margin-left').innerHTML = '';
}
let h4s = document.querySelectorAll('h4');
for (let h4 of h4s) {
if (h4.nextElementSibling?.classList.contains('bibliographie')) {
h4.style.color = "#d98a29";
}
}
// loading
document.querySelector('body').style.opacity = "1";
document.querySelector('body').style.overflow = "scroll";
}
}
Paged.registerHandlers(setMarginTexts);