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
+12 -1
View File
@@ -1,3 +1,4 @@
// transformer les balises [...] en <div class="...">
let bodyContent = $('#body').html()
.replace(/\[([^\/\]]+)\]/g, '<div class="$1">')
@@ -72,4 +73,14 @@ for(let i = 0; i < contentToParse.length; i++) {
contentToParse[i].childNodes[j].innerHTML = contentToParse[i].childNodes[j].innerHTML.replaceAll(' min', '&nbsp;min');
}
}
}
}
// 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>`);
}
}