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) => {
|
const heroObserver = new IntersectionObserver((entries) => {
|
||||||
entries.forEach((entry) => {
|
entries.forEach((entry) => {
|
||||||
if (entry.isIntersecting) {
|
setHeroVisible(entry.isIntersecting);
|
||||||
setHeroVisible(true);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}, observerOptions);
|
}, observerOptions);
|
||||||
|
|
||||||
const cookiesObserver = new IntersectionObserver((entries) => {
|
const cookiesObserver = new IntersectionObserver((entries) => {
|
||||||
entries.forEach((entry) => {
|
entries.forEach((entry) => {
|
||||||
if (entry.isIntersecting) {
|
setCookiesVisible(entry.isIntersecting);
|
||||||
setCookiesVisible(true);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}, observerOptions);
|
}, observerOptions);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user