<style>
/* Smooth header animation */
/* 👇🏻 Тут замените #rec000000000 на recID вашего блока */
#rec000000000 .t396__artboard {
transition: transform .6s ease-in-out; /* smooth slide */
will-change: transform; /* GPU hint */
}
</style>
<script>
document.addEventListener('DOMContentLoaded',()=> {
/* 👇🏻 Тут замените #rec000000000 на recID вашего блока */
const h = document.querySelector('#rec000000000 .t396__artboard');
if (!h) return;
h.style.transform = 'translateY(0)'; // visible on load
let last = pageYOffset;
const MIN = 50, DELTA = 8, TRIGGER = 600; // TRIGGER = 600px
addEventListener('scroll', () => {
const y = pageYOffset, d = y - last;
if (y < TRIGGER) { // before 600px → always show
h.style.transform = 'translateY(0)';
last = y;
return;
}
if (Math.abs(d) < DELTA) return;
if (d > 0) {
// scroll down past 600 → hide
const H = h.getBoundingClientRect().height;
h.style.transform = `translateY(-${H}px)`;
} else {
// scroll up past 600 → show
h.style.transform = 'translateY(0)';
}
last = y;
}, { passive: true });
});
</script>