1
0
mirror of https://git.topisto.net/tibo/template.git synced 2026-03-31 15:09:10 +00:00

[evo4532] 202601021003

This commit is contained in:
Thibaud
2026-01-02 10:03:49 +01:00
parent 0dbccd74de
commit ef705874b1
2 changed files with 16 additions and 27 deletions

View File

@@ -122,22 +122,22 @@
etatSectionLog('Etat courant '+currentEtatSection);
switch (currentEtatSection) {
case 1 :
scrollToElement('#div_before_header');
section_header.style.display = "block";
removeClassToElement('#div_navbar','navbar_fixed');
removeClassToElement('#div_before_synthese','div_before_synthese_when_navbar_fixed');
section_header.style.display = "block";
scrollToElement('#div_before_header');
break;
case 2 :
addClassToElement('#div_navbar','navbar_fixed');
addClassToElement('#div_before_synthese','div_before_synthese_when_navbar_fixed');
scrollToElement('#div_before_navbar');
section_synthese.style.display = "block";
addClassToElement('#div_navbar','navbar_fixed');
addClassToElement('#div_before_synthese','div_before_synthese_when_navbar_fixed');
break;
case 3 :
scrollToElement('#div_before_navbar');
section_synthese.style.display = "none";
addClassToElement('#div_navbar','navbar_fixed');
addClassToElement('#div_before_synthese','div_before_synthese_when_navbar_fixed');
section_synthese.style.display = "none";
scrollToElement('#div_before_navbar');
break;
default :
break;
@@ -170,7 +170,7 @@
}
function beforeSection(_visible) {
if (!_visible) changeSectionEtatUp();
if (!_visible) changeEtatSectionUp();
}
function afterSection(_visible) {
if (_visible) changeEtatSectionDown();
@@ -195,37 +195,25 @@
addIntersectionObserverEntry("div_before_header", beforeHeaderVisibility);
addIntersectionObserverEntry("div_after_header", afterHeaderVisibility);
addIntersectionObserverEntry("div_before_navbar", beforeNavbarVisibility);
//addIntersectionObserverEntry("div_after_navbar", afterNavbarVisibility);
addIntersectionObserverEntry("div_after_navbar", afterNavbarVisibility);
/*
let yprev = window.pageYOffset;
const scrollHandler = () => {
const y = window.pageYOffset;
const ymax = document.documentElement.scrollHeight - window.innerHeight;
if (y > yprev) {
if (section_header.style.display !== "none") {
section_header.style.display="none";
changeEtatSectionUp();
} else {
if (section_synthese.style.display !== "none") {
section_synthese.style.display="none";
}
}
} else {
if (y < yprev) {
if (section_synthese.style.display !== "block") {
section_synthese.style.display="block";
} else {
if (section_header.style.display !== "block") {
section_header.style.display="block";
}
}
}
changeEtatSectionDown();
}
yprev = Math.min(Math.max(y, 0), ymax);
};
// window.addEventListener('scroll', throttleCallback(scrollHandler, 250));
window.addEventListener('scroll', scrollThrottleCallback(scrollHandler, 1000));
*/
</script>

View File

@@ -40,6 +40,7 @@ const intersectionObserver = new IntersectionObserver(handleIntersectionObserver
// C'est négatif parce qu'on entre à l'intérieur de l'image. Si le nombre
// était positif, alors la ligne rouge se retrouverait sous l'image
rootMargin: '-1px 0px'
//rootMargin: '2px 0px'
});
function addIntersectionObserverEntry(_id, _func)