fix: poster aspect ratio
This commit is contained in:
1 parent
6098de1e5c
commit
a2c5ba5184
3 files changed
+10
-3
No files matched your search
@@ -39,7 +39,7 @@ const Carousel = memo(
|
||||
);
|
||||
|
||||
return (
|
||||
<div className='card-aspect-ratio relative mx-auto'>
|
||||
<div className='card-aspect-ratio static-aspect-ratio relative mx-auto'>
|
||||
{!loaded && <Poster lazy={false} show={shows![index]} className='pointer-events-none absolute left-0 top-0' />}
|
||||
<Virtuoso
|
||||
initialItemCount={1}
|
||||
@@ -87,7 +87,7 @@ const components: VirtuosoProps<Show, Context>['components'] = {
|
||||
|
||||
return (
|
||||
<div {...props} ref={ref} className='snap-start'>
|
||||
<Poster lazy={false} show={item} />
|
||||
<Poster lazy={false} show={item} className='static-aspect-ratio' />
|
||||
</div>
|
||||
);
|
||||
},
|
||||
|
||||
@@ -39,7 +39,7 @@ const Preview: FC<Props> = ({ show: baseShow, showType, showId, className, poste
|
||||
)}
|
||||
>
|
||||
{poster || <Poster className={cn('mx-auto md:rounded-none md:rounded-l-xl', posterClassName)} show={show} />}
|
||||
<div className={cn('flex grow flex-col bg-background', { 'p-0 pt-1 md:p-2': isModal })}>
|
||||
<div className={cn('flex grow flex-col bg-background', { 'p-0 pt-2 md:p-2': isModal })}>
|
||||
<span className='order-3 mb-4 text-3xl md:order-1 md:line-clamp-2'>{show.title}</span>
|
||||
|
||||
<div className='order-3 mb-4 flex w-full flex-wrap gap-5 whitespace-nowrap text-sm md:order-2'>
|
||||
|
||||
@@ -135,6 +135,13 @@
|
||||
width: 300px;
|
||||
height: 450px;
|
||||
flex-shrink: 0;
|
||||
@media screen and (max-width: 600px) {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
aspect-ratio: 2/3;
|
||||
}
|
||||
}
|
||||
.static-aspect-ratio {
|
||||
@media screen and (max-width: 600px) {
|
||||
--width: calc(100vw - 1rem);
|
||||
width: var(--width);
|
||||
|
||||
Reference in new issue
Block a user