Improve video grid scrolling by applying transform directly
Directly apply the translateX transform to the category row element in the Netflix grid component to enhance scrolling performance and visual fluidity. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 2eb1084e-b728-4449-9231-f1665924c8d5 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/2eb1084e-b728-4449-9231-f1665924c8d5/KcsXLXG
This commit is contained in:
parent
d44c4acff3
commit
227267abf1
@ -319,6 +319,12 @@ function CategoryRow({ category, onVideoClick }: CategoryRowProps) {
|
||||
willChange: 'transform',
|
||||
transition: isScrolling ? 'none' : 'transform 0.3s ease'
|
||||
}}
|
||||
ref={(el) => {
|
||||
if (el) {
|
||||
console.log(`Setting transform: translateX(${translateX}px)`);
|
||||
el.style.transform = `translateX(${translateX}px)`;
|
||||
}
|
||||
}}
|
||||
>
|
||||
{/* Many copies for true infinite scroll */}
|
||||
{[...Array(10)].flatMap(() => category.videos).map((video, index) => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user