images lowres + modifs pages titres

This commit is contained in:
Valentin
2023-07-22 05:18:51 +02:00
parent fdc4c7f6a0
commit fd20768958
2728 changed files with 234 additions and 166686 deletions
+10 -4
View File
@@ -116,9 +116,15 @@ for(let i = 0; i < contentToParse.length; i++) {
// PAGES TITRES
let h3s = document.querySelectorAll('h3');
for (let h3 of h3s) {
if (h3.nextElementSibling.firstChild.tagName == 'IMG') {
h3.style.width = "50%";
h3.nextElementSibling.firstChild.style.width = "60%";
h3.innerHTML = h3.innerHTML.replace(/[^\s]*/, `<div class="gros-chiffre">${1}</div>`);
if (/^\d/.test(h3.innerText)) {
h3.innerHTML = h3.innerHTML.replace(/[^\s]*/, function(match) {
return `<div class="gros-chiffre">${match}</div>`;
});
}
}
let dessinsPreH3 = document.querySelectorAll('h3 + p img');
for (let dessin of dessinsPreH3) {
dessin.style.width = '0px';
dessin.style.height = '0px';
}