titlePages.js 920 B

12345678910111213141516171819202122232425262728293031323334
  1. // composition des pages titres
  2. if (debug) console.log('start titlePages');
  3. (function() {
  4. let h3s = document.querySelectorAll('h3');
  5. for (let h3 of h3s) {
  6. if (/^\d/.test(h3.innerText)) {
  7. h3.innerHTML = h3.innerHTML.replace(/[^\s]*/, function(match) {
  8. return `<div class="gros-chiffre">${match}</div>`;
  9. });
  10. }
  11. h3.innerHTML = h3.innerHTML.replace(/ \«/g, '<br>«');
  12. }
  13. let dessinsPreH3 = document.querySelectorAll('h3 + p img');
  14. for (let dessin of dessinsPreH3) {
  15. dessin.style.width = '0px';
  16. dessin.style.height = '0px';
  17. }
  18. // pour les serpentins
  19. let h4s = document.querySelectorAll('h4');
  20. for (let h4 of h4s) {
  21. if (h4.innerText === "Serpentin") {
  22. let serpentin = h4.nextElementSibling.nextElementSibling;
  23. serpentin.nextElementSibling.remove();
  24. h4.remove();
  25. }
  26. }
  27. })();
  28. if (debug) console.log('end titlePages');