feat: optimize rootMargin for better performance based on layout

This commit is contained in:
2026-05-18 23:38:13 +02:00
parent 23d9d0871a
commit 073652c63d
2 changed files with 6 additions and 2 deletions
+3 -1
View File
@@ -1237,7 +1237,9 @@
}
});
}, {
rootMargin: '30000px 30000px 30000px 30000px'
// Keep approx ~120 items rendered in DOM relative to scroll position.
// Assuming ~100-400px per item/row, this margin unloads elements beyond that range.
rootMargin: isMobileLayout ? '18000px 0px 18000px 0px' : '9000px 0px 9000px 0px'
});
}
+3 -1
View File
@@ -3850,7 +3850,9 @@ document.addEventListener('DOMContentLoaded', ()=>{
}
});
}, {
rootMargin: '30000px 30000px 30000px 30000px'
// Keep approx ~120 items rendered in DOM relative to scroll position.
// Assuming ~100-400px per item/row, this margin unloads elements beyond that range.
rootMargin: isMobileLayout ? '18000px 0px 18000px 0px' : '9000px 0px 9000px 0px'
});
}