├── public
├── star.png
├── favicon.ico
├── loading.gif
├── logo192.png
├── logo512.png
├── half_star.png
├── robots.txt
├── manifest.json
└── index.html
├── src
├── App.css
├── setupTests.js
├── App.test.js
├── App.jsx
├── comps
│ ├── page404.jsx
│ ├── itemVod.jsx
│ ├── yearsLinks.jsx
│ ├── vodApp.css
│ ├── carouselVod.jsx
│ ├── infoItemVod.jsx
│ └── vodApp.jsx
├── index.css
├── reportWebVitals.js
├── index.jsx
├── appRoutes.jsx
└── logo.svg
├── package.json
└── README.md
/public/star.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/byarin90/vod-app/HEAD/public/star.png
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/byarin90/vod-app/HEAD/public/favicon.ico
--------------------------------------------------------------------------------
/public/loading.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/byarin90/vod-app/HEAD/public/loading.gif
--------------------------------------------------------------------------------
/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/byarin90/vod-app/HEAD/public/logo192.png
--------------------------------------------------------------------------------
/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/byarin90/vod-app/HEAD/public/logo512.png
--------------------------------------------------------------------------------
/public/half_star.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/byarin90/vod-app/HEAD/public/half_star.png
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/src/App.css:
--------------------------------------------------------------------------------
1 | /* global css */
2 | header nav .nav li a{
3 | padding:0 8px;
4 | color:black;
5 | text-decoration: none;
6 | }
--------------------------------------------------------------------------------
/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom';
6 |
--------------------------------------------------------------------------------
/src/App.test.js:
--------------------------------------------------------------------------------
1 | import { render, screen } from '@testing-library/react';
2 | import App from './App';
3 |
4 | test('renders learn react link', () => {
5 | render( );
6 | const linkElement = screen.getByText(/learn react/i);
7 | expect(linkElement).toBeInTheDocument();
8 | });
9 |
--------------------------------------------------------------------------------
/src/App.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import './App.css';
3 | import AppRoutes from './appRoutes';
4 |
5 |
6 |
7 | function App() {
8 | return (
9 |
10 |
11 |
12 | );
13 | }
14 |
15 | export default App;
16 |
--------------------------------------------------------------------------------
/src/comps/page404.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { Link } from 'react-router-dom'
3 |
4 | export default function Page404() {
5 | return (
6 |
7 |
Page not found, 404!
8 | Back to home page
9 |
10 | )
11 | }
12 |
--------------------------------------------------------------------------------
/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/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.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom';
3 | import './index.css';
4 | import App from './App';
5 | import reportWebVitals from './reportWebVitals';
6 |
7 | ReactDOM.render(
8 |
9 |
10 | ,
11 | document.getElementById('root')
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/comps/itemVod.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { Link } from 'react-router-dom';
3 |
4 | export default function ItemVod(props) {
5 | let item = props.item;
6 | item.Poster = item.Poster != "N/A" ? item.Poster : "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRSWSxsVpAmqb_T7CLGolJ193Bw9xh7X7r0yQ&usqp=CAU";
7 | return (
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | )
16 | }
17 |
--------------------------------------------------------------------------------
/src/appRoutes.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { BrowserRouter, Routes, Route } from 'react-router-dom';
3 | import InfoItemVod from './comps/infoItemVod';
4 | import Page404 from './comps/page404';
5 | import VodApp from './comps/vodApp';
6 |
7 | export default function AppRoutes(props) {
8 | return (
9 |
10 |
11 | } />
12 | {/* } /> */}
13 | } />
14 | } />
15 | } />
16 | } />
17 | } />
18 |
19 | © 2022 Copyright: Yarin Bukai
20 |
21 |
22 | )
23 | }
24 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "feb-app",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^5.16.2",
7 | "@testing-library/react": "^12.1.3",
8 | "@testing-library/user-event": "^13.5.0",
9 | "axios": "^0.26.1",
10 | "bootstrap": "^5.1.3",
11 | "react": "^17.0.2",
12 | "react-bootstrap": "^2.2.2",
13 | "react-dom": "^17.0.2",
14 | "react-icons": "^4.3.1",
15 | "react-router-dom": "^6.2.2",
16 | "react-scripts": "5.0.0",
17 | "react-select": "^5.2.2",
18 | "web-vitals": "^2.1.4"
19 | },
20 | "scripts": {
21 | "start": "react-scripts start",
22 | "build": "react-scripts build",
23 | "test": "react-scripts test",
24 | "eject": "react-scripts eject"
25 | },
26 | "eslintConfig": {
27 | "extends": [
28 | "react-app",
29 | "react-app/jest"
30 | ]
31 | },
32 | "browserslist": {
33 | "production": [
34 | ">0.2%",
35 | "not dead",
36 | "not op_mini all"
37 | ],
38 | "development": [
39 | "last 1 chrome version",
40 | "last 1 firefox version",
41 | "last 1 safari version"
42 | ]
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
19 |
20 |
29 | VodApp
30 |
31 |
32 |
33 |
34 | You need to enable JavaScript to run this app.
35 |
36 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/src/comps/yearsLinks.jsx:
--------------------------------------------------------------------------------
1 | import React, { useEffect, useState } from 'react'
2 | import { Navbar, Container, Nav } from 'react-bootstrap'
3 | import { Link, useNavigate } from 'react-router-dom'
4 | import Select from 'react-select'
5 |
6 | export default function YearsLinks(props) {
7 | let navigate = useNavigate()
8 | const [years, setYears] = useState([])
9 | useEffect(() => {
10 | let temp_ar = []
11 | for (let index = 1950; index <= (new Date()).getFullYear(); index++) {
12 | temp_ar.push({
13 | label: index,
14 | value: index
15 | })
16 | }
17 | setYears(temp_ar)
18 | }, [])
19 |
20 | return (
21 |
22 |
23 |
24 | Top Years
25 |
26 |
27 |
28 | 1950
29 | 1960
30 | 1970
31 | 1980
32 | 1990
33 | 2000
34 | 2010
35 | 2020
36 |
37 |
38 |
39 |
40 | {
41 | navigate(`/search/${props.searchQ}/year/${item.value}`);
42 | }} options={years} className=' my-md-0 w-25 selectYears text-center'>
43 |
44 | )
45 | }
46 |
--------------------------------------------------------------------------------
/src/logo.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/comps/vodApp.css:
--------------------------------------------------------------------------------
1 | .vodApp {
2 | min-height: 100vh;
3 | }
4 |
5 | .carousleDiv {
6 | background-position: center;
7 | background-size: cover;
8 | min-height: 50vh;
9 | background-repeat: no-repeat;
10 | }
11 |
12 | .vodApp_nav {
13 | position: absolute;
14 | z-index: 3;
15 | min-height: 75px;
16 | width: 100%;
17 | }
18 |
19 | .logo {
20 | font-family: 'Bebas Neue', cursive;
21 | font-family: 'Rubik Wet Paint', cursive;
22 | font-size: 3em;
23 | color: rgb(222, 30, 30);
24 | transition: 800ms;
25 | text-shadow: 0px 0px 0 rgb(54, 49, 48), 1px 1px 0 rgb(49, 44, 43), 2px 2px 0 rgb(44, 39, 38), 3px 3px 0 rgb(39, 34, 33), 4px 4px 0 rgb(34, 29, 28), 5px 5px 0 rgb(29, 24, 23), 6px 6px 0 rgb(24, 19, 18), 7px 7px 0 rgb(19, 14, 13), 8px 8px 0 rgb(14, 9, 8), 9px 9px 0 rgb(9, 4, 3), 10px 10px 0 rgb(4, -1, 0), 11px 11px 10px rgba(0, 0, 0, 0.6), 11px 11px 1px rgba(0, 0, 0, 0.5), 0px 0px 10px rgba(0, 0, 0, .2);
26 | }
27 |
28 | .logo:hover {
29 | cursor: pointer;
30 | transform: scale(1.1);
31 | }
32 |
33 | .vodApp-input {
34 | border: solid white 2px;
35 | background: rgba(0, 0, 0, 0.497);
36 | border-radius: 8px;
37 | padding: 3px;
38 | box-shadow: 0px 10px 13px -7px #ffff, 5px 5px 15px 5px rgba(0, 0, 0, 0);
39 | }
40 |
41 | .vodApp-inputS {
42 | background: none;
43 | color: white;
44 | border: none;
45 | }
46 |
47 | .vodApp-inputS:focus {
48 | outline: none;
49 | }
50 |
51 | .vodApp-inputS::placeholder {
52 | color: white;
53 | font-weight: 500;
54 | }
55 |
56 | .yearLinks-link {
57 | text-decoration: none;
58 | color: rgb(142, 141, 141);
59 | cursor: pointer;
60 | transition: 800ms;
61 | }
62 |
63 | .yearLinks-link:hover {
64 | color: white;
65 | }
66 |
67 | .selectYears {
68 | font-weight: bold;
69 | }
70 |
71 | .itemInfo-img {
72 | box-shadow: 0px 10px 13px -7px #ffff, 5px 5px 15px 5px rgba(0, 0, 0, 0);
73 | border-radius: 100px;
74 | }
75 |
76 | .itemInfo-btn {
77 | box-shadow: 0px 10px 13px -7px rgb(207, 198, 186), 5px 5px 15px 5px rgba(0, 0, 0, 0);
78 | }
79 |
80 | .flash {
81 | background-position-y: -100px;
82 | }
83 |
84 | .batman {
85 | background-position-y: -20px;
86 | }
87 |
88 | @media screen and (max-width: 600px) {
89 | .logo {
90 | font-size: 2em;
91 | }
92 | .vodApp-input {
93 | width: 70%;
94 | }
95 | .flash {
96 | background-position-y: 0;
97 | }
98 | .batman {
99 | background-position-y: 0;
100 | }
101 | }
--------------------------------------------------------------------------------
/src/comps/carouselVod.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { Carousel } from 'react-bootstrap'
3 | import {FaPlay,FaInfoCircle} from 'react-icons/fa'
4 | import { useNavigate } from 'react-router-dom'
5 | export default function CarouselVod() {
6 | let nav = useNavigate()
7 | return (
8 |
9 |
10 |
11 |
12 | {
13 | nav('/video/tt6806448')
14 | }} className='btn btn-warning'>More Information
15 | Watch
16 |
17 |
18 |
19 |
20 | {
21 |
22 | nav('/video/tt3107288')
23 | }} className='btn btn-warning d-block d-md-inline'>More Information
24 | Watch
25 |
26 |
27 |
28 |
29 |
30 | {
31 | nav('/video/tt2975590')
32 | }} className='btn btn-warning d-block d-md-inline'>More Information
33 | Watch
34 |
35 |
36 |
37 |
38 | )
39 | }
40 |
--------------------------------------------------------------------------------
/src/comps/infoItemVod.jsx:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import React, { useEffect, useState } from 'react'
3 | import { Link, useParams } from 'react-router-dom';
4 |
5 | export default function InfoItemVod() {
6 | const { id,year,searchP } = useParams();
7 | const [obj,setObj] =useState({});
8 | const [loading,setLoading] = useState(false);
9 | const [stars, setStars] = useState([]);
10 |
11 | useEffect(() => {
12 | doApi();
13 | },[])
14 |
15 | useEffect(() => {
16 | makeStars();
17 | }, [obj])
18 |
19 |
20 | const doApi = async () => {
21 | setObj({})
22 | setLoading(true)
23 | let data = await axios.get(`https://www.omdbapi.com/?i=${id}&apikey=fd6aa444`);
24 | let d = data.data;
25 | let tempObj;
26 | tempObj = { name: d.Title, img: d.Poster, year: d.Year, info: d.Plot, genre: d.Genre, actors: d.Actors, rate: +(d.Ratings[0].Value).slice(0, 3) }
27 | setObj(tempObj)
28 | setLoading(false)
29 |
30 | }
31 |
32 | const makeStars = () => {
33 | setStars([]);
34 | let stars = [];
35 | for (let index = 0; index < obj.rate; index++) {
36 | stars.push()
37 | }
38 | if (obj.rate % 2 != 0) stars.push()
39 | setStars(stars);
40 | }
41 | return (
42 |
43 |
44 |
45 | {loading &&
}
46 |
47 |
48 |
49 |
{obj.name}
50 |
{obj.info}
51 |
Genre: {obj.genre}
52 |
Actors: {obj.actors}
53 |
54 |
Year: {obj.year}
55 |
{stars}
56 |
57 |
Back
58 |
59 |
60 |
61 | )
62 | }
--------------------------------------------------------------------------------
/src/comps/vodApp.jsx:
--------------------------------------------------------------------------------
1 | import React, { useEffect, useState } from 'react'
2 | import CarouselVod from './carouselVod'
3 | import './vodApp.css'
4 | import { FaSearch, FaFile } from 'react-icons/fa'
5 | import YearsLinks from './yearsLinks'
6 | import axios from 'axios'
7 | import ItemVod from './itemVod'
8 | import { useNavigate, useParams } from 'react-router-dom'
9 |
10 | export default function VodApp(props) {
11 | const [ar, setAr] = useState([])
12 | const [searchQ, setSearchQ] = useState('bank')
13 | const { year, searchP } = useParams();
14 | const [flag, setFlag] = useState(false)
15 | const [loading, setLoading] = useState(true);
16 | const nav = useNavigate();
17 |
18 | useEffect(() => {
19 | doApi()
20 | }, [year, flag])
21 |
22 | useEffect(() => {
23 | doApi()
24 | }, [searchP, year,searchP])
25 |
26 |
27 | const doApi = async () => {
28 | setAr([])
29 | setLoading(true)
30 |
31 | let { data } = await axios.get(`https://www.omdbapi.com/?s=${searchP||'bank'}&y=${year}&apikey=fd6aa444`)
32 | let temp_ar = data.Search || []
33 | temp_ar = temp_ar.length > 0 ? temp_ar.filter(temp_ar => temp_ar.Poster !== 'N/A') : [];
34 | setFlag(!temp_ar.length ? true : false)
35 | setAr(temp_ar)
36 | setLoading(false)
37 | }
38 |
39 | return (
40 |
41 |
42 |
VodApp
43 |
44 |
{ if (e.key === 'Enter') { nav(`/search/${e.target.value||'bank'}`); setSearchQ(e.target.value) } }} onInput={(e) => {
45 | setSearchQ(e.target.value)
46 | }} placeholder='Search...' className='vodApp-inputS col-md-10 col-9' type="search" /> {
47 | nav(`/search/${searchQ}`);
48 | }} style={{ marginRight: '10px', cursor: 'pointer' }} className='text-white' />
49 |
50 |
51 |
52 |
53 |
54 |
55 | {loading &&
}
56 |
57 | {(flag && (!loading)) &&
There is no results.... }
58 | {ar.map(item => {
59 | return (
60 |
61 | )
62 | })}
63 |
64 |
65 |
66 | )
67 | }
68 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Getting Started with Create React App
2 |
3 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
4 |
5 | ## Available Scripts
6 |
7 | In the project directory, you can run:
8 |
9 | ### `npm start`
10 |
11 | Runs the app in the development mode.\
12 | Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
13 |
14 | The page will reload when you make changes.\
15 | You may also see any lint errors in the console.
16 |
17 | ### `npm test`
18 |
19 | Launches the test runner in the interactive watch mode.\
20 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
21 |
22 | ### `npm run build`
23 |
24 | Builds the app for production to the `build` folder.\
25 | It correctly bundles React in production mode and optimizes the build for the best performance.
26 |
27 | The build is minified and the filenames include the hashes.\
28 | Your app is ready to be deployed!
29 |
30 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
31 |
32 | ### `npm run eject`
33 |
34 | **Note: this is a one-way operation. Once you `eject`, you can't go back!**
35 |
36 | 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.
37 |
38 | 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.
39 |
40 | 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.
41 |
42 | ## Learn More
43 |
44 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
45 |
46 | To learn React, check out the [React documentation](https://reactjs.org/).
47 |
48 | ### Code Splitting
49 |
50 | 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)
51 |
52 | ### Analyzing the Bundle Size
53 |
54 | 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)
55 |
56 | ### Making a Progressive Web App
57 |
58 | 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)
59 |
60 | ### Advanced Configuration
61 |
62 | 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)
63 |
64 | ### Deployment
65 |
66 | This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
67 |
68 | ### `npm run build` fails to minify
69 |
70 | 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)
71 |
--------------------------------------------------------------------------------