2026-10-08 16:59:02 +00:00

25 lines
555 B
JavaScript

/**
* Sticky CTA — shared IntersectionObserver
*
* Mobile sticky is CSS-only (always visible).
*
* @package Dekart
*/
(function () {
'use strict';
var desktop = document.querySelector('.sticky-cta-desktop');
var hero = document.querySelector('.ds-hero, .hero-front');
if (!desktop || !hero) return;
var observer = new IntersectionObserver(function (entries) {
entries.forEach(function (entry) {
desktop.classList.toggle('visible', !entry.isIntersecting);
});
}, { threshold: 0 });
observer.observe(hero);
})();