diff --git a/assets/js/main.js b/assets/js/main.js index e77febd..07f10dd 100755 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -827,6 +827,27 @@ $(document).ready(function () { } }); + // Met à jour l'en-tête de jour sticky en fonction du scroll + function updateStickyDayHeader() { + var scrollTop = $(window).scrollTop(); + var $header = $('#sticky-day-header'); + var activeLabel = null; + + $('.day-group').each(function () { + var sepTop = $(this).find('.day-separator').offset().top; + if (sepTop < scrollTop + 10) { + activeLabel = $(this).find('.day-separator span').text(); + } + }); + + if (activeLabel) { + $header.find('span').text(activeLabel); + $header.addClass('visible'); + } else { + $header.removeClass('visible'); + } + } + // Bouton retour en haut de la page $(window).scroll(function () { if ($(this).scrollTop() > 300) { @@ -834,6 +855,7 @@ $(document).ready(function () { } else { $('#btn-back-to-top').hide(); } + updateStickyDayHeader(); }); $('#btn-back-to-top').click(function () { diff --git a/index.php b/index.php index 4f18da2..ed93eb3 100755 --- a/index.php +++ b/index.php @@ -425,6 +425,40 @@ function taille_format($taille) display: block; } + /* En-tête de jour sticky */ + #sticky-day-header { + position: fixed; + top: 0; + left: 0; + right: 0; + z-index: 500; + display: flex; + justify-content: center; + pointer-events: none; + opacity: 0; + transition: opacity .2s; + } + + #sticky-day-header.visible { + opacity: 1; + } + + #sticky-day-header span { + background: rgba(255, 255, 255, 0.92); + backdrop-filter: blur(4px); + -webkit-backdrop-filter: blur(4px); + border: 1px solid #dee2e6; + border-top: none; + border-radius: 0 0 10px 10px; + padding: 2px 14px 4px; + font-size: .72rem; + font-weight: 600; + color: #6c757d; + text-transform: uppercase; + letter-spacing: .6px; + box-shadow: 0 2px 6px rgba(0, 0, 0, .08); + } + /* Config modal */ #box-config { position: fixed; @@ -647,6 +681,7 @@ function taille_format($taille) +