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