feat: Initialize project
This commit is contained in:
1 parent
eccc32337f
commit
3c1050898e
65 files changed
+5661
-596
No files matched your search
@@ -0,0 +1,34 @@
|
||||
import { FC } from 'react';
|
||||
import { ImageOff } from 'lucide-react';
|
||||
import Image from 'next/image';
|
||||
|
||||
interface Props {
|
||||
title: string;
|
||||
poster: string;
|
||||
width: number;
|
||||
height: number;
|
||||
size: number;
|
||||
}
|
||||
|
||||
const Poster: FC<Props> = ({ title, poster, width, height, size = 250 }) => {
|
||||
return (
|
||||
<div className='max-w-[300px] h-[450px] w-full rounded-lg overflow-hidden shrink-0 relative m-auto lg:m-0'>
|
||||
{poster ? (
|
||||
<Image
|
||||
className='rounded-lg '
|
||||
unoptimized
|
||||
height={height}
|
||||
width={width}
|
||||
src={`https://image.tmdb.org/t/p/w500/${poster}`}
|
||||
alt={title}
|
||||
/>
|
||||
) : (
|
||||
<div className={`w-[${width}px] h-[${height}px] flex items-center justify-center rounded-lg border`}>
|
||||
<ImageOff size={size} strokeWidth={1} />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Poster;
|
||||
@@ -0,0 +1,35 @@
|
||||
import { FC, useState } from 'react';
|
||||
import Marquee from 'react-fast-marquee';
|
||||
|
||||
import { useTheme } from '@/hooks/useTheme';
|
||||
|
||||
interface Props {
|
||||
title: string;
|
||||
}
|
||||
|
||||
const Title: FC<Props> = ({ title }) => {
|
||||
const [isScrollableTitle, setIsScrollableTitle] = useState(false);
|
||||
const [theme] = useTheme();
|
||||
return (
|
||||
<Marquee
|
||||
play={isScrollableTitle}
|
||||
gradient={isScrollableTitle}
|
||||
gradientWidth={10}
|
||||
gradientColor={theme === 'light' ? [255, 255, 255] : [2, 8, 23]}
|
||||
className='movie-title overflow-hidden h-[30px] text-lg font-semibold'
|
||||
>
|
||||
<div
|
||||
ref={(element) => {
|
||||
const header = element?.closest('.movie-title') as HTMLDivElement;
|
||||
const isScrollableTitle = (header?.offsetWidth || 0) < (element?.offsetWidth || 0);
|
||||
|
||||
isScrollableTitle && setIsScrollableTitle(isScrollableTitle);
|
||||
}}
|
||||
>
|
||||
{title}
|
||||
</div>
|
||||
</Marquee>
|
||||
);
|
||||
};
|
||||
|
||||
export default Title;
|
||||
Reference in new issue
Block a user