entretien erg + iyo-bisseck retouche
This commit is contained in:
parent
38c510c658
commit
6a45e2bf36
152 changed files with 289 additions and 188 deletions
|
|
@ -102,23 +102,21 @@ class subtitlesDecor extends Paged.Handler {
|
|||
|
||||
beforeParsed(content){
|
||||
content.querySelectorAll("h3, h4").forEach(subtitle => {
|
||||
const block = subtitle.closest('.block');
|
||||
const block = subtitle.closest('.block');
|
||||
const nextBlock = block?.nextElementSibling;
|
||||
|
||||
if (!nextBlock) return;
|
||||
|
||||
const firstP = nextBlock.querySelector('p');
|
||||
|
||||
if (!firstP) return;
|
||||
|
||||
if (subtitle.tagName === "H3") {
|
||||
firstP.classList.add("following-h3");
|
||||
}
|
||||
|
||||
if (subtitle.tagName === "H4") {
|
||||
firstP.classList.add("following-h4");
|
||||
}
|
||||
if (subtitle.tagName === "H3") firstP.classList.add("following-h3");
|
||||
if (subtitle.tagName === "H4") firstP.classList.add("following-h4");
|
||||
});
|
||||
|
||||
// content.querySelectorAll("h5, h6").forEach(subtitle => {
|
||||
// const nextSibling = subtitle.nextElementSibling;
|
||||
// if (!nextSibling || nextSibling.tagName !== "P") return;
|
||||
// if (subtitle.tagName === "H5") nextSibling.classList.add("following-h5");
|
||||
// if (subtitle.tagName === "H6") nextSibling.classList.add("following-h6");
|
||||
// });
|
||||
content.querySelectorAll(".chapter-content").forEach(chapter => {
|
||||
let pfirst = chapter.querySelector('p');
|
||||
pfirst.classList.add("first-p");
|
||||
|
|
@ -144,20 +142,20 @@ class subtitlesDecor extends Paged.Handler {
|
|||
// container.appendChild(subtitle);
|
||||
// });
|
||||
|
||||
pageElement.querySelectorAll("h6").forEach(h6 => {
|
||||
if (h6.closest(".h6_container")) return;
|
||||
const smallSizes = [1, 2, 3, 2, 1];
|
||||
const bigSizes = [1, 2, 3, 4, 5, 4, 3, 2, 1];
|
||||
const firstDecor = isLeft
|
||||
? this.createDecor(symbol, smallSizes, "decor-h6_small", "decor-h6")
|
||||
: this.createDecor(symbol, bigSizes, "decor-h6_big", "decor-h6");
|
||||
const container = document.createElement("div");
|
||||
container.className = "h6_container " + h6.className;
|
||||
h6.className = "";
|
||||
h6.parentNode.insertBefore(container, h6);
|
||||
container.appendChild(firstDecor);
|
||||
container.appendChild(h6);
|
||||
});
|
||||
// pageElement.querySelectorAll("h6").forEach(h6 => {
|
||||
// if (h6.closest(".h6_container")) return;
|
||||
// const smallSizes = [1, 2, 3, 2, 1];
|
||||
// const bigSizes = [1, 2, 3, 4, 5, 4, 3, 2, 1];
|
||||
// const firstDecor = isLeft
|
||||
// ? this.createDecor(symbol, smallSizes, "decor-h6_small", "decor-h6")
|
||||
// : this.createDecor(symbol, bigSizes, "decor-h6_big", "decor-h6");
|
||||
// const container = document.createElement("div");
|
||||
// container.className = "h6_container " + h6.className;
|
||||
// h6.className = "";
|
||||
// h6.parentNode.insertBefore(container, h6);
|
||||
// container.appendChild(firstDecor);
|
||||
// container.appendChild(h6);
|
||||
// });
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue