preload discover rows earlier and reduce scroll jank
This commit is contained in:
@@ -101,7 +101,7 @@ export default function ContentRow({ title, subtitle, items, aspect = 'poster',
|
||||
const showHeader = !!title || !!subtitle || !!seeAllHref
|
||||
|
||||
return (
|
||||
<section className="mb-10">
|
||||
<section className="mb-10" style={{ contentVisibility: 'auto', containIntrinsicHeight: '300px' }}>
|
||||
{/* Row header */}
|
||||
{showHeader && (
|
||||
<div className="flex items-end justify-between mb-3.5 px-7 gap-3">
|
||||
@@ -211,13 +211,9 @@ export default function ContentRow({ title, subtitle, items, aspect = 'poster',
|
||||
items.map((item, i) => (
|
||||
<motion.div
|
||||
key={item.Id}
|
||||
initial={{ opacity: 0, y: 12 }}
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
transition={{
|
||||
duration: 0.4,
|
||||
delay: Math.min(i * 0.025, 0.4),
|
||||
ease: [0.16, 1, 0.3, 1],
|
||||
}}
|
||||
initial={{ opacity: 0 }}
|
||||
animate={{ opacity: 1 }}
|
||||
transition={{ duration: 0.25, delay: Math.min(i * 0.015, 0.2) }}
|
||||
className={`shrink-0 ${widthClass}`}
|
||||
>
|
||||
<PosterCard
|
||||
|
||||
@@ -46,8 +46,8 @@ interface Props {
|
||||
export default function LazyMount({
|
||||
children,
|
||||
placeholder,
|
||||
mountMargin = '600px',
|
||||
unmountMargin = '1500px',
|
||||
mountMargin = '1600px',
|
||||
unmountMargin = '2400px',
|
||||
className,
|
||||
}: Props) {
|
||||
const ref = useRef<HTMLDivElement>(null)
|
||||
|
||||
Reference in New Issue
Block a user