Animate on every scroll
Update HeritageSection IntersectionObserver to trigger visibility on any intersection change, not just when entering viewport, enabling repeated fade-in animations while scrolling. X-Lovable-Edit-ID: edt-d8b9037f-2912-452b-bb6f-ea6f39a7807f
This commit is contained in:
@@ -36,17 +36,13 @@ const HeritageSection = () => {
|
||||
|
||||
const heroObserver = new IntersectionObserver((entries) => {
|
||||
entries.forEach((entry) => {
|
||||
if (entry.isIntersecting) {
|
||||
setHeroVisible(true);
|
||||
}
|
||||
setHeroVisible(entry.isIntersecting);
|
||||
});
|
||||
}, observerOptions);
|
||||
|
||||
const cookiesObserver = new IntersectionObserver((entries) => {
|
||||
entries.forEach((entry) => {
|
||||
if (entry.isIntersecting) {
|
||||
setCookiesVisible(true);
|
||||
}
|
||||
setCookiesVisible(entry.isIntersecting);
|
||||
});
|
||||
}, observerOptions);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user