├── public ├── favicon.ico ├── vercel.svg └── styles │ └── globals.css ├── postcss.config.js ├── next.config.js ├── tailwind.config.js ├── src ├── pages │ ├── about.jsx │ ├── search.jsx │ ├── _app.jsx │ ├── index.jsx │ ├── actors │ │ └── [id].jsx │ ├── movies │ │ └── [id].jsx │ └── series │ │ └── [id].jsx └── components │ ├── Static │ ├── CardGroup.jsx │ ├── Header.jsx │ └── Card.jsx │ └── Global │ └── WatchTrailer.jsx ├── package.json ├── README.md └── next-seo.config.js /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clqu/movie-app/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /next.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('next').NextConfig} */ 2 | const nextConfig = { 3 | reactStrictMode: true, 4 | } 5 | 6 | module.exports = nextConfig 7 | -------------------------------------------------------------------------------- /tailwind.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | content: [ 3 | "./src/**/**/*.{js,ts,jsx,tsx}" 4 | ], 5 | theme: { 6 | extend: {}, 7 | }, 8 | plugins: [], 9 | } 10 | -------------------------------------------------------------------------------- /src/pages/about.jsx: -------------------------------------------------------------------------------- 1 | function About() { 2 | return <> 3 |
4 |

About Us

5 |

We are not real, this is an open-source project. That's why there is no about us page content.

6 |
7 | 8 | } 9 | 10 | export default About; 11 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "movie-app", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "dev": "next dev", 7 | "build": "next build", 8 | "start": "next start", 9 | "lint": "next lint" 10 | }, 11 | "dependencies": { 12 | "@headlessui/react": "^1.6.1", 13 | "next": "12.1.6", 14 | "next-seo": "^5.4.0", 15 | "react": "18.1.0", 16 | "react-dom": "18.1.0", 17 | "react-icons": "^4.3.1" 18 | }, 19 | "devDependencies": { 20 | "autoprefixer": "^10.4.7", 21 | "eslint": "8.15.0", 22 | "eslint-config-next": "12.1.6", 23 | "postcss": "^8.4.13", 24 | "tailwindcss": "^3.0.24" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/components/Static/CardGroup.jsx: -------------------------------------------------------------------------------- 1 | import Card from "./Card" 2 | 3 | export default function CardGroup({ seeMore = true, value = "movies", cardTypes = "vertical", gridClass, data, title }) { 4 | return data?.length > 0 && ( 5 | <> 6 |
7 |

{title}

8 | {seeMore && ( 9 |

See more

10 | )} 11 |
12 |
13 | {(data || [])?.map((a, index) => ( 14 | 15 | ))} 16 |
17 | 18 | ) 19 | } -------------------------------------------------------------------------------- /public/vercel.svg: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Movie App
2 | 3 | 4 | 5 | #### [Demo](https://movie-app-clqu.vercel.app) 6 | 7 | 8 | 9 | ## Getting Started 10 | 11 | ### 🛠 Development Server 12 | 13 | ```bash 14 | npm install --s --f && npm run dev 15 | # or 16 | yarn install && yarn dev 17 | ``` 18 | ### 🛠 Production Server 19 | ```bash 20 | npm install --s --f && npm run build && npm run start 21 | # or 22 | yarn install && yarn build && yarn start 23 | ``` 24 | Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. 25 | You can start editing the page by modifying `src/pages/index.js`. The page auto-updates as you edit the file. 26 | 27 | 28 | ## Learn More 29 | 30 | To learn more about Next.js, take a look at the following resources: 31 | 32 | - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. 33 | - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. 34 | 35 | You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! 36 | 37 | ## Deploy on Vercel 38 | 39 | The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new/import?s=https://github.com/clqu/clqu.live&utm_source=clqu.live) from the clqu. 40 | 41 | Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. 42 | 43 | ## ⭐ Star 44 | - Don't forget to star this repo for support :) 45 | -------------------------------------------------------------------------------- /next-seo.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | title: "Movie App", 3 | description: "Find your best movie to make time beautiful.", 4 | canonical: "https://www.canonical.ie/", 5 | openGraph: { 6 | url: 'https://www.url.ie/a', 7 | title: 'Movie App', 8 | description: 'Find your best movie to make time beautiful.', 9 | images: [ 10 | { 11 | url: 'https://camo.githubusercontent.com/7c2653420dcefe95b95440f99ee500ca3fb4bb610408a949d102fab2a73fe8af/68747470733a2f2f692e696d6775722e636f6d2f6d457443484c412e706e67', 12 | width: 800, 13 | height: 600, 14 | alt: 'Og Image Alt', 15 | type: 'image/jpeg', 16 | }, 17 | { 18 | url: 'https://camo.githubusercontent.com/7c2653420dcefe95b95440f99ee500ca3fb4bb610408a949d102fab2a73fe8af/68747470733a2f2f692e696d6775722e636f6d2f6d457443484c412e706e67', 19 | width: 900, 20 | height: 800, 21 | alt: 'Og Image Alt Second', 22 | type: 'image/jpeg', 23 | }, 24 | { url: 'https://camo.githubusercontent.com/7c2653420dcefe95b95440f99ee500ca3fb4bb610408a949d102fab2a73fe8af/68747470733a2f2f692e696d6775722e636f6d2f6d457443484c412e706e67' }, 25 | { url: 'https://camo.githubusercontent.com/7c2653420dcefe95b95440f99ee500ca3fb4bb610408a949d102fab2a73fe8af/68747470733a2f2f692e696d6775722e636f6d2f6d457443484c412e706e67' }, 26 | ], 27 | site_name: 'Movie App', 28 | }, 29 | twitter: { 30 | handle: '@handle', 31 | site: '@site', 32 | cardType: 'summary_large_image', 33 | } 34 | }; 35 | -------------------------------------------------------------------------------- /src/pages/search.jsx: -------------------------------------------------------------------------------- 1 | import Head from 'next/head' 2 | import Image from 'next/image' 3 | import { FiFilter } from "react-icons/fi"; 4 | import { BsSearch } from "react-icons/bs"; 5 | import CardGroup from '../components/Static/CardGroup'; 6 | 7 | function Search({ data, query }) { 8 | return <> 9 | 10 |
11 |

Millions of movies, TV shows and people to discover. Explore now.

12 |
13 |
14 | 15 | 18 |
19 |
20 |
21 | {query?.trim()?.length > 0 && ( 22 |
23 |
24 | a.media_type === "movie" && a.poster_path).length || 0})`} data={data.filter(a => a.media_type === "movie")} /> 25 |
26 |
27 | a.media_type === "tv" && a.poster_path).length || 0})`} data={data.filter(a => a.media_type === "tv")} /> 28 |
29 |
30 | a.media_type === "person").length || 0})`} data={data.filter(a => a.media_type === "person")} /> 31 |
32 |
33 | )} 34 | 35 | } 36 | 37 | export async function getServerSideProps(ctx) { 38 | const _result = await (await fetch('https://api.themoviedb.org/3/search/multi?api_key=3044afc915e1301ae1d9551614db3711&query='+ctx?.query?.q || ctx?.query?.query).then(r => r.json()))?.results; 39 | 40 | return { 41 | props: { 42 | data: _result, 43 | query: (ctx?.query?.q || ctx?.query?.query || "") 44 | }, 45 | } 46 | } 47 | 48 | 49 | export default Search; 50 | -------------------------------------------------------------------------------- /public/styles/globals.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | 5 | 6 | 7 | @font-face { 8 | font-family: "Creal"; 9 | src: url("https://clqu.live/fonts/5fd07762093e40beee85d22757cc6d8d.woff2") format("woff2"), 10 | url("https://clqu.live/fonts/5fd07762093e40beee85d22757cc6d8d.woff") format("woff"); 11 | font-weight: bold; 12 | font-style: normal; 13 | font-display: swap; 14 | } 15 | 16 | @font-face { 17 | font-family: "Creal"; 18 | src: url("https://clqu.live/fonts/f5a1414f8fe9188766b39607d923fbb9.woff2") format("woff2"), 19 | url("https://clqu.live/fonts/f5a1414f8fe9188766b39607d923fbb9.woff") format("woff"); 20 | font-weight: 900; 21 | font-style: normal; 22 | font-display: swap; 23 | } 24 | 25 | @font-face { 26 | font-family: "Creal"; 27 | src: url("https://clqu.live/fonts/3d32e753a2cefc56ce239b04cce45490.woff2") format("woff2"), 28 | url("https://clqu.live/fonts/3d32e753a2cefc56ce239b04cce45490.woff") format("woff"); 29 | font-weight: normal; 30 | font-style: normal; 31 | font-display: swap; 32 | } 33 | 34 | @font-face { 35 | font-family: "Creal"; 36 | src: url("https://clqu.live/fonts/7ab640c091619f9534886523d3cde66f.woff2") format("woff2"), 37 | url("https://clqu.live/fonts/7ab640c091619f9534886523d3cde66f.woff") format("woff"); 38 | font-weight: 900; 39 | font-style: normal; 40 | font-display: swap; 41 | } 42 | 43 | @font-face { 44 | font-family: "Creal"; 45 | src: url("https://clqu.live/fonts/855b722e0240c397005b340b1baf8780.woff2") format("woff2"), 46 | url("https://clqu.live/fonts/855b722e0240c397005b340b1baf8780.woff") format("woff"); 47 | font-weight: 500; 48 | font-style: normal; 49 | font-display: swap; 50 | } 51 | 52 | * { 53 | font-family: 'Creal', sans-serif; 54 | } 55 | 56 | .hero-image { 57 | --gradient-1: #f7fff6; 58 | --gradient-2: rgba(94, 94, 94, 0.4); 59 | --gradient-4: rgba(0, 0, 0, 0.4); 60 | --gradient-3: rgba(6, 2, 4, 0.2); 61 | 62 | background: 63 | linear-gradient(0deg, 64 | var(--gradient-1), 65 | var(--gradient-2), 66 | var(--gradient-3), 67 | var(--gradient-3)), 68 | linear-gradient(180deg, 69 | var(--gradient-4), 70 | var(--gradient-4)), 71 | var(--card-banner); 72 | background-size: cover !important; 73 | background-repeat: no-repeat; 74 | } 75 | 76 | .movie-card { 77 | --gradient-1: rgb(5, 5, 12, .6); 78 | --gradient-2: rgba(5, 5, 12, .4); 79 | --gradient-3: rgba(5, 5, 12, .5); 80 | background: linear-gradient(0deg, var(--gradient-1), var(--gradient-1), var(--gradient-2), var(--gradient-3)), var(--card-banner); 81 | background-size: cover; 82 | background-position: center; 83 | } -------------------------------------------------------------------------------- /src/pages/_app.jsx: -------------------------------------------------------------------------------- 1 | import '../../public/styles/globals.css' 2 | import { DefaultSeo } from 'next-seo'; 3 | import SEO from '../../next-seo.config'; 4 | import Header from '../components/Static/Header'; 5 | import { AiFillStar } from "react-icons/ai" 6 | import { useRouter } from "next/router"; 7 | 8 | function MyApp({ Component, pageProps, data }) { 9 | const router = useRouter(); 10 | 11 | return <> 12 | 13 |
14 |
15 |
16 |
17 |
18 | 19 |
20 | {router.pathname === '/' && ( 21 |
22 | {data.slice(0, 7).map((item, index) => ( 23 | index === 0 ? ( 24 |
25 | 26 |
27 |

{item.title}

28 |

{item.vote_average}

29 |
30 |
31 | ) : ( 32 |
33 | 34 |
35 |

{index + 1}

36 |
37 |

{item.title}

38 |
39 |
40 |

{item.vote_average}

41 |
42 | ) 43 | ))} 44 |
45 | )} 46 |
47 | 48 | } 49 | 50 | MyApp.getInitialProps = async (ctx) => { 51 | const data = await (await fetch('https://api.themoviedb.org/3/trending/movie/week?api_key=3044afc915e1301ae1d9551614db3711').then(r => r.json())).results; 52 | return { 53 | data 54 | } 55 | } 56 | 57 | export default MyApp 58 | -------------------------------------------------------------------------------- /src/pages/index.jsx: -------------------------------------------------------------------------------- 1 | import Head from 'next/head' 2 | import Image from 'next/image' 3 | import { FiFilter } from "react-icons/fi"; 4 | import { BsSearch } from "react-icons/bs"; 5 | import CardGroup from '../components/Static/CardGroup'; 6 | 7 | function Home({ discoverMovies, trendingMovies, trendingTv, trendingActors}) { 8 | return <> 9 | 10 |
11 |

Millions of movies, TV shows and people to discover. Explore now.

12 |
13 |
14 | 15 | 18 |
19 |
20 |
21 |
22 |
23 | 24 |
25 |
26 | 27 |
28 |
29 | 30 |
31 |
32 | 33 |
34 |
35 | 36 | } 37 | 38 | export async function getServerSideProps() { 39 | const _discover = await (await fetch('https://api.themoviedb.org/3/discover/movie?api_key=3044afc915e1301ae1d9551614db3711').then(r => r.json()))?.results; 40 | const _trendingMovies = await (await fetch('https://api.themoviedb.org/3/trending/movie/week?api_key=3044afc915e1301ae1d9551614db3711').then(r => r.json()))?.results; 41 | const _trendingTv = await (await fetch('https://api.themoviedb.org/3/trending/tv/week?api_key=3044afc915e1301ae1d9551614db3711').then(r => r.json()))?.results; 42 | const _trendingActors = await (await fetch('https://api.themoviedb.org/3/trending/person/week?api_key=3044afc915e1301ae1d9551614db3711').then(r => r.json()))?.results; 43 | return { 44 | props: { 45 | discoverMovies: _discover, 46 | trendingMovies: _trendingMovies, 47 | trendingTv: _trendingTv, 48 | trendingActors: _trendingActors 49 | }, 50 | } 51 | } 52 | 53 | 54 | export default Home; 55 | -------------------------------------------------------------------------------- /src/components/Global/WatchTrailer.jsx: -------------------------------------------------------------------------------- 1 | const { Fragment, useState, useEffect } = require("react"); 2 | const { Transition } = require("@headlessui/react"); 3 | 4 | export default function Trailer({ id, children }) { 5 | let [isOpen, setIsOpen] = useState(false); 6 | 7 | useEffect(() => { 8 | setIsOpen(isOpen); 9 | if (!isOpen) { 10 | document.documentElement.style.overflow = "auto"; 11 | } else { 12 | document.documentElement.style.overflow = "hidden"; 13 | } 14 | }, [isOpen]); 15 | 16 | const HandleChange = () => { 17 | setIsOpen(!isOpen); 18 | 19 | } 20 | return <> 21 | 22 |
HandleChange()}> 23 | {children} 24 |
25 | 26 | 27 | 36 |
HandleChange()} className="w-full h-full left-0 top-0 bg-black/50 fixed" /> 37 | 38 | 47 |
HandleChange()} style={{ zIndex: '2' }} className="flex left-0 top-0 justify-center items-center h-screen w-screen fixed text-black"> 48 |
49 |
50 |
HandleChange()} className="absolute right-5 top-5 w-8 h-8 flex justify-center items-center rounded-lg transition-all duration-200 cursor-pointer hover:bg-zinc-500/20"> 51 | 52 | 53 | 54 | 55 |
56 |
57 | 65 | 66 |
67 |
68 |
69 | 70 | 71 | } -------------------------------------------------------------------------------- /src/pages/actors/[id].jsx: -------------------------------------------------------------------------------- 1 | import { AiFillStar } from "react-icons/ai" 2 | import { BsFillPlayFill } from "react-icons/bs" 3 | import WatchTrailer from "../../components/Global/WatchTrailer"; 4 | import CardGroup from "../../components/Static/CardGroup"; 5 | import Router from 'next/router' 6 | import { NextSeo } from 'next-seo'; 7 | 8 | function Movie({ data, movies }) { 9 | const backdropImage = data?.credits?.cast?.[0]?.backdrop_path ? ("https://image.tmdb.org/t/p/original" + data?.credits?.cast?.[0]?.backdrop_path) : '/no-image.svg'; 10 | const verticalImage = data?.profile_path ? ("https://image.tmdb.org/t/p/w500" + data?.profile_path) : '/no-image.svg'; 11 | 12 | const latestTrailer = data?.videos?.results?.filter((video) => video.official === true && video.type === "Trailer")?.[0]; 13 | 14 | return <> 15 | 19 |
20 |
21 | 22 |
23 |
24 | 25 |
26 |
27 |

{data?.name}

28 |
29 |
{data?.known_for_department}, {data?.place_of_birth}
30 |
31 |

{data?.overview}

32 |
33 |
34 |
35 | 36 |
37 |
38 |
39 |

Biography

40 |

{data?.biography}

41 |
42 |
43 |

Also Known As

44 |
45 | {data?.also_known_as?.map((i, idx) => ( 46 |

{i}

47 | ))} 48 |
49 |
50 |
51 | 52 |
53 |
54 |
55 |
56 | 57 | } 58 | 59 | export async function getServerSideProps(ctx) { 60 | const _result = await (await fetch(`https://api.themoviedb.org/3/person/${ctx?.query?.id}?api_key=3044afc915e1301ae1d9551614db3711&append_to_response=videos,credits,reviews`).then(r => r.json())); 61 | const _cast = await (await fetch(`https://api.themoviedb.org/3/person/${ctx?.query?.id}/movie_credits?api_key=3044afc915e1301ae1d9551614db3711&append_to_response=videos,credits,reviews`).then(r => r.json())); 62 | if (_result?.status_code === 34) { 63 | if (ctx?.res) { 64 | ctx?.res.writeHead(307, { Location: '/' }) 65 | ctx?.res.end() 66 | } else { 67 | Router.replace('/') 68 | } 69 | } 70 | return { 71 | props: { 72 | data: _result, 73 | movies: _cast 74 | }, 75 | } 76 | } 77 | 78 | export default Movie; -------------------------------------------------------------------------------- /src/pages/movies/[id].jsx: -------------------------------------------------------------------------------- 1 | import { AiFillStar } from "react-icons/ai" 2 | import { BsFillPlayFill } from "react-icons/bs" 3 | import WatchTrailer from "../../components/Global/WatchTrailer"; 4 | import CardGroup from "../../components/Static/CardGroup"; 5 | import Router from 'next/router' 6 | import { NextSeo } from 'next-seo'; 7 | 8 | function Movie({ data }) { 9 | const backdropImage = data?.backdrop_path ? ("https://image.tmdb.org/t/p/original" + data?.backdrop_path) : '/no-image.svg'; 10 | const verticalImage = data?.poster_path ? ("https://image.tmdb.org/t/p/w400" + data?.poster_path) : '/no-image.svg'; 11 | 12 | const latestTrailer = data?.videos?.results?.filter((video) => video.official === true && video.type === "Trailer")?.[0]; 13 | 14 | return <> 15 | 19 |
20 |
21 | 22 |
23 | 24 |
25 |

