diff --git a/frontend/protos/index.html b/frontend/protos/index.html index 13a6f1a..c9c0bcd 100644 --- a/frontend/protos/index.html +++ b/frontend/protos/index.html @@ -10,7 +10,7 @@ - + @@ -99,10 +99,29 @@ addClassToElement('#div_principale','principale'); addClassToElement('#div_footer','footer'); + const section_header=document.querySelector('#div_header'); const section_navbar=document.querySelector('#div_navbar'); const section_synthese=document.querySelector('#div_synthese'); + + const after_section_header=document.querySelector('#div_after_header'); const after_section_synthese=document.querySelector('#div_after_synthese'); + function toggleElement(element) { + if (element.style.display === "block") { + element.style.display = "none"; + } else { + element.style.display = "block"; + } + } + + after_section_header.addEventListener("click", function() { + toggleElement(section_header); + }); + + after_section_synthese.addEventListener("click", function() { + toggleElement(section_synthese); + }); + function scrollToElement(elementSelector) { const element = document.querySelector(elementSelector); if (element) { @@ -145,14 +164,6 @@ etatSections(currentEtat); } - after_section_synthese.addEventListener("click", function() { - if (section_synthese.style.display === "block") { - section_synthese.style.display = "none"; - } else { - section_synthese.style.display = "block"; - } - }); - function beforeHeaderVisibility(_visible) { intersectionObserverLog('TRIGGER '+arguments.callee.name); if (!_visible) {