├── public
├── robots.txt
├── img
│ ├── favicon.ico
│ ├── logo192.png
│ └── logo512.png
├── manifest.json
└── index.html
├── src
├── Pages
│ ├── Home
│ │ ├── Home.scss
│ │ └── Home.jsx
│ ├── Login
│ │ ├── Login.jsx
│ │ └── Login.scss
│ └── Register
│ │ ├── Register.jsx
│ │ └── Register.scss
├── axios.js
├── App.scss
├── reportWebVitals.js
├── index.css
├── index.js
├── App.jsx
├── Components
│ ├── Row
│ │ ├── Row.scss
│ │ └── Row.js
│ ├── Navbar
│ │ ├── Navbar.jsx
│ │ └── Navbar.scss
│ └── Featured
│ │ ├── Featured.scss
│ │ └── Featured.jsx
└── requests.js
├── .gitignore
├── package.json
└── README.md
/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/public/img/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuradRahmanzada/Netflix-clone/HEAD/public/img/favicon.ico
--------------------------------------------------------------------------------
/public/img/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuradRahmanzada/Netflix-clone/HEAD/public/img/logo192.png
--------------------------------------------------------------------------------
/public/img/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MuradRahmanzada/Netflix-clone/HEAD/public/img/logo512.png
--------------------------------------------------------------------------------
/src/Pages/Home/Home.scss:
--------------------------------------------------------------------------------
1 | .home {
2 | background-color: var(--main-color);
3 | overflow: hidden;
4 | }
--------------------------------------------------------------------------------
/src/axios.js:
--------------------------------------------------------------------------------
1 | import axios from "axios";
2 |
3 | const instance = axios.create({
4 | baseURL: "https://api.themoviedb.org/3",
5 | });
6 |
7 | export default instance;
--------------------------------------------------------------------------------
/src/App.scss:
--------------------------------------------------------------------------------
1 | :root{
2 | --main-color: #0b0b0b;
3 | }
4 |
5 | a {
6 | text-decoration: none;
7 | color: white;
8 |
9 | &:hover {
10 | color: red;
11 | }
12 | }
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/src/reportWebVitals.js:
--------------------------------------------------------------------------------
1 | const reportWebVitals = onPerfEntry => {
2 | if (onPerfEntry && onPerfEntry instanceof Function) {
3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
4 | getCLS(onPerfEntry);
5 | getFID(onPerfEntry);
6 | getFCP(onPerfEntry);
7 | getLCP(onPerfEntry);
8 | getTTFB(onPerfEntry);
9 | });
10 | }
11 | };
12 |
13 | export default reportWebVitals;
14 |
--------------------------------------------------------------------------------
/src/index.css:
--------------------------------------------------------------------------------
1 | * {
2 | margin: 0;
3 | font-family: 'Roboto', sans-serif;
4 | }
5 |
6 | body {
7 | margin: 0;
8 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
9 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
10 | sans-serif;
11 | -webkit-font-smoothing: antialiased;
12 | -moz-osx-font-smoothing: grayscale;
13 | }
14 |
15 | code {
16 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
17 | monospace;
18 | }
19 |
--------------------------------------------------------------------------------
/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import './index.css';
4 | import App from './App';
5 | import reportWebVitals from './reportWebVitals';
6 |
7 | const root = ReactDOM.createRoot(document.getElementById('root'));
8 | root.render(
9 |
10 |
11 |
12 | );
13 |
14 | // If you want to start measuring performance in your app, pass a function
15 | // to log results (for example: reportWebVitals(console.log))
16 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
17 | reportWebVitals();
18 |
--------------------------------------------------------------------------------
/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/src/App.jsx:
--------------------------------------------------------------------------------
1 | import "./App.scss";
2 | import Home from "./Pages/Home/Home";
3 | import Register from "./Pages/Register/Register";
4 | import Login from "./Pages/Login/Login";
5 | import { BrowserRouter, Routes, Route } from "react-router-dom";
6 |
7 | function App() {
8 | return (
9 |
10 |
11 |
12 | } />
13 | } />
14 | } />
15 |
16 |
17 |
18 | );
19 | }
20 |
21 | export default App;
22 |
--------------------------------------------------------------------------------
/src/Components/Row/Row.scss:
--------------------------------------------------------------------------------
1 | .row {
2 | color: #fff;
3 | margin-left: 20px;
4 | margin-top: 1rem;
5 |
6 | h2 {
7 | margin-left: 1.3rem;
8 | font-size: 1.5rem;
9 | }
10 |
11 | .row_posters {
12 | display: flex;
13 | overflow-y: hidden;
14 | overflow-x: scroll;
15 | padding: 20px;
16 |
17 | &::-webkit-scrollbar {
18 | display: none;
19 | }
20 |
21 | .row_poster {
22 | object-fit: contain;
23 | width: max-content;
24 | max-height: 180px;
25 | margin-right: 10px;
26 | transition: transform 450ms;
27 | cursor: pointer;
28 |
29 | &:hover {
30 | transform: scale(1.1);
31 | }
32 | }
33 |
34 | .row_posterLarge {
35 | max-height: 250px;
36 |
37 | &:hover {
38 | transform: scale(1.11);
39 | }
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/requests.js:
--------------------------------------------------------------------------------
1 | const API_KEY = "2d480ccdc537e82d39e759a7afcd0fac";
2 |
3 | const requests = {
4 | fetchTrending: `/trending/all/week?api_key=${API_KEY}&language=en-US`,
5 | fetchNetflixOriginals: `/discover/tv?api_key=${API_KEY}&with_network=123`,
6 | fetchTopRated: `/movie/top_rated?api_key=${API_KEY}&language=en-US`,
7 | fetchActionMovies: `/discover/movie?api_key=${API_KEY}&with_genres=28`,
8 | fetchComedyMovies: `/discover/movie?api_key=${API_KEY}&with_genres=35`,
9 | fetchHorrorMovies: `/discover/movie?api_key=${API_KEY}&with_genres=27`,
10 | fetchRomanceMovies: `/discover/movie?api_key=${API_KEY}&with_genres=10749`,
11 | fetchMystery: `/discover/movie?api_key=${API_KEY}&with_genres=9648`,
12 | fetchSciFi: `/discover/movie?api_key=${API_KEY}&with_genres=878`,
13 | fetchWestern: `/discover/movie?api_key=${API_KEY}&with_genres=37`,
14 | fetchAnimation: `/discover/movie?api_key=${API_KEY}&with_genres=16`,
15 | fetchTV: `/discover/movie?api_key=${API_KEY}&with_genres=10770`,
16 | };
17 |
18 | export default requests;
19 |
--------------------------------------------------------------------------------
/src/Pages/Home/Home.jsx:
--------------------------------------------------------------------------------
1 | import React, { useState, useEffect, useRef } from "react";
2 | import "./Home.scss";
3 | import Navbar from "../../Components/Navbar/Navbar";
4 | import Featured from "../../Components/Featured/Featured";
5 | import requests from "../../requests";
6 | import Row from "../../Components/Row/Row";
7 |
8 | const Home = () => {
9 | return (
10 |
11 |
12 |
13 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | );
26 | };
27 |
28 | export default Home;
29 |
--------------------------------------------------------------------------------
/src/Pages/Login/Login.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import "./Login.scss";
3 | import {Link } from 'react-router-dom';
4 |
5 | function Login() {
6 | return (
7 |
8 |
9 |
10 |
15 |
16 |
17 |
18 |
33 |
34 |
35 | );
36 | }
37 |
38 | export default Login;
39 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "netflix-clone",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@material-ui/core": "^4.12.4",
7 | "@material-ui/icons": "^4.11.3",
8 | "@testing-library/jest-dom": "^5.16.4",
9 | "@testing-library/react": "^13.1.1",
10 | "@testing-library/user-event": "^13.5.0",
11 | "axios": "^0.27.2",
12 | "movie-trailer": "^2.1.0",
13 | "react": "^18.1.0",
14 | "react-dom": "^18.1.0",
15 | "react-responsive-carousel": "^3.2.23",
16 | "react-router-dom": "^6.3.0",
17 | "react-scripts": "5.0.1",
18 | "react-youtube": "^9.0.1",
19 | "sass": "^1.51.0",
20 | "slick-carousel": "^1.8.1",
21 | "web-vitals": "^2.1.4"
22 | },
23 | "scripts": {
24 | "start": "react-scripts start",
25 | "build": "react-scripts build",
26 | "test": "react-scripts test",
27 | "eject": "react-scripts eject"
28 | },
29 | "eslintConfig": {
30 | "extends": [
31 | "react-app",
32 | "react-app/jest"
33 | ]
34 | },
35 | "browserslist": {
36 | "production": [
37 | ">0.2%",
38 | "not dead",
39 | "not op_mini all"
40 | ],
41 | "development": [
42 | "last 1 chrome version",
43 | "last 1 firefox version",
44 | "last 1 safari version"
45 | ]
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/Components/Navbar/Navbar.jsx:
--------------------------------------------------------------------------------
1 | import React, { useState } from "react";
2 | import "./Navbar.scss";
3 | import SearchIcon from "@material-ui/icons/Search";
4 | import NotificationIcon from "@material-ui/icons/Notifications";
5 | import ArrowDropDown from "@material-ui/icons/ArrowDropDown";
6 | import Avatar from "@material-ui/core/Avatar/Avatar";
7 | import { Link } from "react-router-dom";
8 | const Navbar = () => {
9 | const [isScrolled, setIsScrolled] = useState(false);
10 |
11 | window.onscroll = () => {
12 | setIsScrolled(window.pageYOffset === 0 ? false : true);
13 | return () => (window.onscroll = null);
14 | };
15 |
16 | return (
17 |
18 |
19 |
20 |
24 |
Home
25 |
Series
26 |
Movies
27 |
New and Popular
28 |
My List
29 |
30 |
31 |
32 |
33 |
KID
34 |
35 |
36 |
37 |
38 |
39 | Settings
40 |
41 | Logout
42 |
43 |
44 |
45 |
46 |
47 |
48 | );
49 | };
50 |
51 | export default Navbar;
52 |
--------------------------------------------------------------------------------
/src/Pages/Register/Register.jsx:
--------------------------------------------------------------------------------
1 | import React, { useRef, useState } from "react";
2 | import "./Register.scss";
3 | import { Link } from "react-router-dom";
4 |
5 | function Register() {
6 | const [email, setEmail] = useState("");
7 | const [password, setPassword] = useState("");
8 |
9 | const emailRef = useRef();
10 | const passwordRef = useRef();
11 |
12 | const handleStart = () => {
13 | setEmail(emailRef.current.value);
14 | };
15 |
16 | const handleFinish = () => {
17 | setPassword(passwordRef.current.value);
18 | };
19 |
20 | return (
21 |
22 |
23 |
24 |
29 |
30 | Sign In
31 |
32 |
33 |
34 |
35 |
Unlimited movies, TV shows, and more.
36 |
Watch anywhere. Cancel anytime
37 |
38 | Ready to watch? Enter your email to create or restart your membership.
39 |
40 | {!email ? (
41 |
42 |
43 |
44 | Get Started
45 |
46 |
47 | ) : (
48 |
54 | )}
55 |
56 |
57 | );
58 | }
59 |
60 | export default Register;
61 |
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
12 |
13 |
17 |
18 |
19 |
20 |
24 |
33 | React App
34 |
35 |
36 | You need to enable JavaScript to run this app.
37 |
38 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/src/Components/Featured/Featured.scss:
--------------------------------------------------------------------------------
1 | .featured {
2 | height: 90vh;
3 | position: relative;
4 |
5 | .category {
6 | position: absolute;
7 | top: 80px;
8 | left: 50px;
9 | font-size: 30px;
10 | font-weight: 500;
11 | color: white;
12 | display: flex;
13 | align-items: center;
14 |
15 | select {
16 | cursor: pointer;
17 | background-color: var(--main-color);
18 | border: 1px solid white;
19 | color: white;
20 | margin-left: 20px;
21 | padding: 5px;
22 | }
23 |
24 | }
25 |
26 | img {
27 | width: 100%;
28 | height: 100%;
29 | object-fit: cover;
30 | }
31 |
32 | .info {
33 | width: 35%;
34 | position: absolute;
35 | left: 50px;
36 | bottom: 100px;
37 | color: white;
38 | display: flex;
39 | flex-direction: column;
40 |
41 | .desc {
42 | margin: 20px 0px;
43 | }
44 |
45 | .banner_title {
46 | font-size: 3rem;
47 | font-weight: 800;
48 | padding-bottom: 0.3rem;
49 | }
50 |
51 | .buttons {
52 | display: flex;
53 |
54 | button {
55 | padding: 10px 20px;
56 | border: none;
57 | border-radius: 5px;
58 | display: flex;
59 | align-items: center;
60 | justify-content: center;
61 | font-size: 18px;
62 | font-weight: bolder;
63 | margin-right: 10px;
64 | cursor: pointer;
65 |
66 | &.play {
67 | background-color: white;
68 | color: var(--main-color);
69 | }
70 |
71 | &.more {
72 | background-color: gray;
73 | color: white;
74 | }
75 |
76 | span {
77 | margin-left: 5px;
78 | }
79 | }
80 | }
81 | }
82 | }
83 |
84 | //
--------------------------------------------------------------------------------
/src/Components/Row/Row.js:
--------------------------------------------------------------------------------
1 | import React, { useState, useEffect, useRef } from "react";
2 | import axios from "../../axios";
3 | import YouTube from "react-youtube";
4 | import movieTrailer from "movie-trailer";
5 | import {
6 | ArrowBackIosOutlined,
7 | ArrowForwardIosOutlined,
8 | } from "@material-ui/icons";
9 | import "./Row.scss";
10 |
11 | const base_url = "https://image.tmdb.org/t/p/original";
12 |
13 | function Row({ title, fetchUrl, isLargeRow }) {
14 | const [movies, setMovies] = useState([]);
15 | const [trailerUrl, setTrailerUrl] = useState("");
16 |
17 | useEffect(() => {
18 | async function fetchData() {
19 | const request = await axios.get(fetchUrl);
20 | setMovies(request.data.results);
21 | return request;
22 | }
23 | fetchData();
24 | }, [fetchUrl]);
25 |
26 | const opts = {
27 | height: "390",
28 | width: "99%",
29 | playerVars: {
30 | autoplay: 0,
31 | },
32 | };
33 |
34 | const handleClick = (movie) => {
35 | if (trailerUrl) {
36 | setTrailerUrl("");
37 | } else {
38 | movieTrailer(movie?.title || "")
39 | .then((url) => {
40 | const urlParams = new URLSearchParams(new URL(url).search);
41 | setTrailerUrl(urlParams.get("v"));
42 | })
43 | .catch((error) => console.log(error));
44 | }
45 | };
46 |
47 |
48 |
49 | return (
50 |
51 |
{title}
52 |
53 | {movies?.map((movie) => {
54 | return (
55 |
handleClick(movie)}
58 | className={`row_poster ${isLargeRow && "row_posterLarge"}`}
59 | src={`${base_url}${
60 | isLargeRow ? movie.poster_path : movie.backdrop_path
61 | }`}
62 | alt={movie.name}
63 | />
64 | );
65 | })}
66 |
67 |
68 | {trailerUrl && }
69 |
70 |
71 | );
72 | }
73 |
74 | export default Row;
75 |
--------------------------------------------------------------------------------
/src/Pages/Login/Login.scss:
--------------------------------------------------------------------------------
1 | .login {
2 | width: 100vw;
3 | height: 100vh;
4 | background: linear-gradient(
5 | to bottom,
6 | rgba(0, 0, 0, 0) 0%,
7 | rgba(0, 0, 0, 1) 100%
8 | ),
9 | url("https://user-images.githubusercontent.com/33485020/108069438-5ee79d80-7089-11eb-8264-08fdda7e0d11.jpg");
10 | background-size: cover;
11 | position: relative;
12 |
13 | .top {
14 | .wrapper {
15 | padding: 20px 50px;
16 | display: flex;
17 | align-items: center;
18 | justify-content: space-between;
19 |
20 | .logo {
21 | height: 40px;
22 | }
23 | }
24 | }
25 |
26 | .container {
27 | width: 100%;
28 | height: 100%;
29 | position: absolute;
30 | top: 0;
31 | left: 0;
32 | display: flex;
33 | flex-direction: column;
34 | align-items: center;
35 | justify-content: center;
36 | color: white;
37 |
38 | form {
39 | width: 300px;
40 | height: 300px;
41 | padding: 30px;
42 | border-radius: 5px;
43 | background-color: var(--main-color);
44 | display: flex;
45 | flex-direction: column;
46 | justify-content: space-around;
47 |
48 | input {
49 | height: 40px;
50 | border-radius: 5px;
51 | background-color: gray;
52 | color: white;
53 | padding: 8px;
54 |
55 | &::placeholder {
56 | color: white;
57 | }
58 | }
59 |
60 | a {
61 | height: 40px;
62 | border-radius: 5px;
63 | background-color: red;
64 | color: white;
65 | border: none;
66 | text-decoration: none;
67 | display: flex;
68 | align-items: center;
69 | justify-content: center;
70 | font-size: 18px;
71 | font-weight: 500;
72 | cursor: pointer;
73 | }
74 |
75 | span {
76 | color: lightgray;
77 |
78 | b {
79 | color: white;
80 | }
81 | }
82 | }
83 | }
84 | }
85 |
--------------------------------------------------------------------------------
/src/Pages/Register/Register.scss:
--------------------------------------------------------------------------------
1 | @mixin buttonStyle {
2 | flex: 3;
3 | height: 100%;
4 | background-color: red;
5 | border: none;
6 | color: white;
7 | font-size: 20px;
8 | text-decoration: none;
9 | display: flex;
10 | align-items: center;
11 | justify-content: center;
12 | cursor: pointer;
13 | }
14 |
15 |
16 | .register {
17 | width: 100vw;
18 | height: 100vh;
19 | background: linear-gradient(
20 | to bottom,
21 | rgba(0, 0, 0, 0) 0%,
22 | rgba(0, 0, 0, 1) 100%
23 | ),
24 | url("https://cdn.hipwallpaper.com/i/98/21/dUyCkp.jpg");
25 | background-size: cover;
26 | position: relative;
27 |
28 | .top {
29 | .wrapper {
30 | padding: 20px 50px;
31 | display: flex;
32 | align-items: center;
33 | justify-content: space-between;
34 |
35 | .logo {
36 | height: 40px;
37 | cursor: pointer;
38 | }
39 |
40 | .loginButton{
41 | background-color: red;
42 | color: white;
43 | border-radius: 5px;
44 | text-decoration: none;
45 | padding: 5px 15px;
46 | cursor: pointer;
47 | }
48 | }
49 | }
50 |
51 | .container {
52 | width: 100%;
53 | height: 90%;
54 | position: absolute;
55 | // top: 0;
56 | left: 0;
57 | display: flex;
58 | flex-direction: column;
59 | align-items: center;
60 | justify-content: center;
61 | color: white;
62 |
63 | h1 {
64 | font-size: 50px;
65 | }
66 |
67 | h2 {
68 | margin: 20px;
69 | }
70 |
71 | p {
72 | font-size: 20px;
73 | }
74 |
75 | .input {
76 | width: 50%;
77 | background-color: white;
78 | display: flex;
79 | align-items: center;
80 | justify-content: space-between;
81 | margin-top: 20px;
82 | height: 50px;
83 | border-radius: 5px;
84 |
85 | input {
86 | flex: 9;
87 | height: 100%;
88 | border: none;
89 | padding: 0 10px;
90 | outline: none;
91 | }
92 |
93 | .registerButton {
94 | @include buttonStyle()
95 | }
96 | }
97 | }
98 | }
99 |
100 |
101 |
--------------------------------------------------------------------------------
/src/Components/Navbar/Navbar.scss:
--------------------------------------------------------------------------------
1 |
2 |
3 | .navbar {
4 | color: white;
5 | font-size: 14px;
6 | position: fixed;
7 | top: 0;
8 | width: 100%;
9 | z-index: 999;
10 | background: linear-gradient(to top, transparent 0%, rgb(0 , 0, 0, 0.3), 50%);
11 |
12 | &.scrolled{
13 | background-color: var(--main-color);
14 | }
15 |
16 | .container {
17 | padding: 0 50px;
18 | display: flex;
19 | align-items: center;
20 | justify-content: space-between;
21 | height: 70px;
22 |
23 | .left {
24 | display: flex;
25 | align-items: center;
26 |
27 | img {
28 | height: 25px;
29 | margin-right: 40px;
30 | }
31 |
32 | span {
33 | margin-right: 20px;
34 | cursor: pointer;
35 |
36 | &:hover {
37 | color: red;
38 | transition: 0.3s all ease;
39 | }
40 | }
41 |
42 |
43 | }
44 |
45 | .right {
46 | display: flex;
47 | align-items: center;
48 |
49 | .icon {
50 | margin: 0 15px;
51 | cursor: pointer;
52 | }
53 |
54 | .MuiSvgIcon-root {
55 | width: 30px;
56 | height: 30px;
57 | cursor: pointer;
58 | }
59 |
60 | .profile {
61 | .options {
62 | display: none;
63 | background-color: var(--main-color);
64 | border-radius: 5px;
65 | }
66 |
67 | span {
68 | padding: 10px;
69 | cursor: pointer;
70 |
71 | &:hover {
72 | color: red;
73 | }
74 | }
75 |
76 |
77 | &:hover{
78 | .options{
79 | display: flex;
80 | flex-direction: column;
81 | position: absolute;
82 | }
83 | }
84 | }
85 | }
86 | }
87 | }
88 |
89 | @media screen and (max-width: 720px) {
90 | .navbar_link {
91 | display: none;
92 | }
93 | }
--------------------------------------------------------------------------------
/src/Components/Featured/Featured.jsx:
--------------------------------------------------------------------------------
1 | import React, { useState, useEffect } from "react";
2 | import "./Featured.scss";
3 | import { InfoOutlined, PlayArrow } from "@material-ui/icons";
4 | import requests from "../../requests";
5 | import axios from "../../axios";
6 |
7 | function Featured({ type }) {
8 | const [movie, setMovie] = useState([]);
9 |
10 | useEffect(() => {
11 | async function fetchData() {
12 | const request = await axios.get(requests.fetchNetflixOriginals);
13 | setMovie(
14 | request.data.results[
15 | Math.floor(Math.random() * request.data.results.length - 1)
16 | ]
17 | );
18 | // Math.floor(Math.random() * request.data.results.length -1)
19 | return request;
20 | }
21 | fetchData();
22 | }, []);
23 |
24 | function truncate(str, n) {
25 | return str?.length > n ? str.substr(0, n - 1) + "..." : str;
26 | }
27 |
28 | return (
29 |
30 | {type && (
31 |
32 | {type === "movie" ? "Movies" : "Series"}
33 |
34 | Genre
35 | Adventure
36 | Comedy
37 | Crime
38 | Fantasy
39 | Historical
40 | Horror
41 | Romance
42 | Sci-fi
43 | Thriller
44 | Western
45 | Animation
46 | Drama
47 | Documentary
48 |
49 |
50 | )}
51 |
52 |
56 |
57 |
58 |
{movie?.title || movie?.name || movie?.original_name}
59 |
{truncate(movie?.overview, 350)}
60 |
61 |
62 |
63 | Play
64 |
65 |
66 |
67 | Info
68 |
69 |
70 |
71 |
72 | );
73 | }
74 |
75 | export default Featured;
76 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Netflix Clone Built Using React.JS & Firebase
5 |
6 |
7 |
8 | This is a clone of Netflix website built using React.JS as a Front-end. It's not a replica, and it doesn't have all the features of Netflix website. it's a similar version of Netflix with my own design touch, showing my abilities in React.JS to build something advancedlike Netflix. It contains the home page, sign-in page, sign-up page, browse page.
9 |
10 | Take a look at the live version here: https://netflix-clonee01.netlify.app/ :octocat: :heart_eyes:
11 |
12 |
13 | ## Table of Contents
14 |
15 | - [Project Walk-Through](#project-walk-through)
16 | - [Home Page](#home-page)
17 | 
18 |
19 | - [Sign-in Page](#sign-in-page)
20 | 
21 |
22 | - [Browse Page](#browse-page)
23 | 
24 | 
25 |
26 | ## Technologies
27 | Basically, this project was developed based on the following technologies:
28 |
29 |
30 |
31 |   
32 |
33 |   
34 |
35 |
36 | # Getting Started with Create React App
37 |
38 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
39 |
40 | ## Available Scripts
41 |
42 | In the project directory, you can run:
43 |
44 | ### `npm start`
45 |
46 | Runs the app in the development mode.\
47 | Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
48 |
49 | The page will reload when you make changes.\
50 | You may also see any lint errors in the console.
51 |
52 | ### `npm test`
53 |
54 | Launches the test runner in the interactive watch mode.\
55 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
56 |
57 | ### `npm run build`
58 |
59 | Builds the app for production to the `build` folder.\
60 | It correctly bundles React in production mode and optimizes the build for the best performance.
61 |
62 | The build is minified and the filenames include the hashes.\
63 | Your app is ready to be deployed!
64 |
65 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
66 |
67 | ### `npm run eject`
68 |
69 | **Note: this is a one-way operation. Once you `eject`, you can't go back!**
70 |
71 | If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
72 |
73 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.
74 |
75 | You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.
76 |
77 | ## Learn More
78 |
79 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
80 |
81 | To learn React, check out the [React documentation](https://reactjs.org/).
82 |
83 | ### Code Splitting
84 |
85 | This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
86 |
87 | ### Analyzing the Bundle Size
88 |
89 | This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
90 |
91 | ### Making a Progressive Web App
92 |
93 | This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
94 |
95 | ### Advanced Configuration
96 |
97 | This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
98 |
99 | ### Deployment
100 |
101 | This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
102 |
103 | ### `npm run build` fails to minify
104 |
105 | This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
106 |
--------------------------------------------------------------------------------