fix: slide flickering
This commit is contained in:
1 parent
af942149af
commit
418ab2cf15
4 files changed
+27
-42
No files matched your search
+15
-18
@@ -12,24 +12,21 @@ interface Props {
|
||||
}
|
||||
|
||||
const Poster: FC<Props> = ({ show, onClick, className, lazy = true }) => (
|
||||
<div className={cn('card-aspect-ratio relative bg-black overflow-hidden rounded-lg text-lg', className)}>
|
||||
<div className='flex size-full'>
|
||||
<picture>
|
||||
<source srcSet={show.poster['1x']} media='(max-resolution: 191dpi)' />
|
||||
<source srcSet={show.poster['1x']} media='(max-device-pixel-ratio: 1.99)' />
|
||||
<source srcSet={show.poster['1.5x']} media='(min-resolution: 192dpi)' />
|
||||
<source srcSet={show.poster['1.5x']} media='(min-device-pixel-ratio: 2)' />
|
||||
<img
|
||||
className='size-full rounded-lg object-cover md:rounded-none md:rounded-l-lg'
|
||||
loading={lazy ? 'lazy' : 'eager'}
|
||||
src={show.poster['1x']}
|
||||
alt={show.title}
|
||||
/>
|
||||
</picture>
|
||||
</div>
|
||||
<div className='absolute left-0 top-0 flex size-full flex-col justify-between rounded-md bg-vignette p-2 text-white md:rounded-none md:rounded-l-lg'>
|
||||
<Handlers show={show} onClick={onClick} />
|
||||
</div>
|
||||
<div
|
||||
className={cn(
|
||||
'card-aspect-ratio relative bg-black overflow-hidden rounded-lg text-lg',
|
||||
'after:block after:absolute after:left-0 after:top-0 after:size-full after:bg-vignette',
|
||||
className
|
||||
)}
|
||||
>
|
||||
<picture className='size-full rounded-lg object-cover md:rounded-none md:rounded-l-lg'>
|
||||
<source srcSet={show.poster['1x']} media='(max-resolution: 191dpi)' />
|
||||
<source srcSet={show.poster['1x']} media='(max-device-pixel-ratio: 1.99)' />
|
||||
<source srcSet={show.poster['1.5x']} media='(min-resolution: 192dpi)' />
|
||||
<source srcSet={show.poster['1.5x']} media='(min-device-pixel-ratio: 2)' />
|
||||
<img className='size-full' loading={lazy ? 'lazy' : 'eager'} src={show.poster['1x']} alt={show.title} />
|
||||
</picture>
|
||||
<Handlers show={show} onClick={onClick} />
|
||||
</div>
|
||||
);
|
||||
|
||||
|
||||
Reference in new issue
Block a user