{data?.original_title}

26 |
27 |
{data?.release_date?.split('-')[0]}
28 |

{data?.vote_average}

29 |
{data?.genres?.[0]?.name}
30 | {data?.homepage && ( 31 | 36 | )} 37 |
38 |

{data?.overview}

39 | 40 |
41 | {latestTrailer?.key && ( 42 | 43 | 49 | 50 | )} 51 | 52 |
53 |
54 |
55 |
56 | 57 |
58 |
59 |
60 | 61 |
62 |
63 |
64 |
65 | 66 | } 67 | 68 | export async function getServerSideProps(ctx) { 69 | const _result = await (await fetch(`https://api.themoviedb.org/3/movie/${ctx?.query?.id}?api_key=3044afc915e1301ae1d9551614db3711&append_to_response=videos,credits,reviews`).then(r => r.json())); 70 | if (_result?.status_code === 34) { 71 | if (ctx?.res) { 72 | ctx?.res.writeHead(307, { Location: '/' }) 73 | ctx?.res.end() 74 | } else { 75 | Router.replace('/') 76 | } 77 | } 78 | return { 79 | props: { 80 | data: _result 81 | }, 82 | } 83 | } 84 | 85 | export default Movie; -------------------------------------------------------------------------------- /src/pages/series/[id].jsx: -------------------------------------------------------------------------------- 1 | import { AiFillStar } from "react-icons/ai" 2 | import { BsFillPlayFill } from "react-icons/bs" 3 | import WatchTrailer from "../../components/Global/WatchTrailer"; 4 | import CardGroup from "../../components/Static/CardGroup"; 5 | import Router from 'next/router' 6 | import { NextSeo } from 'next-seo'; 7 | 8 | function Movie({ data }) { 9 | const backdropImage = data?.backdrop_path ? ("https://image.tmdb.org/t/p/original" + data?.backdrop_path) : '/no-image.svg'; 10 | const verticalImage = data?.poster_path ? ("https://image.tmdb.org/t/p/w400" + data?.poster_path) : '/no-image.svg'; 11 | 12 | const latestTrailer = data?.videos?.results?.filter((video) => video.official === true && video.type === "Trailer")?.[0]; 13 | 14 | return <> 15 | 19 |
20 |
21 | 22 |
23 | 24 |
25 |

{data?.name}

26 |
27 |
{data?.first_air_date?.split('-')[0]}
28 |

{data?.vote_average}

29 |
{data?.genres?.[0]?.name}
30 | {data?.homepage && ( 31 | 36 | )} 37 |
38 |

{data?.overview}

39 | 40 |
41 | {latestTrailer?.key && ( 42 | 43 | 49 | 50 | )} 51 | 52 |
53 |
54 |
55 |
56 | 57 |
58 |
59 |
60 | 61 |
62 |
63 | a.poster_path !== null)} /> 64 |
65 |
66 |
67 |
68 | 69 | } 70 | 71 | export async function getServerSideProps(ctx) { 72 | const _result = await (await fetch(`https://api.themoviedb.org/3/tv/${ctx?.query?.id}?api_key=3044afc915e1301ae1d9551614db3711&append_to_response=videos,credits,reviews`).then(r => r.json())); 73 | if (_result?.status_code === 34) { 74 | if (ctx?.res) { 75 | ctx?.res.writeHead(307, { Location: '/' }) 76 | ctx?.res.end() 77 | } else { 78 | Router.replace('/') 79 | } 80 | } 81 | return { 82 | props: { 83 | data: _result 84 | }, 85 | } 86 | } 87 | 88 | export default Movie; -------------------------------------------------------------------------------- /src/components/Static/Header.jsx: -------------------------------------------------------------------------------- 1 | import Link from "next/link" 2 | import { BsFillPlayFill } from "react-icons/bs" 3 | import { Menu, Transition } from '@headlessui/react' 4 | import { Fragment, useEffect, useRef, useState } from 'react' 5 | 6 | export default function Header() { 7 | return <> 8 |
9 |
10 | 11 |
12 | 13 |

Movie App

14 |
15 | 16 |
17 | 32 | 33 |
34 | 35 | Menu 36 | 37 |
38 | 47 | 48 |
49 | 50 | 51 | {({ active }) => ( 52 | 53 | 59 | )} 60 | 61 | 62 | 63 | 64 | {({ active }) => ( 65 | 66 | 72 | )} 73 | 74 | 75 | 76 | 77 | {({ active }) => ( 78 | 79 | 85 | )} 86 | 87 | 88 | 89 | 90 | {({ active }) => ( 91 | 92 | 98 | )} 99 | 100 | 101 |
102 |
103 |
104 |
105 |
106 | 107 | } 108 | -------------------------------------------------------------------------------- /src/components/Static/Card.jsx: -------------------------------------------------------------------------------- 1 | import { useRouter } from "next/router"; 2 | import { AiFillStar } from "react-icons/ai" 3 | import { BsFillPlayFill } from "react-icons/bs" 4 | import Link from "next/link"; 5 | 6 | export default function Card({ value = "movies", type = "vertical", movie }) { 7 | const router = useRouter(); 8 | const verticalImage = value !== 'actors' ? 9 | (value === "actors" ? ("https://image.tmdb.org/t/p/w400" + movie?.profile_path) : ("https://image.tmdb.org/t/p/w400" + movie?.poster_path)) : 10 | (movie?.profile_path ? (value === "actors" ? ("https://image.tmdb.org/t/p/w400" + movie?.profile_path) : ("https://image.tmdb.org/t/p/w400" + movie?.poster_path)) : `https://avatars.dicebear.com/api/personas/${movie?.name?.replace(/ /g, '-')}.svg`) 11 | const backdropImage = "https://image.tmdb.org/t/p/original" + movie?.backdrop_path; 12 | 13 | const HorizontalCard = () => { 14 | return <> 15 |
16 |
19 |
20 |
21 |

{movie?.title || movie?.name}

22 | {value !== "actors" && value !== "seasons" && ( 23 |
24 |

{movie?.vote_average}

25 |
26 | )} 27 |
28 |
29 |
30 | 31 | } 32 | const VerticalCard = () => { 33 | return <> 34 |
35 |
38 |
39 |
40 |
41 |

{movie?.title || movie?.name}

42 |
43 |
44 |
45 | 46 |
47 | 48 | } 49 | const HorticalCard = () => { 50 | return <> 51 |
52 |
53 |
54 |
55 | 56 |
57 |

{movie?.title || movie?.name}

58 |

{movie?.vote_average}

59 |
60 |
61 |
62 |
63 |
64 | 65 | } 66 | const RenderCards = () => { 67 | return <> 68 | {value !== "seasons" ? ( 69 | <> 70 | {type === "horizontal" && 71 | 72 | 73 | 74 | 75 | 76 | } 77 | {type === "vertical" && 78 | 79 | 80 | 81 | 82 | 83 | } 84 | {type === "hortical" && 85 | 86 | 87 | 88 | 89 | 90 | } 91 | 92 | ) : ( 93 | <> 94 | {type === "horizontal" && 95 | 96 | 97 | 98 | } 99 | {type === "vertical" && 100 | 101 | 102 | 103 | } 104 | {type === "hortical" && 105 | 106 | 107 | 108 | } 109 | 110 | )} 111 | 112 | 113 | } 114 | return <> 115 | {value !== "actors" && movie?.poster_path && ( 116 | 117 | )} 118 | {value === "actors" && ( 119 | 120 | )} 121 | 122 | } --------------------------------------------------------------------------------